|
@@ -23,59 +23,62 @@
|
|
|
|
|
|
<select id="queryObject" resultType="com.kmall.admin.entity.MkActivitiesFullReductionEntity">
|
|
|
select
|
|
|
- `mafr_id`,
|
|
|
- `product_name`,
|
|
|
- `shop_sn`,
|
|
|
- `goods_sn`,
|
|
|
- `barcode`,
|
|
|
- `product_brand`,
|
|
|
- `product_series`,
|
|
|
- `qualified_amount`,
|
|
|
- `deduction_amount`,
|
|
|
- `mka_id`,
|
|
|
- `deadline`,
|
|
|
- `create_time`,
|
|
|
- `creater_sn`,
|
|
|
- `moder_sn`,
|
|
|
- `update_time`
|
|
|
- from mk_activities_full_reduction
|
|
|
- where mafr_id = #{id}
|
|
|
+ m.mafr_id,
|
|
|
+ goods.name as productName,
|
|
|
+ m.shop_sn,
|
|
|
+ m.goods_sn,
|
|
|
+ m.barcode,
|
|
|
+ m.product_brand,
|
|
|
+ m.product_series,
|
|
|
+ m.qualified_amount,
|
|
|
+ m.deduction_amount,
|
|
|
+ m.mka_id,
|
|
|
+ m.deadline,
|
|
|
+ m.create_time,
|
|
|
+ m.creater_sn,
|
|
|
+ m.moder_sn,
|
|
|
+ m.update_time
|
|
|
+ from mk_activities_full_reduction m ,
|
|
|
+ mall_goods goods
|
|
|
+ where mafr_id = #{id} and m.goods_sn = goods.goods_sn
|
|
|
</select>
|
|
|
|
|
|
<select id="queryList" resultType="com.kmall.admin.entity.MkActivitiesFullReductionEntity">
|
|
|
select
|
|
|
- `mafr_id`,
|
|
|
- `product_name`,
|
|
|
- `shop_sn`,
|
|
|
- `goods_sn`,
|
|
|
- `barcode`,
|
|
|
- `product_brand`,
|
|
|
- `product_series`,
|
|
|
- `qualified_amount`,
|
|
|
- `deduction_amount`,
|
|
|
- `mka_id`,
|
|
|
- `deadline`,
|
|
|
- `create_time`,
|
|
|
- `creater_sn`,
|
|
|
- `moder_sn`,
|
|
|
- `update_time`
|
|
|
- from mk_activities_full_reduction
|
|
|
- WHERE 1=1
|
|
|
+ m.mafr_id,
|
|
|
+ goods.name as productName,
|
|
|
+ m.shop_sn,
|
|
|
+ m.goods_sn,
|
|
|
+ m.barcode,
|
|
|
+ m.product_brand,
|
|
|
+ m.product_series,
|
|
|
+ m.qualified_amount,
|
|
|
+ m.deduction_amount,
|
|
|
+ m.mka_id,
|
|
|
+ m.deadline,
|
|
|
+ m.create_time,
|
|
|
+ m.creater_sn,
|
|
|
+ m.moder_sn,
|
|
|
+ m.update_time
|
|
|
+ from mk_activities_full_reduction m ,
|
|
|
+ mall_goods goods
|
|
|
+ WHERE 1=1 and
|
|
|
+ m.goods_sn = goods.goods_sn
|
|
|
<if test="name != null and name.trim() != ''">
|
|
|
- AND barcode LIKE concat('%',#{name},'%')
|
|
|
+ AND m.barcode LIKE concat('%',#{name},'%')
|
|
|
</if>
|
|
|
<if test="storeId != null and storeId.trim() != ''">
|
|
|
- AND shop_sn = #{storeId}
|
|
|
+ AND m.shop_sn = #{storeId}
|
|
|
</if>
|
|
|
<if test="mkaId != null">
|
|
|
- AND mka_id = #{mkaId}
|
|
|
+ AND m.mka_id = #{mkaId}
|
|
|
</if>
|
|
|
<choose>
|
|
|
<when test="sidx != null and sidx.trim() != ''">
|
|
|
order by ${sidx} ${order}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- order by mafr_id desc
|
|
|
+ order by m.mafr_id desc
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<if test="offset != null and limit != null">
|
|
@@ -84,35 +87,37 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="queryTotal" resultType="int">
|
|
|
- select count(*) from mk_activities_full_reduction
|
|
|
- WHERE 1=1
|
|
|
- <if test="name != null and name.trim() != ''">
|
|
|
- AND barcode LIKE concat('%',#{name},'%')
|
|
|
+ select count(*) from mk_activities_full_reduction m ,
|
|
|
+ mall_goods goods
|
|
|
+ WHERE 1=1 and
|
|
|
+ m.goods_sn = goods.goods_sn
|
|
|
+ <if test="name != null and name.trim() != ''">
|
|
|
+ AND m.barcode LIKE concat('%',#{name},'%')
|
|
|
</if>
|
|
|
<if test="storeId != null and storeId.trim() != ''">
|
|
|
- AND shop_sn = #{storeId}
|
|
|
+ AND m.shop_sn = #{storeId}
|
|
|
</if>
|
|
|
<if test="mkaId != null">
|
|
|
- AND mka_id = #{mkaId}
|
|
|
+ AND m.mka_id = #{mkaId}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
<insert id="save" parameterType="com.kmall.admin.entity.MkActivitiesFullReductionEntity" useGeneratedKeys="true" keyProperty="mafrId">
|
|
|
insert into mk_activities_full_reduction(
|
|
|
- `product_name`,
|
|
|
- `shop_sn`,
|
|
|
- `goods_sn`,
|
|
|
- `barcode`,
|
|
|
- `product_brand`,
|
|
|
- `product_series`,
|
|
|
- `qualified_amount`,
|
|
|
- `deduction_amount`,
|
|
|
- `mka_id`,
|
|
|
- `deadline`,
|
|
|
- `create_time`,
|
|
|
- `creater_sn`,
|
|
|
- `moder_sn`,
|
|
|
- `update_time`)
|
|
|
+ product_name,
|
|
|
+ shop_sn,
|
|
|
+ goods_sn,
|
|
|
+ barcode,
|
|
|
+ product_brand,
|
|
|
+ product_series,
|
|
|
+ qualified_amount,
|
|
|
+ deduction_amount,
|
|
|
+ mka_id,
|
|
|
+ deadline,
|
|
|
+ create_time,
|
|
|
+ creater_sn,
|
|
|
+ moder_sn,
|
|
|
+ update_time)
|
|
|
values(
|
|
|
#{productName},
|
|
|
#{shopSn},
|
|
@@ -133,20 +138,20 @@
|
|
|
<update id="update" parameterType="com.kmall.admin.entity.MkActivitiesFullReductionEntity">
|
|
|
update mk_activities_full_reduction
|
|
|
<set>
|
|
|
- <if test="productName != null">`product_name` = #{productName}, </if>
|
|
|
- <if test="shopSn != null">`shop_sn` = #{shopSn}, </if>
|
|
|
- <if test="goodsSn != null">`goods_sn` = #{goodsSn}, </if>
|
|
|
- <if test="barcode != null">`barcode` = #{barcode}, </if>
|
|
|
- <if test="productBrand != null">`product_brand` = #{productBrand}, </if>
|
|
|
- <if test="productSeries != null">`product_series` = #{productSeries}, </if>
|
|
|
- <if test="qualifiedAmount != null">`qualified_amount` = #{qualifiedAmount}, </if>
|
|
|
- <if test="deductionAmount != null">`deduction_amount` = #{deductionAmount}, </if>
|
|
|
- <if test="mkaId != null">`mka_id` = #{mkaId}, </if>
|
|
|
- <if test="deadline != null">`deadline` = #{deadline}, </if>
|
|
|
- <if test="createTime != null">`create_time` = #{createTime}, </if>
|
|
|
- <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
|
|
|
- <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
|
|
|
- <if test="updateTime != null">`update_time` = #{updateTime}</if>
|
|
|
+ <if test="productName != null">product_name = #{productName}, </if>
|
|
|
+ <if test="shopSn != null">shop_sn = #{shopSn}, </if>
|
|
|
+ <if test="goodsSn != null">goods_sn = #{goodsSn}, </if>
|
|
|
+ <if test="barcode != null">barcode = #{barcode}, </if>
|
|
|
+ <if test="productBrand != null">product_brand = #{productBrand}, </if>
|
|
|
+ <if test="productSeries != null">product_series = #{productSeries}, </if>
|
|
|
+ <if test="qualifiedAmount != null">qualified_amount = #{qualifiedAmount}, </if>
|
|
|
+ <if test="deductionAmount != null">deduction_amount = #{deductionAmount}, </if>
|
|
|
+ <if test="mkaId != null">mka_id = #{mkaId}, </if>
|
|
|
+ <if test="deadline != null">deadline = #{deadline}, </if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime}, </if>
|
|
|
+ <if test="createrSn != null">creater_sn = #{createrSn}, </if>
|
|
|
+ <if test="moderSn != null">moder_sn = #{moderSn}, </if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime}</if>
|
|
|
</set>
|
|
|
where mafr_id = #{mafrId}
|
|
|
</update>
|