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

[营销分析][添加][卡营销列表]

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
8eddc5c329
3 измененных файлов: 46 добавлений и 24 удалений
  1. +1
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java
  2. +3
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  3. +42
    -21
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

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

@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Param;
import com.iformall.domain.po.WxCoupon;

public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> {
List<WxCoupon> findCouponData(WxCoupon wxCoupon);
List<WxCoupon> findCountData(WxCoupon wxCoupon);
List<WxCoupon> findList(WxCoupon wxCoupon);
List<WxCoupon> findCardList(WxCoupon wxCoupon);


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

@@ -337,17 +337,17 @@ public class WxCouponServiceImpl implements WxCouponService {

@Override
public Long findSaleCardCount(WxCoupon wxCoupon) {
return null;
return wxCouponMapper.findSaleCardCount(wxCoupon);
}

@Override
public Long findTranCardCount(WxCoupon wxCoupon) {
return null;
return wxCouponMapper.findTranCardCount(wxCoupon);
}

@Override
public Long findSubsidyMoney(WxCoupon wxCoupon) {
return null;
return wxCouponMapper.findSubsidyMoney(wxCoupon);
}

@Override


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

@@ -186,27 +186,6 @@
<include refid="dynamicWhereConditions"/>
</select>

<select id="findCountData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap">
select <include refid="allColumns"/>,
(select count(distinct wco.owner_id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count,
(select count(distinct wcs.coupon_order_id) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
left join wx_card_transfer_info wcs on wcs.coupon_order_id = ci.id
where wc.id = c.id) as transfer_count,
(select sum(ci.sale_amount) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
where wc.id = c.id) as sale_amount,
(select sum(wcs.real_payment) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
left join wx_card_spend wcs on wcs.card_id = ci.id
where wc.id = c.id) as sum_payment
from wx_coupon c where 1=1
<if test=" null != title ">
and `title` like concat('%', #{title},'%')
</if>
order by status asc,create_date desc
</select>

<sql id="dynamicWhereConditionsForCard">
where `type` = 100

@@ -732,4 +711,46 @@
and c.title like concat('%', #{title},'%')
</if>
</select>

<select id="findCountData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap">
select <include refid="allColumns"/>,
(select count(distinct wco.owner_id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count,
(select count(distinct wcs.coupon_order_id) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
left join wx_card_transfer_info wcs on wcs.coupon_order_id = ci.id
where wc.id = c.id) as transfer_count,
(select sum(ci.sale_amount) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
where wc.id = c.id) as sale_amount,
(select sum(wcs.real_payment) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
left join wx_card_spend wcs on wcs.card_id = ci.id
where wc.id = c.id) as sum_payment
from wx_coupon c where 1=1
<if test=" null != title ">
and `title` like concat('%', #{title},'%')
</if>
order by status asc,create_date desc
</select>

<select id="findCouponData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap">
select <include refid="allColumns"/>,
(select count(distinct wco.owner_id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count,
(select count(distinct wcs.coupon_order_id) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
left join wx_card_transfer_info wcs on wcs.coupon_order_id = ci.id
where wc.id = c.id) as transfer_count,
(select sum(ci.sale_amount) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
where wc.id = c.id) as sale_amount,
(select sum(wcs.real_payment) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
left join wx_card_spend wcs on wcs.card_id = ci.id
where wc.id = c.id) as sum_payment
from wx_coupon c where 1=1
<if test=" null != title ">
and `title` like concat('%', #{title},'%')
</if>
order by status asc,create_date desc
</select>
</mapper>

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