|
@@ -27,24 +27,23 @@
|
|
|
|
|
|
<!-- 花王履约-->
|
|
|
<select id="getKaoCom" resultType="com.jzlife.report.dto.kaocf.KaoCom">
|
|
|
- select a.service_city as city,
|
|
|
+ select a.id as bookId,
|
|
|
+ a.service_city as city,
|
|
|
a.book_date as bookDate,
|
|
|
- b.goods_name as goodsName,
|
|
|
+ ifnull(st.level_two,b.goods_name) as goodsName,
|
|
|
ch.name as orderChannel,
|
|
|
- count(1) as serviceTime,
|
|
|
- sum(if(a.status in (3,4),1,0)) as servicedTime,
|
|
|
- sum(if(a.status in (3,4),c.actual_price/bk.service_times,0)) as gmv,
|
|
|
- gs.level_two as levelTwo
|
|
|
+-- count(1) as serviceTime,
|
|
|
+-- sum(if(a.status in (3,4),1,0)) as servicedTime,
|
|
|
+ if(a.status in (3,4),c.actual_price/bk.service_times,0) as gmv
|
|
|
from jlife_nurse.jz_order_book_detail a
|
|
|
join jlife_nurse.jz_order_goods b on a.order_id=b.order_id
|
|
|
join jlife_nurse.jz_order c on c.id=a.order_id
|
|
|
join jlife_nurse.jz_dm_channel ch on c.order_channel=ch.id
|
|
|
join jlife_nurse.jz_order_book bk on a.book_id=bk.id
|
|
|
- join jlife_reports.goods_stinct gs on gs.mall_goods_id=b.goods_id
|
|
|
+ left join jlife_reports.goods_stinct st on st.mall_product_id=b.product_id
|
|
|
where a.book_date between #{startTime} and #{endTime}
|
|
|
- and a.status in (1,2,3,4,7)
|
|
|
+ and a.status in (3,4)
|
|
|
and b.goods_name like '%花王%'
|
|
|
- group by a.service_city,a.book_date,b.goods_name,ch.name
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|