|
@@ -58,20 +58,21 @@
|
|
|
|
|
|
<!-- 查询经销商列表信息 -->
|
|
<!-- 查询经销商列表信息 -->
|
|
<select id="selectSaleSiteList" resultType="com.qs.mp.channel.domain.vo.ChannelVO">
|
|
<select id="selectSaleSiteList" resultType="com.qs.mp.channel.domain.vo.ChannelVO">
|
|
- select t1.channel_id as channelId, t1.channel_no, t1.name, t1.parent_id, t1.level, t1.site_type, t1.site_name, t1.comm_rate as commRate, t1.province, t1.province_id, t1.city, t1.city_id, t1.area, t1.area_id, t1.address, t1.contact, t1.mobile, t1.user_id, t1.certify_status, t1.verify_status, t1.status, t1.created_time, t1.updated_time , t2.offLineQtyCnt, t2.offLineSaleCnt, t4.saleQty-t2.offLineSaleCnt as onLineSaleCnt, t3.userCnt
|
|
|
|
|
|
+ select t1.channel_id as channelId, t1.channel_no, t1.name, t1.parent_id, t1.level, t1.site_type, t1.site_name, t1.comm_rate as commRate, t1.province, t1.province_id, t1.city, t1.city_id, t1.area, t1.area_id, t1.address, t1.contact, t1.mobile, t1.user_id, t1.certify_status, t1.verify_status, t1.status, t1.created_time, t1.updated_time ,
|
|
|
|
+ t2.off_line_qty_cnt, t2.off_line_sale_cnt, t4.sale_qty-t2.off_line_sale_cnt as on_line_sale_cnt, t3.user_cnt
|
|
from mp_channel t1
|
|
from mp_channel t1
|
|
left join (
|
|
left join (
|
|
- select channel_id, SUM( b.pkg_unit - b.sale_qty ) AS offLineQtyCnt,
|
|
|
|
- SUM( b.sale_qty ) AS offLineSaleCnt
|
|
|
|
|
|
+ select channel_id, SUM( b.pkg_unit - b.sale_qty ) AS off_line_qty_cnt,
|
|
|
|
+ SUM( b.sale_qty ) AS off_line_sale_cnt
|
|
from mp_channel_order_detail a
|
|
from mp_channel_order_detail a
|
|
left join mp_ticket_package b on a.pkg_id=b.pkg_id
|
|
left join mp_ticket_package b on a.pkg_id=b.pkg_id
|
|
group by a.channel_id) t2 on t1.channel_id = t2.channel_id
|
|
group by a.channel_id) t2 on t1.channel_id = t2.channel_id
|
|
left join (
|
|
left join (
|
|
- select channel_id, count(*) AS userCnt
|
|
|
|
|
|
+ select channel_id, count(*) AS user_cnt
|
|
from mp_channel_user_rel
|
|
from mp_channel_user_rel
|
|
group by channel_id) t3 on t1.channel_id = t3.channel_id
|
|
group by channel_id) t3 on t1.channel_id = t3.channel_id
|
|
left join (
|
|
left join (
|
|
- select channel_id, count(*) AS saleQty
|
|
|
|
|
|
+ select channel_id, count(*) AS sale_qty
|
|
from mp_channel_commission
|
|
from mp_channel_commission
|
|
group by channel_id) t4 on t1.channel_id = t4.channel_id
|
|
group by channel_id) t4 on t1.channel_id = t4.channel_id
|
|
${ew.customSqlSegment}
|
|
${ew.customSqlSegment}
|