|
@@ -106,6 +106,20 @@
|
|
|
<result property="performance" column="performance"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodSectionVo" id="ClassPeriodSectionVo">
|
|
|
+ <result property="userId" column="user_id"/>
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="typeName" column="type_name"/>
|
|
|
+ <result property="realName" column="realname"/>
|
|
|
+ <result property="classHours" column="class_hours"/>
|
|
|
+ <result property="studyStartTime" column="study_start_time"/>
|
|
|
+ <result property="status" column="status"/>
|
|
|
+ <result property="auditTime" column="audit_time"/>
|
|
|
+ <result property="type" column="type"/>
|
|
|
+ <result property="studyEndTime" column="study_end_time"/>
|
|
|
+ <result property="auditNum" column="audit_num"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
<select id="select" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
|
|
|
resultMap="ClassGradeUserVoResult">
|
|
|
SELECT
|
|
@@ -393,4 +407,111 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ <select id="listPeriodSection" parameterType="map" resultMap="ClassPeriodSectionVo">
|
|
|
+ SELECT
|
|
|
+ cs.section_id AS id,
|
|
|
+ #{courseId} AS course_id,
|
|
|
+ ( SELECT u.realname FROM `user` u WHERE 1 = 1 <if test="userId != null and userId !='' ">
|
|
|
+ and u.user_id = #{userId}
|
|
|
+ </if> ) AS realname,
|
|
|
+ ( SELECT u.user_id FROM `user` u WHERE 1 = 1 <if test="userId != null and userId !='' ">
|
|
|
+ and u.user_id = #{userId}
|
|
|
+ </if> ) AS user_id,
|
|
|
+ cs.NAME AS type_name,
|
|
|
+ NULL AS class_hours,
|
|
|
+ 3 AS type,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ups.record_start_time
|
|
|
+ FROM
|
|
|
+ user_period_status ups
|
|
|
+ LEFT JOIN user_period up ON up.id = ups.period_id
|
|
|
+ WHERE
|
|
|
+ period_status = 1
|
|
|
+ <if test="courseId != null and courseId !='' ">
|
|
|
+ AND up.course_id = #{courseId}
|
|
|
+ </if>
|
|
|
+ <if test="goodsId != null and goodsId !='' ">
|
|
|
+ AND up.goods_id = #{goodsId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ AND up.section_id = cs.section_id
|
|
|
+
|
|
|
+ ) AS study_start_time,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ups.record_end_time
|
|
|
+ FROM
|
|
|
+ user_period_status ups
|
|
|
+ LEFT JOIN user_period up ON up.id = ups.period_id
|
|
|
+ WHERE
|
|
|
+ period_status = 1
|
|
|
+ <if test="courseId != null and courseId !='' ">
|
|
|
+ AND up.course_id = #{courseId}
|
|
|
+ </if>
|
|
|
+ <if test="goodsId != null and goodsId !='' ">
|
|
|
+ AND up.goods_id = #{goodsId}
|
|
|
+ </if>
|
|
|
+ AND up.section_id = cs.section_id
|
|
|
+ ) AS study_end_time,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ups.`status`
|
|
|
+ FROM
|
|
|
+ user_period_status ups
|
|
|
+ LEFT JOIN user_period up ON up.id = ups.period_id
|
|
|
+ WHERE
|
|
|
+ period_status = 1
|
|
|
+ <if test="courseId != null and courseId !='' ">
|
|
|
+ AND up.course_id = #{courseId}
|
|
|
+ </if>
|
|
|
+ <if test="goodsId != null and goodsId !='' ">
|
|
|
+ AND up.goods_id = #{goodsId}
|
|
|
+ </if>
|
|
|
+ AND up.section_id = cs.section_id
|
|
|
+ ) AS STATUS,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ups.create_time
|
|
|
+ FROM
|
|
|
+ user_period_status ups
|
|
|
+ LEFT JOIN user_period up ON up.id = ups.period_id
|
|
|
+ WHERE
|
|
|
+ period_status = 1
|
|
|
+ <if test="courseId != null and courseId !='' ">
|
|
|
+ AND up.course_id = #{courseId}
|
|
|
+ </if>
|
|
|
+ <if test="goodsId != null and goodsId !='' ">
|
|
|
+ AND up.goods_id = #{goodsId}
|
|
|
+ </if>
|
|
|
+ AND up.section_id = cs.section_id
|
|
|
+ ) AS audit_time,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ COUNT( ups.id )
|
|
|
+ FROM
|
|
|
+ user_period_status ups
|
|
|
+ LEFT JOIN user_period up ON up.id = ups.period_id
|
|
|
+ WHERE
|
|
|
+ period_status = 1
|
|
|
+ <if test="courseId != null and courseId !='' ">
|
|
|
+ AND up.course_id = #{courseId}
|
|
|
+ </if>
|
|
|
+ <if test="goodsId != null and goodsId !='' ">
|
|
|
+ AND up.goods_id = #{goodsId}
|
|
|
+ </if>
|
|
|
+ AND up.section_id = cs.section_id
|
|
|
+ ) AS audit_num
|
|
|
+ FROM
|
|
|
+ course_chapter_section ccs
|
|
|
+ LEFT JOIN course_section cs ON ccs.section_id = cs.section_id
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ <if test="chapterId != null and chapterId !='' ">
|
|
|
+ AND ccs.chapter_id = #{chapterId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|