|
@@ -152,8 +152,8 @@
|
|
|
</select>
|
|
|
<select id="liveBuyTotal"
|
|
|
resultType="com.yonge.cooleshow.biz.dal.wrapper.TeacherIndexWrapper$CourseExposureTotal">
|
|
|
- select c.type,SUM(c.exposureNum) exposureNum,c.date from (
|
|
|
- select uod.good_type_ type,COUNT(distinct uod.order_no_) exposureNum,
|
|
|
+ select SUM(c.exposureNum) exposureNum,c.date from (
|
|
|
+ select COUNT(distinct uod.order_no_) exposureNum,
|
|
|
DATE_FORMAT(uod.create_time_,#{groupBy}) 'date' from user_order_detail uod
|
|
|
left join user_order uo ON uo.order_no_ = uod.order_no_
|
|
|
left join course_group cg On cg.id_ = uod.biz_id_
|
|
@@ -163,28 +163,28 @@
|
|
|
and uod.good_type_ = #{param.type}
|
|
|
</if>
|
|
|
group by DATE_FORMAT(uod.create_time_,#{groupBy})
|
|
|
- UNION ALL
|
|
|
- select uod.good_type_ type,COUNT(distinct uod.order_no_) exposureNum,
|
|
|
- DATE_FORMAT(uod.create_time_,#{groupBy}) 'date' from user_order_detail uod
|
|
|
- left join user_order uo ON uo.order_no_ = uod.order_no_
|
|
|
- left join video_lesson_group cg On cg.id_ = uod.biz_id_
|
|
|
- where cg.teacher_id_ = #{param.teacherId} AND uo.status_ = 'PAID' AND uod.good_type_ != 'TENANT_ALBUM'
|
|
|
- AND DATE_FORMAT(uod.create_time_, '%Y-%m-%d') BETWEEN #{param.startTime} AND #{param.endTime}
|
|
|
- <if test="param.type != null and param.type != ''">
|
|
|
- and uod.good_type_ = #{param.type}
|
|
|
+ <if test="param.type == null or param.type == ''">
|
|
|
+ UNION ALL
|
|
|
+ select COUNT(distinct uod.order_no_) exposureNum,
|
|
|
+ DATE_FORMAT(uod.create_time_,#{groupBy}) 'date' from user_order_detail uod
|
|
|
+ left join user_order uo ON uo.order_no_ = uod.order_no_
|
|
|
+ left join course_group cg On cg.id_ = uod.biz_id_
|
|
|
+ where cg.teacher_id_ = #{param.teacherId} AND uo.status_ = 'PAID' AND uod.good_type_ != 'TENANT_ALBUM' AND uod.good_type_ = 'VIDEO'
|
|
|
+ AND DATE_FORMAT(uod.create_time_, '%Y-%m-%d') BETWEEN #{param.startTime} AND #{param.endTime}
|
|
|
+ group by DATE_FORMAT(uod.create_time_,#{groupBy})
|
|
|
</if>
|
|
|
- group by DATE_FORMAT(uod.create_time_,#{groupBy})) c
|
|
|
+ ) c
|
|
|
group by c.date ORDER BY c.date
|
|
|
</select>
|
|
|
<select id="videoBuyTotal"
|
|
|
resultType="com.yonge.cooleshow.biz.dal.wrapper.TeacherIndexWrapper$CourseExposureTotal">
|
|
|
- select uod.good_type_ type,COUNT(distinct uod.order_no_) exposureNum,
|
|
|
- DATE_FORMAT(uod.create_time_,#{groupBy}) 'date' from user_order_detail uod
|
|
|
+ select COUNT(distinct uod.order_no_) exposureNum,
|
|
|
+ DATE_FORMAT(uod.create_time_,#{groupBy}) 'date' from user_order_detail uod
|
|
|
left join user_order uo ON uo.order_no_ = uod.order_no_
|
|
|
- left join video_lesson_group cg On cg.id_ = uod.biz_id_
|
|
|
- where uod.good_type_ = 'VIDEO' AND cg.teacher_id_ = #{param.teacherId} AND uo.status_ = 'PAID'
|
|
|
- AND DATE_FORMAT(uod.create_time_, '%Y-%m-%d') BETWEEN #{param.startTime} AND #{param.endTime}
|
|
|
- group by DATE_FORMAT(uod.create_time_,#{groupBy}) order by 'date'
|
|
|
+ left join course_group cg On cg.id_ = uod.biz_id_
|
|
|
+ where cg.teacher_id_ = #{param.teacherId} AND uo.status_ = 'PAID' AND uod.good_type_ != 'TENANT_ALBUM' AND uod.good_type_ = 'VIDEO'
|
|
|
+ AND DATE_FORMAT(uod.create_time_, '%Y-%m-%d') BETWEEN #{param.startTime} AND #{param.endTime}
|
|
|
+ group by DATE_FORMAT(uod.create_time_,#{groupBy})
|
|
|
</select>
|
|
|
<select id="musicSheetBuyTotal"
|
|
|
resultType="com.yonge.cooleshow.biz.dal.wrapper.TeacherIndexWrapper$CourseExposureTotal">
|