|
@@ -31,11 +31,48 @@
|
|
<if test="query!=null">
|
|
<if test="query!=null">
|
|
|
|
|
|
<if test="query.statDateL!=null ">
|
|
<if test="query.statDateL!=null ">
|
|
- AND ec.create_time >= #{query.statDateL}
|
|
|
|
|
|
+ AND cl.create_time >= #{query.statDateL}
|
|
</if>
|
|
</if>
|
|
|
|
|
|
<if test="query.statDateR!=null ">
|
|
<if test="query.statDateR!=null ">
|
|
- AND ec.create_time < #{query.statDateR}
|
|
|
|
|
|
+ AND cl.create_time < #{query.statDateR}
|
|
|
|
+ </if>
|
|
|
|
+
|
|
|
|
+ <if test="query.q!=null and query.q!=''">
|
|
|
|
+ AND cd.dept_code = #{query.q}
|
|
|
|
+ </if>
|
|
|
|
+
|
|
|
|
+ </if>
|
|
|
|
+
|
|
|
|
+ </where>
|
|
|
|
+ group by uc.user_name,uc.real_name, uc.id
|
|
|
|
+ ORDER BY total DESC
|
|
|
|
+ LIMIT 20
|
|
|
|
+
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="courseUserRankNew" resultType="com.gyee.exam.modules.course.dto.response.CourseUserRankDTO">
|
|
|
|
+
|
|
|
|
+ SELECT
|
|
|
|
+ uc.user_name AS deptName,
|
|
|
|
+ uc.real_name AS realName,
|
|
|
|
+ SUM((SELECT IFNULL(SUM(learn_min),0) FROM el_course_file_learn fl WHERE fl.course_id=cl.course_id AND fl.user_id=cl.user_id )) AS total
|
|
|
|
+ FROM sys_user uc
|
|
|
|
+ LEFT JOIN el_course_learn cl ON cl.user_id=uc.id
|
|
|
|
+ INNER JOIN el_course ec on ec.id = cl.course_id
|
|
|
|
+ LEFT JOIN sys_depart sd on sd.dept_code = uc.dept_code
|
|
|
|
+
|
|
|
|
+ <where>
|
|
|
|
+
|
|
|
|
+ uc.id IS NOT NULL AND sd.data_flag != '1'
|
|
|
|
+ <if test="query!=null">
|
|
|
|
+
|
|
|
|
+ <if test="query.statDateL!=null ">
|
|
|
|
+ AND cl.create_time >= #{query.statDateL}
|
|
|
|
+ </if>
|
|
|
|
+
|
|
|
|
+ <if test="query.statDateR!=null ">
|
|
|
|
+ AND cl.create_time < #{query.statDateR}
|
|
</if>
|
|
</if>
|
|
|
|
|
|
<if test="query.q!=null and query.q!=''">
|
|
<if test="query.q!=null and query.q!=''">
|