Просмотр исходного кода

[砍价][修改]:砍价券新增或者更新时更新砍价数据表

release_toaliyun_real
Stormeye Wu 7 лет назад
Родитель
Сommit
081ac96b4b
3 измененных файлов: 19 добавлений и 0 удалений
  1. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java
  2. +3
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  3. +14
    -0
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java Просмотреть файл

@@ -10,6 +10,8 @@ import com.iformall.domain.po.WxCoupon;

public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> {
List<WxCouponStatisVo> findPressData(WxCoupon wxCoupon);
void insertPressData(WxCoupon wxCoupon);
void updatePressData0(WxCoupon wxCoupon);
void updatePressData1(WxCoupon wxCoupon);
void updatePressData2(WxCoupon wxCoupon);
void updatePressData3(WxCoupon wxCoupon);


+ 3
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java Просмотреть файл

@@ -292,6 +292,8 @@ public class WxCouponServiceImpl implements WxCouponService {
record.setUpdateDate(new Date());
wxCouponMapper.insertSelective(record);

wxCouponMapper.insertPressData(record);

} else {
if (merchantParamList != null && merchantParamList.size() > 0) {
WxCouponMerchant cmParam = new WxCouponMerchant();
@@ -359,6 +361,7 @@ public class WxCouponServiceImpl implements WxCouponService {
}
record.setUpdateDate(new Date());
wxCouponMapper.updateByPrimaryKeySelective(record);
wxCouponMapper.insertPressData(record);
}
return new ResultData(record.getId());
}


+ 14
- 0
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Просмотреть файл

@@ -641,6 +641,20 @@
<if test=" null == sortColumns"> order by c.status asc,c.create_date desc </if>
</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 wx_coupon_press_data cpd set change_rate =
IFNULL(round((select count(o.id) from wx_order o


Загрузка…
Отмена
Сохранить