|
@@ -43,44 +43,43 @@
|
|
|
|
|
|
<!-- 公共查询sql片段 -->
|
|
|
<sql id="select_sql">
|
|
|
- select *
|
|
|
- from tb_business_item
|
|
|
+ select a.*,b.goods_name,b.card_no,b.china_car_no
|
|
|
+ from tb_business_item a,tb_business b where a.business_id=b.id
|
|
|
</sql>
|
|
|
|
|
|
<!-- 查 - 根据id -->
|
|
|
<select id="getById" resultMap="model">
|
|
|
- <include refid="select_sql"></include>
|
|
|
+ select * from tb_busness
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
|
|
|
<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
|
|
|
- <select id="getList" resultMap="model">
|
|
|
- <include refid="select_sql"></include>
|
|
|
- <where>
|
|
|
- <if test=' this.has("id") '> and id = #{id} </if>
|
|
|
- <if test=' this.has("businessId") '> and business_id = #{businessId} </if>
|
|
|
- <if test=' this.has("pickCustomerId") '> and pick_customer_id = #{pickCustomerId} </if>
|
|
|
- <if test=' this.has("itemCode") '> and item_code = #{itemCode} </if>
|
|
|
- <if test=' this.has("itemPrice") '> and item_price = #{itemPrice} </if>
|
|
|
- <if test=' this.has("itemName") '> and item_name like concat('%',#{itemName},'%') </if>
|
|
|
- <if test=' this.has("status") '> and status = #{status} </if>
|
|
|
- <if test=' this.has("operateTime") '> and operate_time = #{operateTime} </if>
|
|
|
- <if test=' this.has("operaror") '> and operaror = #{operaror} </if>
|
|
|
- <if test=' this.has("typeFlag") '> and business_type !='0' </if>
|
|
|
- </where>
|
|
|
+ <select id="getList" resultType="com.pj.project.tb_business_item.TbBusinessItem">
|
|
|
+ select a.*,b.goods_name,b.card_no,b.china_car_no
|
|
|
+ from tb_business_item a,tb_business b where a.business_id=b.id
|
|
|
+ <if test=' this.has("id") '> and a.id = #{id} </if>
|
|
|
+ <if test=' this.has("businessId") '> and a.business_id = #{businessId} </if>
|
|
|
+ <if test=' this.has("pickCustomerId") '> and a.pick_customer_id = #{pickCustomerId} </if>
|
|
|
+ <if test=' this.has("itemCode") '> and a.item_code = #{itemCode} </if>
|
|
|
+ <if test=' this.has("itemPrice") '> and a.item_price = #{itemPrice} </if>
|
|
|
+ <if test=' this.has("itemName") '> and a.item_name like concat('%',#{itemName},'%') </if>
|
|
|
+ <if test=' this.has("status") '> and a.status = #{status} </if>
|
|
|
+ <if test=' this.has("operateTime") '> and a.operate_time = #{operateTime} </if>
|
|
|
+ <if test=' this.has("operaror") '> and a.operaror = #{operaror} </if>
|
|
|
+ <if test=' this.has("typeFlag") '> and a.business_type !='0' </if>
|
|
|
order by
|
|
|
<choose>
|
|
|
- <when test='sortType == 1'> id desc </when>
|
|
|
- <when test='sortType == 2'> business_id desc </when>
|
|
|
- <when test='sortType == 3'> item_code desc </when>
|
|
|
- <when test='sortType == 4'> item_price desc </when>
|
|
|
- <when test='sortType == 5'> item_name desc </when>
|
|
|
- <when test='sortType == 6'> status desc </when>
|
|
|
- <when test='sortType == 7'> operate_time desc </when>
|
|
|
- <when test='sortType == 8'> operaror desc </when>
|
|
|
- <when test='sortType == 9'> pick_time desc </when>
|
|
|
- <when test='sortType == 10'> create_time desc </when>
|
|
|
- <otherwise> id desc </otherwise>
|
|
|
+ <when test='sortType == 1'> a.id desc </when>
|
|
|
+ <when test='sortType == 2'> a.business_id desc </when>
|
|
|
+ <when test='sortType == 3'> a.item_code desc </when>
|
|
|
+ <when test='sortType == 4'> a.item_price desc </when>
|
|
|
+ <when test='sortType == 5'> a.item_name desc </when>
|
|
|
+ <when test='sortType == 6'> a.status desc </when>
|
|
|
+ <when test='sortType == 7'> a.operate_time desc </when>
|
|
|
+ <when test='sortType == 8'> a.operaror desc </when>
|
|
|
+ <when test='sortType == 9'> a.pick_time desc </when>
|
|
|
+ <when test='sortType == 10'> a.create_time desc </when>
|
|
|
+ <otherwise> a.id desc </otherwise>
|
|
|
</choose>
|
|
|
</select>
|
|
|
|