Browse Source

[砍价营销数据][修改]:删除无用的表

release_toaliyun_real
Stormeye Wu 7 years ago
parent
commit
d1f381c7e0
3 changed files with 1 additions and 64 deletions
  1. +1
    -0
      mallinkAdmin/src/main/resources/db/migration/V201906291010__DROP_COUPON_PRESS_DATA.sql
  2. +0
    -8
      mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java
  3. +0
    -56
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 1
- 0
mallinkAdmin/src/main/resources/db/migration/V201906291010__DROP_COUPON_PRESS_DATA.sql View File

@@ -0,0 +1 @@
DROP TABLE `wx_coupon_press_data`;

+ 0
- 8
mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java View File

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

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

List<WxCouponStatisVo> findCouponData(WxCoupon wxCoupon);
List<WxCouponStatisVo> findCountData(WxCoupon wxCoupon);



+ 0
- 56
mallinkService/src/main/resources/mapper/WxCouponMapper.xml View File

@@ -685,62 +685,6 @@
<if test=" null == sortColumns">order by c.status asc,c.create_date desc</if>
</select>

<insert id="delPressData" parameterType="com.iformall.domain.po.WxCoupon">
delete from `wx_coupon_press_data` where tenant_id = #{tenantId}
</insert>

<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}
</insert>

<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
where o.tenant_id = #{tenantId} and o.order_status = 1 and o.product_id = cpd.id)/
(select count(wop.id) from wx_order o
left join wx_order_press wop on wop.order_id = o.id
where o.product_id = cpd.id and o.tenant_id = #{tenantId} and wop.first = 1)*100,2),0)
where cpd.tenant_id = #{tenantId}
</update>

<update id="updatePressData2" parameterType="com.iformall.domain.po.WxCoupon">
update wx_coupon_press_data cpd set press_count= (select count(wop.id) from wx_order o
left join wx_order_press wop on wop.order_id = o.id
where o.product_id = cpd.id and o.tenant_id = #{tenantId} and wop.first = 1)
where cpd.tenant_id=#{tenantId}
</update>

<update id="updatePressData3" parameterType="com.iformall.domain.po.WxCoupon">
update wx_coupon_press_data cpd set
press_succ_count =
(select count(o.id) from wx_order o
where o.product_id = cpd.id and o.tenant_id = #{tenantId} and o.order_status = 1)
where cpd.tenant_id=#{tenantId}
</update>

<update id="updatePressData4" parameterType="com.iformall.domain.po.WxCoupon">
update wx_coupon_press_data cpd set join_count =
(select count(wop.id) from wx_order o
left join wx_order_press wop on wop.order_id = o.id
where o.tenant_id = #{tenantId} and o.product_id = cpd.id and o.payment_type = 0)
where cpd.tenant_id=#{tenantId}
</update>

<select id="updatePressData5" parameterType="com.iformall.domain.po.WxCoupon">
update wx_coupon_press_data cpd set payment_rate = round(
(select count(wco.id) xcount from wx_coupon_order wco
where wco.tenant_id = #{tenantId} and wco.coupon_id = cpd.id and wco.coupon_order_status = 1)
/
(select count(wop.id) from wx_order o
left join wx_order_press wop on wop.order_id = o.id
where o.tenant_id = #{tenantId} and o.product_id = cpd.id and wop.first = 1 )
*100,2)
where cpd.tenant_id=#{tenantId}
</select>

<select id="findCouponOrderCount" parameterType="com.iformall.domain.po.WxCoupon"
resultType="com.iformall.domain.vo.WxCouponStatisVo">
select DATE_FORMAT(wco.create_date,'%Y-%m-%d') xtime,count(wco.id) xcount from wx_coupon c


Loading…
Cancel
Save