| @@ -10,6 +10,8 @@ import com.iformall.domain.po.WxCoupon; | |||||
| public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> { | public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> { | ||||
| List<WxCouponStatisVo> findPressData(WxCoupon wxCoupon); | List<WxCouponStatisVo> findPressData(WxCoupon wxCoupon); | ||||
| void insertPressData(WxCoupon wxCoupon); | |||||
| void updatePressData0(WxCoupon wxCoupon); | |||||
| void updatePressData1(WxCoupon wxCoupon); | void updatePressData1(WxCoupon wxCoupon); | ||||
| void updatePressData2(WxCoupon wxCoupon); | void updatePressData2(WxCoupon wxCoupon); | ||||
| void updatePressData3(WxCoupon wxCoupon); | void updatePressData3(WxCoupon wxCoupon); | ||||
| @@ -292,6 +292,8 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| record.setUpdateDate(new Date()); | record.setUpdateDate(new Date()); | ||||
| wxCouponMapper.insertSelective(record); | wxCouponMapper.insertSelective(record); | ||||
| wxCouponMapper.insertPressData(record); | |||||
| } else { | } else { | ||||
| if (merchantParamList != null && merchantParamList.size() > 0) { | if (merchantParamList != null && merchantParamList.size() > 0) { | ||||
| WxCouponMerchant cmParam = new WxCouponMerchant(); | WxCouponMerchant cmParam = new WxCouponMerchant(); | ||||
| @@ -359,6 +361,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| } | } | ||||
| record.setUpdateDate(new Date()); | record.setUpdateDate(new Date()); | ||||
| wxCouponMapper.updateByPrimaryKeySelective(record); | wxCouponMapper.updateByPrimaryKeySelective(record); | ||||
| wxCouponMapper.insertPressData(record); | |||||
| } | } | ||||
| return new ResultData(record.getId()); | return new ResultData(record.getId()); | ||||
| } | } | ||||
| @@ -641,6 +641,20 @@ | |||||
| <if test=" null == sortColumns"> order by c.status asc,c.create_date desc </if> | <if test=" null == sortColumns"> order by c.status asc,c.create_date desc </if> | ||||
| </select> | </select> | ||||
| <insert id="insertPressData" parameterType="com.iformall.domain.po.WxCoupon" > | |||||
| insert into `wx_coupon_press_data` | |||||
| (`id`, `tenant_id`, `cover_img`, `title`, `sale_price`, `price`) | |||||
| select `id`, `tenant_id`, `cover_img`, `title`, `sale_price`, `price` | |||||
| from wx_coupon where type = 8 and tenant_id = #{tenantId} and id = #{id} | |||||
| </insert> | |||||
| <update id="updatePressData0" parameterType="com.iformall.domain.po.WxCoupon" > | |||||
| update wx_coupon_press_data cpd, wx_coupon c | |||||
| set cpd.id=c.id, cpd.`cover_img`=c.`cover_img`, | |||||
| cpd.`title`=c.`title`,cpd.c.`sale_price`=,cpd.`price`=c.`price` | |||||
| where cpd.tenant_id = #{tenantId} and cpd.`id` = c.`id` and c.type = 8 and c.id = #{id} | |||||
| </update> | |||||
| <update id="updatePressData1" parameterType="com.iformall.domain.po.WxCoupon" > | <update id="updatePressData1" parameterType="com.iformall.domain.po.WxCoupon" > | ||||
| update wx_coupon_press_data cpd set change_rate = | update wx_coupon_press_data cpd set change_rate = | ||||
| IFNULL(round((select count(o.id) from wx_order o | IFNULL(round((select count(o.id) from wx_order o | ||||