|
@@ -15,7 +15,7 @@
|
|
|
<select id="statList" resultType="com.ym.mec.biz.dal.wrapper.StudentCoursewarePlayRecordWrapper$StatQueryData">
|
|
|
select o.id_ as organizationId
|
|
|
, o.name_ as organizationName
|
|
|
- , count(s.user_id_) as memberNum
|
|
|
+ , count(distinct s.user_id_) as memberNum
|
|
|
, (count(distinct s.user_id_) - count(distinct pr.user_id_)) as noPlayNum
|
|
|
, count(distinct if(10 * 60 >= pr.play_time_, pr.user_id_, null)) as playTimeLess10
|
|
|
, count(distinct if(pr.play_time_ > 10 * 60 and 60 * 60 >= pr.play_time_, pr.user_id_, null)) as playTimeLess60
|
|
@@ -31,7 +31,12 @@
|
|
|
where create_time_ > #{statQuery.startTime}
|
|
|
and #{statQuery.endTime} > create_time_
|
|
|
group by user_id_) pr on s.user_id_ = pr.user_id_
|
|
|
- where s.membership_end_time_ >= now()
|
|
|
+ <where>
|
|
|
+ s.membership_end_time_ >= now()
|
|
|
+ <if test="statQuery.organizationId != null and statQuery.organizationId.trim() !=''">
|
|
|
+ and find_in_set(o.id_,statQuery.organizationId)
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
group by o.id_
|
|
|
order by ${statQuery.sortBy}
|
|
|
</select>
|
|
@@ -39,7 +44,7 @@
|
|
|
select o.id_ as organizationId
|
|
|
, o.name_ as organizationName
|
|
|
, su2.username_ as teacherName
|
|
|
- , count(s.user_id_) as memberNum
|
|
|
+ , count(distinct s.user_id_) as memberNum
|
|
|
, (count(distinct s.user_id_) - count(distinct pr.user_id_)) as noPlayNum
|
|
|
, count(distinct if(10 * 60 >= pr.play_time_, pr.user_id_, null)) as playTimeLess10
|
|
|
, count(distinct if(pr.play_time_ > 10 * 60 and 60 * 60 >= pr.play_time_, pr.user_id_, null)) as playTimeLess60
|
|
@@ -58,7 +63,7 @@
|
|
|
and #{statQuery.endTime} > create_time_
|
|
|
group by user_id_) pr on s.user_id_ = pr.user_id_
|
|
|
where o.id_ = #{statQuery.organizationId}
|
|
|
- and s.membership_end_time_ >= now()
|
|
|
+ and s.membership_end_time_ >= now() and stm.id_ is not null
|
|
|
group by stm.teacher_id_
|
|
|
order by ${statQuery.sortBy}
|
|
|
</select>
|