|
@@ -5,32 +5,38 @@
|
|
<result column="course_id" property="courseId" jdbcType="VARCHAR"/>
|
|
<result column="course_id" property="courseId" jdbcType="VARCHAR"/>
|
|
<result column="task_num" property="taskNum" jdbcType="INTEGER"/>
|
|
<result column="task_num" property="taskNum" jdbcType="INTEGER"/>
|
|
<result column="finish_num" property="finishNum" jdbcType="INTEGER"/>
|
|
<result column="finish_num" property="finishNum" jdbcType="INTEGER"/>
|
|
|
|
+ <result column="study_num" property="studyNum" jdbcType="INTEGER"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<select id="getUserCourseStudy" resultMap="studyMap">
|
|
<select id="getUserCourseStudy" resultMap="studyMap">
|
|
SELECT
|
|
SELECT
|
|
- cc.course_id,
|
|
|
|
- count(*) AS task_num,
|
|
|
|
- sum(
|
|
|
|
- CASE
|
|
|
|
-
|
|
|
|
- WHEN ucc.learn_process IS NOT NULL
|
|
|
|
- AND ucc.learn_process >= 1 THEN
|
|
|
|
- 1 ELSE 0
|
|
|
|
- END
|
|
|
|
- ) AS finish_num
|
|
|
|
|
|
+ cc.course_id,
|
|
|
|
+ count(*) AS task_num,
|
|
|
|
+ sum(
|
|
|
|
+ CASE
|
|
|
|
+ WHEN ucc.learn_process IS NOT NULL
|
|
|
|
+ AND ucc.learn_process >= 1 THEN
|
|
|
|
+ 1 ELSE 0
|
|
|
|
+ END
|
|
|
|
+ ) AS finish_num,
|
|
|
|
+ sum(
|
|
|
|
+ CASE
|
|
|
|
+ WHEN ucc.learn_process IS NOT NULL
|
|
|
|
+ THEN
|
|
|
|
+ 1 ELSE 0 END
|
|
|
|
+ ) as study_num
|
|
FROM
|
|
FROM
|
|
- course_catalog cc
|
|
|
|
|
|
+ course_catalog cc
|
|
LEFT JOIN user_course_catalog ucc ON cc.id = ucc.course_catalog_id
|
|
LEFT JOIN user_course_catalog ucc ON cc.id = ucc.course_catalog_id
|
|
- AND ucc.user_id = #{userId}
|
|
|
|
|
|
+ AND ucc.user_id = #{userId}
|
|
WHERE
|
|
WHERE
|
|
- cc.course_id IN
|
|
|
|
- <foreach collection="courseIds" index="index" item="id" open="(" separator="," close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- AND cc.type = 2
|
|
|
|
|
|
+ cc.course_id IN
|
|
|
|
+ <foreach collection="courseIds" index="index" item="id" open="(" separator="," close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ AND cc.type = 2
|
|
GROUP BY
|
|
GROUP BY
|
|
- cc.course_id
|
|
|
|
|
|
+ cc.course_id
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectPageList" resultType="com.ynfy.buss.course.usercoursecatalog.entity.dto.UserStudyDTO">
|
|
<select id="selectPageList" resultType="com.ynfy.buss.course.usercoursecatalog.entity.dto.UserStudyDTO">
|