|
@@ -602,7 +602,7 @@
|
|
from student_statistics ss
|
|
from student_statistics ss
|
|
left join (select COUNT(cssp.id_) course_sum_,cssp.user_id_,COUNT(distinct cssp.course_schedule_id_) course_num_ from course_schedule cs
|
|
left join (select COUNT(cssp.id_) course_sum_,cssp.user_id_,COUNT(distinct cssp.course_schedule_id_) course_num_ from course_schedule cs
|
|
left join course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
|
|
left join course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
|
|
- where DATE_FORMAT(cs.class_date_,'%Y-%m-%d') BETWEEN #{queryInfo.startDate} AND #{queryInfo.endDate} AND cs.status_ = 'OVER' AND cs.type_ = 'VIP'
|
|
|
|
|
|
+ where DATE_FORMAT(cs.class_date_,'%Y-%m-%d') BETWEEN #{startDate} AND #{queryInfo.endDate} AND cs.status_ = 'OVER' AND cs.type_ = 'VIP'
|
|
<include refid="com.ym.mec.biz.dal.dao.CourseScheduleDao.courseIgnore"/>
|
|
<include refid="com.ym.mec.biz.dal.dao.CourseScheduleDao.courseIgnore"/>
|
|
group by cssp.user_id_) cs ON cs.user_id_ = ss.user_id_
|
|
group by cssp.user_id_) cs ON cs.user_id_ = ss.user_id_
|
|
left join sys_user su ON su.id_ = ss.user_id_
|
|
left join sys_user su ON su.id_ = ss.user_id_
|
|
@@ -628,17 +628,26 @@
|
|
from student_statistics ss
|
|
from student_statistics ss
|
|
left join (select cssp.user_id_,COUNT(distinct cssp.course_schedule_id_) consumerNum from course_schedule cs
|
|
left join (select cssp.user_id_,COUNT(distinct cssp.course_schedule_id_) consumerNum from course_schedule cs
|
|
left join course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
|
|
left join course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
|
|
- where DATE_FORMAT(cs.class_date_,'%Y-%m') = #{queryInfo.month} AND cs.status_ = 'OVER' AND cs.type_ = 'VIP'
|
|
|
|
|
|
+ where DATE_FORMAT(cs.class_date_,'%Y-%m') = #{month} AND cs.status_ = 'OVER' AND cs.type_ = 'VIP'
|
|
<include refid="com.ym.mec.biz.dal.dao.CourseScheduleDao.courseIgnore"/>
|
|
<include refid="com.ym.mec.biz.dal.dao.CourseScheduleDao.courseIgnore"/>
|
|
group by cssp.user_id_) cs ON cs.user_id_ = ss.user_id_
|
|
group by cssp.user_id_) cs ON cs.user_id_ = ss.user_id_
|
|
left join sys_user su ON su.id_ = ss.user_id_
|
|
left join sys_user su ON su.id_ = ss.user_id_
|
|
left join organization o ON o.id_ = su.organ_id_
|
|
left join organization o ON o.id_ = su.organ_id_
|
|
where ss.group_type_ = 'VIP' AND (ss.no_schedule_num_ > 0 OR ss.sub_course_num_) AND ss.lately_year_course_consumer_ > 0
|
|
where ss.group_type_ = 'VIP' AND (ss.no_schedule_num_ > 0 OR ss.sub_course_num_) AND ss.lately_year_course_consumer_ > 0
|
|
- <if test="queryInfo.organId != null and queryInfo.organId != ''">
|
|
|
|
|
|
+ <if test="organId != null and organId != ''">
|
|
AND FIND_IN_SET(su.organ_id_,#{queryInfo.organId})
|
|
AND FIND_IN_SET(su.organ_id_,#{queryInfo.organId})
|
|
</if>
|
|
</if>
|
|
group by ss.user_id_ order by su.organ_id_;
|
|
group by ss.user_id_ order by su.organ_id_;
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="countCourseConsumerDetail" resultType="java.lang.Integer">
|
|
|
|
+ select COUNT(DISTINCT ss.user_id_)
|
|
|
|
+ from student_statistics ss
|
|
|
|
+ left join sys_user su ON su.id_ = ss.user_id_
|
|
|
|
+ where ss.group_type_ = 'VIP' AND (ss.no_schedule_num_ > 0 OR ss.sub_course_num_) AND ss.lately_year_course_consumer_ > 0
|
|
|
|
+ <if test="organId != null and organId != ''">
|
|
|
|
+ AND FIND_IN_SET(su.organ_id_,#{organId})
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
<select id="queryPreCourseConsumerDetail" resultMap="StudentCourseConsumerDetailDto">
|
|
<select id="queryPreCourseConsumerDetail" resultMap="StudentCourseConsumerDetailDto">
|
|
select o.name_ organName,su.username_,ss.user_id_,su.phone_,
|
|
select o.name_ organName,su.username_,ss.user_id_,su.phone_,
|
|
CASE WHEN ss.no_schedule_num_ + CASE WHEN cs.course_num_ IS NULL THEN 0 ELSE cs.course_num_ END > 3
|
|
CASE WHEN ss.no_schedule_num_ + CASE WHEN cs.course_num_ IS NULL THEN 0 ELSE cs.course_num_ END > 3
|
|
@@ -648,15 +657,24 @@
|
|
left join (
|
|
left join (
|
|
select cssp.user_id_,COUNT(distinct cssp.course_schedule_id_) course_num_ from course_schedule cs
|
|
select cssp.user_id_,COUNT(distinct cssp.course_schedule_id_) course_num_ from course_schedule cs
|
|
left join course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
|
|
left join course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
|
|
- where DATE_FORMAT(cs.class_date_,'%Y-%m') BETWEEN #{queryInfo.startDate} AND #{queryInfo.endDate} AND cs.type_ = 'VIP'
|
|
|
|
|
|
+ where DATE_FORMAT(cs.class_date_,'%Y-%m') BETWEEN #{startDate} AND #{endDate} AND cs.type_ = 'VIP'
|
|
<include refid="com.ym.mec.biz.dal.dao.CourseScheduleDao.courseIgnore"/>
|
|
<include refid="com.ym.mec.biz.dal.dao.CourseScheduleDao.courseIgnore"/>
|
|
group by cssp.user_id_) cs ON ss.user_id_ = cs.user_id_
|
|
group by cssp.user_id_) cs ON ss.user_id_ = cs.user_id_
|
|
left join sys_user su ON su.id_ = ss.user_id_
|
|
left join sys_user su ON su.id_ = ss.user_id_
|
|
left join organization o ON o.id_ = su.organ_id_
|
|
left join organization o ON o.id_ = su.organ_id_
|
|
where ss.group_type_ = 'VIP' AND (ss.no_schedule_num_ > 0 OR ss.sub_course_num_) AND ss.lately_year_course_consumer_ > 0
|
|
where ss.group_type_ = 'VIP' AND (ss.no_schedule_num_ > 0 OR ss.sub_course_num_) AND ss.lately_year_course_consumer_ > 0
|
|
- <if test="queryInfo.organId != null and queryInfo.organId != ''">
|
|
|
|
- AND FIND_IN_SET(su.organ_id_,#{queryInfo.organId})
|
|
|
|
|
|
+ <if test="organId != null and organId != ''">
|
|
|
|
+ AND FIND_IN_SET(su.organ_id_,#{organId})
|
|
</if>
|
|
</if>
|
|
ORDER BY su.organ_id_
|
|
ORDER BY su.organ_id_
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="countPreCourseConsumerDetail" resultType="java.lang.Integer">
|
|
|
|
+ select COUNT(DISTINCT ss.user_id_)
|
|
|
|
+ from student_statistics ss
|
|
|
|
+ left join sys_user su ON su.id_ = ss.user_id_
|
|
|
|
+ where ss.group_type_ = 'VIP' AND (ss.no_schedule_num_ > 0 OR ss.sub_course_num_) AND ss.lately_year_course_consumer_ > 0
|
|
|
|
+ <if test="organId != null and organId != ''">
|
|
|
|
+ AND FIND_IN_SET(su.organ_id_,#{organId})
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|