|
@@ -19,9 +19,9 @@
|
|
t.sys_day_ym_ as timeStr,
|
|
t.sys_day_ym_ as timeStr,
|
|
</if>
|
|
</if>
|
|
sum(a.registerNum) as registerNum,
|
|
sum(a.registerNum) as registerNum,
|
|
- sum(a.entryNum) as entryNum,
|
|
|
|
- sum(a.liveNum) as liveNum,
|
|
|
|
- sum(a.musicianNum) as musicianNum
|
|
|
|
|
|
+ sum(b.entryNum) as entryNum,
|
|
|
|
+ sum(c.liveNum) as liveNum,
|
|
|
|
+ sum(d.musicianNum) as musicianNum
|
|
from sys_day t
|
|
from sys_day t
|
|
left join (
|
|
left join (
|
|
select
|
|
select
|
|
@@ -91,13 +91,13 @@
|
|
<![CDATA[AND t.sys_day_ < #{param.endTime} ]]>
|
|
<![CDATA[AND t.sys_day_ < #{param.endTime} ]]>
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
- order by t.sys_day_ desc
|
|
|
|
<if test="timeType != null and timeType == 'MONTH'">
|
|
<if test="timeType != null and timeType == 'MONTH'">
|
|
group by t.sys_day_ymd_
|
|
group by t.sys_day_ymd_
|
|
</if>
|
|
</if>
|
|
<if test="timeType != null and timeType == 'YEAR'">
|
|
<if test="timeType != null and timeType == 'YEAR'">
|
|
group by t.sys_day_ym_
|
|
group by t.sys_day_ym_
|
|
</if>
|
|
</if>
|
|
|
|
+ order by t.sys_day_ desc
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="totalStudent" resultType="com.yonge.cooleshow.biz.dal.vo.res.HomeTotalStudent">
|
|
<select id="totalStudent" resultType="com.yonge.cooleshow.biz.dal.vo.res.HomeTotalStudent">
|
|
@@ -110,7 +110,11 @@
|
|
</if>
|
|
</if>
|
|
sum(a.registerNum) as registerNum,
|
|
sum(a.registerNum) as registerNum,
|
|
sum(b.vipNum) as vipNum,
|
|
sum(b.vipNum) as vipNum,
|
|
- sum(c.courseNum) as courseNum
|
|
|
|
|
|
+ sum(c.practiceNum) as practiceNum,
|
|
|
|
+ sum(d.videoNum) as videoNum,
|
|
|
|
+ sum(e.liveNum) as liveNum,
|
|
|
|
+ sum(f.musicNum) as musicNum,
|
|
|
|
+ sum(g.shoppingNum) as shoppingNum
|
|
from sys_day t
|
|
from sys_day t
|
|
left join (
|
|
left join (
|
|
select
|
|
select
|
|
@@ -129,46 +133,94 @@
|
|
) a on t.sys_day_ymd_ = a.timeStr
|
|
) a on t.sys_day_ymd_ = a.timeStr
|
|
left join (
|
|
left join (
|
|
select
|
|
select
|
|
- a.timeStr,
|
|
|
|
|
|
+ DATE_FORMAT(t.first_vip_time_,'%Y-%m-%d') as timeStr,
|
|
count(1) as vipNum
|
|
count(1) as vipNum
|
|
- from (
|
|
|
|
- select
|
|
|
|
- DATE_FORMAT(t.create_time_,'%Y-%m-%d') as timeStr,
|
|
|
|
- t.user_id_
|
|
|
|
- from user_order t
|
|
|
|
- left join user_order_detail d on t.order_no_ = d.order_no_
|
|
|
|
- where t.status_ = 'PAID' and d.good_type_ = 'VIP'
|
|
|
|
|
|
+ from student_time t
|
|
|
|
+ <where>
|
|
<if test="param.startTime !=null">
|
|
<if test="param.startTime !=null">
|
|
- <![CDATA[AND t.create_time_ >= #{param.startTime} ]]>
|
|
|
|
|
|
+ <![CDATA[AND t.first_vip_time_ >= #{param.startTime} ]]>
|
|
</if>
|
|
</if>
|
|
<if test="param.endTime !=null">
|
|
<if test="param.endTime !=null">
|
|
- <![CDATA[AND t.create_time_ < #{param.endTime} ]]>
|
|
|
|
|
|
+ <![CDATA[AND t.first_vip_time_ < #{param.endTime} ]]>
|
|
</if>
|
|
</if>
|
|
- group by DATE_FORMAT(t.create_time_,'%Y-%m-%d'),t.user_id_
|
|
|
|
- ) a
|
|
|
|
- group by a.timeStr
|
|
|
|
|
|
+ </where>
|
|
|
|
+ group by DATE_FORMAT(t.first_vip_time_,'%Y-%m-%d')
|
|
) b on t.sys_day_ymd_ = b.timeStr
|
|
) b on t.sys_day_ymd_ = b.timeStr
|
|
left join (
|
|
left join (
|
|
select
|
|
select
|
|
- a.timeStr,
|
|
|
|
- count(1) as courseNum
|
|
|
|
- from (
|
|
|
|
- select
|
|
|
|
- DATE_FORMAT(t.create_time_,'%Y-%m-%d') as timeStr,
|
|
|
|
- t.user_id_
|
|
|
|
- from user_order t
|
|
|
|
- left join user_order_detail d on t.order_no_ = d.order_no_
|
|
|
|
- where t.status_ = 'PAID' and d.good_type_ in ('PRACTICE','LIVE','VIDEO')
|
|
|
|
|
|
+ DATE_FORMAT(t.first_practice_time_,'%Y-%m-%d') as timeStr,
|
|
|
|
+ count(1) as practiceNum
|
|
|
|
+ from student_time t
|
|
|
|
+ <where>
|
|
<if test="param.startTime !=null">
|
|
<if test="param.startTime !=null">
|
|
- <![CDATA[AND t.create_time_ >= #{param.startTime} ]]>
|
|
|
|
|
|
+ <![CDATA[AND t.first_practice_time_ >= #{param.startTime} ]]>
|
|
</if>
|
|
</if>
|
|
<if test="param.endTime !=null">
|
|
<if test="param.endTime !=null">
|
|
- <![CDATA[AND t.create_time_ < #{param.endTime} ]]>
|
|
|
|
|
|
+ <![CDATA[AND t.first_practice_time_ < #{param.endTime} ]]>
|
|
</if>
|
|
</if>
|
|
- group by DATE_FORMAT(t.create_time_,'%Y-%m-%d'),t.user_id_
|
|
|
|
- ) a
|
|
|
|
- group by a.timeStr
|
|
|
|
|
|
+ </where>
|
|
|
|
+ group by DATE_FORMAT(t.first_practice_time_,'%Y-%m-%d')
|
|
) c on t.sys_day_ymd_ = c.timeStr
|
|
) c on t.sys_day_ymd_ = c.timeStr
|
|
|
|
+ left join (
|
|
|
|
+ select
|
|
|
|
+ DATE_FORMAT(t.first_video_time_,'%Y-%m-%d') as timeStr,
|
|
|
|
+ count(1) as videoNum
|
|
|
|
+ from student_time t
|
|
|
|
+ <where>
|
|
|
|
+ <if test="param.startTime !=null">
|
|
|
|
+ <![CDATA[AND t.first_video_time_ >= #{param.startTime} ]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="param.endTime !=null">
|
|
|
|
+ <![CDATA[AND t.first_video_time_ < #{param.endTime} ]]>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ group by DATE_FORMAT(t.first_video_time_,'%Y-%m-%d')
|
|
|
|
+ ) d on t.sys_day_ymd_ = d.timeStr
|
|
|
|
+ left join (
|
|
|
|
+ select
|
|
|
|
+ DATE_FORMAT(t.first_live_time_,'%Y-%m-%d') as timeStr,
|
|
|
|
+ count(1) as liveNum
|
|
|
|
+ from student_time t
|
|
|
|
+ <where>
|
|
|
|
+ <if test="param.startTime !=null">
|
|
|
|
+ <![CDATA[AND t.first_live_time_ >= #{param.startTime} ]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="param.endTime !=null">
|
|
|
|
+ <![CDATA[AND t.first_live_time_ < #{param.endTime} ]]>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ group by DATE_FORMAT(t.first_live_time_,'%Y-%m-%d')
|
|
|
|
+ ) e on t.sys_day_ymd_ = e.timeStr
|
|
|
|
+ left join (
|
|
|
|
+ select
|
|
|
|
+ DATE_FORMAT(t.first_music_time_,'%Y-%m-%d') as timeStr,
|
|
|
|
+ count(1) as musicNum
|
|
|
|
+ from student_time t
|
|
|
|
+ <where>
|
|
|
|
+ <if test="param.startTime !=null">
|
|
|
|
+ <![CDATA[AND t.first_music_time_ >= #{param.startTime} ]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="param.endTime !=null">
|
|
|
|
+ <![CDATA[AND t.first_music_time_ < #{param.endTime} ]]>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ group by DATE_FORMAT(t.first_music_time_,'%Y-%m-%d')
|
|
|
|
+ ) f on t.sys_day_ymd_ = f.timeStr
|
|
|
|
+ left join (
|
|
|
|
+ select
|
|
|
|
+ DATE_FORMAT(t.first_mall_time_,'%Y-%m-%d') as timeStr,
|
|
|
|
+ count(1) as shoppingNum
|
|
|
|
+ from student_time t
|
|
|
|
+ <where>
|
|
|
|
+ <if test="param.startTime !=null">
|
|
|
|
+ <![CDATA[AND t.first_mall_time_ >= #{param.startTime} ]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="param.endTime !=null">
|
|
|
|
+ <![CDATA[AND t.first_mall_time_ < #{param.endTime} ]]>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ group by DATE_FORMAT(t.first_mall_time_,'%Y-%m-%d')
|
|
|
|
+ ) g on t.sys_day_ymd_ = g.timeStr
|
|
<where>
|
|
<where>
|
|
<if test="param.startTime !=null">
|
|
<if test="param.startTime !=null">
|
|
<![CDATA[AND t.sys_day_ >= #{param.startTime} ]]>
|
|
<![CDATA[AND t.sys_day_ >= #{param.startTime} ]]>
|
|
@@ -177,12 +229,12 @@
|
|
<![CDATA[AND t.sys_day_ < #{param.endTime} ]]>
|
|
<![CDATA[AND t.sys_day_ < #{param.endTime} ]]>
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
- order by t.sys_day_ desc
|
|
|
|
<if test="timeType != null and timeType == 'MONTH'">
|
|
<if test="timeType != null and timeType == 'MONTH'">
|
|
group by t.sys_day_ymd_
|
|
group by t.sys_day_ymd_
|
|
</if>
|
|
</if>
|
|
<if test="timeType != null and timeType == 'YEAR'">
|
|
<if test="timeType != null and timeType == 'YEAR'">
|
|
group by t.sys_day_ym_
|
|
group by t.sys_day_ym_
|
|
</if>
|
|
</if>
|
|
|
|
+ order by t.sys_day_ desc
|
|
</select>
|
|
</select>
|
|
</mapper>
|
|
</mapper>
|