| | |
| | | <mapper namespace="com.gkhy.exam.institutionalaccess.mapper.ThStudyDetailMapper"> |
| | | <select id="listByPage" resultType="com.gkhy.exam.institutionalaccess.model.vo.ThStudyDetailVO"> |
| | | SELECT |
| | | d.*, |
| | | s.name, |
| | | b.batch_name, |
| | | c.course_name, |
| | | cc.chapter_name |
| | | d.id, |
| | | d.uuid, |
| | | d.serial_num, |
| | | d.idcard, |
| | | d.institution_name, |
| | | d.course_uuid, |
| | | d.train_org_name, |
| | | d.batch_uuid, |
| | | d.chapter_uuid, |
| | | d.finish_status, |
| | | d.duration, |
| | | d.start_time, |
| | | d.finish_time, |
| | | d.start_position, |
| | | d.finish_position, |
| | | d.video_url, |
| | | d.lesson_report_url, |
| | | d.create_time |
| | | FROM |
| | | th_study_detail d |
| | | LEFT JOIN th_student s ON s.idcard = d.idcard |
| | | LEFT JOIN th_batch b ON b.uuid = d.batch_uuid |
| | | LEFT JOIN th_course c ON c.uuid = d.course_uuid |
| | | LEFT JOIN th_course_chapter cc ON cc.uuid = d.chapter_uuid |
| | | where d.del_flag = 0 |
| | | <if test="query.idcard != null and query.idcard != ''"> |
| | | and d.idcard = #{query.idcard} |
| | |
| | | <if test="query.courseUuid != null and query.courseUuid != ''"> |
| | | and d.course_uuid = #{query.courseUuid} |
| | | </if> |
| | | <if test="query.name != null and query.name != ''"> |
| | | and s.name like concat('%', #{query.name}, '%') |
| | | </if> |
| | | <if test="query.startTime != null"><!-- 开始时间检索 --> |
| | | and date_format(d.create_time,'%y-%m-%d') >= date_format(#{query.startTime},'%y-%m-%d') |
| | | </if> |
| | | <if test="query.endTime != null"><!-- 结束时间检索 --> |
| | | and date_format(d.create_time,'%y-%m-%d') <= date_format(#{query.endTime},'%y-%m-%d') |
| | | </if> |
| | | order by d.create_time desc |
| | | ORDER BY |
| | | d.id DESC |
| | | |
| | | </select> |
| | | |
| | | <select id="statisticDurationByIdcard" resultType="com.gkhy.exam.institutionalaccess.model.vo.ThStudyVO"> |
| | | SELECT |
| | | d.idcard, |
| | | d.course_uuid, |
| | | sum( d.duration ) duration |
| | | FROM |
| | | th_study_detail d |
| | |
| | | d.del_flag = 0 |
| | | AND d.batch_uuid = #{batchUuid} |
| | | GROUP BY |
| | | d.idcard |
| | | d.idcard, |
| | | d.course_uuid |
| | | </select> |
| | | <select id="listByBatchUuid" resultType="com.gkhy.exam.institutionalaccess.model.vo.ThStudyDetailVO"> |
| | | SELECT |
| | |
| | | AND d.batch_uuid = #{batchUuid} |
| | | </select> |
| | | |
| | | <insert id="insertBatch"> |
| | | INSERT INTO th_study_detail (id,uuid,serial_num, idcard,institution_id, institution_name,course_uuid, train_org_name,batch_uuid,chapter_uuid, |
| | | finish_status,duration,start_time,finish_time,start_position,finish_position,video_url,lesson_report_url,del_flag,create_time,update_time,create_by,update_by) VALUES |
| | | <foreach collection="list" separator="," item="item"> |
| | | (#{item.id},#{item.uuid},#{item.serialNum},#{item.idcard},#{item.institutionId},#{item.institutionName},#{item.courseUuid},#{item.trainOrgName},#{item.batchUuid},#{item.chapterUuid}, |
| | | #{item.finishStatus},#{item.duration},#{item.startTime}, |
| | | #{item.finishTime},#{item.startPosition},#{item.finishPosition},#{item.videoUrl},#{item.lessonReportUrl},#{item.delFlag},#{item.createTime}, |
| | | #{item.updateTime},#{item.createBy},#{item.updateBy}) |
| | | </foreach> |
| | | </insert> |
| | | <update id="updateBatch" parameterType="java.util.List" > |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | UPDATE th_study_detail |
| | | <set> |
| | | <if test="item.uuid != null and item.uuid != ''" > |
| | | uuid = #{item.uuid}, |
| | | </if> |
| | | <if test="item.serialNum != null" > |
| | | serial_num = #{item.serialNum}, |
| | | </if> |
| | | <if test="item.idcard != null and item.idcard != ''" > |
| | | idcard = #{item.idcard}, |
| | | </if> |
| | | <if test="item.institutionId != null" > |
| | | institution_id = #{item.institutionId}, |
| | | </if> |
| | | <if test="item.institutionName != null and item.institutionName != ''" > |
| | | institution_name = #{item.institutionName}, |
| | | </if> |
| | | <if test="item.courseUuid != null and item.courseUuid != ''" > |
| | | course_uuid = #{item.courseUuid}, |
| | | </if> |
| | | <if test="item.trainOrgName != null and item.trainOrgName != ''" > |
| | | train_org_name = #{item.trainOrgName}, |
| | | </if> |
| | | <if test="item.batchUuid != null and item.batchUuid != ''" > |
| | | batch_uuid = #{item.batchUuid}, |
| | | </if> |
| | | <if test="item.chapterUuid != null and item.chapterUuid != ''" > |
| | | chapter_uuid = #{item.chapterUuid}, |
| | | </if> |
| | | <if test="item.finishStatus != null" > |
| | | finish_status = #{item.finishStatus}, |
| | | </if> |
| | | <if test="item.duration != null" > |
| | | duration = #{item.duration}, |
| | | </if> |
| | | <if test="item.startTime != null" > |
| | | start_time = #{item.startTime}, |
| | | </if> |
| | | <if test="item.finishTime != null" > |
| | | finish_time = #{item.finishTime}, |
| | | </if> |
| | | <if test="item.startPosition != null" > |
| | | start_position = #{item.startPosition}, |
| | | </if> |
| | | <if test="item.finishPosition != null" > |
| | | finish_position = #{item.finishPosition}, |
| | | </if> |
| | | <if test="item.videoUrl != null and item.videoUrl != ''" > |
| | | video_url = #{item.videoUrl}, |
| | | </if> |
| | | <if test="item.lessonReportUrl != null and item.lessonReportUrl != ''" > |
| | | lesson_report_url = #{item.lessonReportUrl}, |
| | | </if> |
| | | <if test="item.delFlag != null" > |
| | | del_flag = #{item.delFlag}, |
| | | </if> |
| | | <if test="item.updateBy != null and item.updateBy != ''" > |
| | | update_by = #{item.updateBy}, |
| | | </if> |
| | | <if test="item.updateTime != null" > |
| | | update_time = #{item.updateTime} |
| | | </if> |
| | | </set> |
| | | where id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | <select id="getByUuids" resultType="com.gkhy.exam.institutionalaccess.entity.ThStudyDetail" > |
| | | select id,uuid,serial_num, idcard,institution_id, institution_name,course_uuid, train_org_name,batch_uuid,chapter_uuid, |
| | | finish_status,duration,start_time,finish_time,start_position,finish_position,video_url,lesson_report_url from th_study_detail where del_flag = 0 and uuid in |
| | | <foreach collection="studyUuids" item="studyUuid" index ="index" open="(" close=")" separator=","> |
| | | #{studyUuid} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="listByCourseUuid" resultType="com.gkhy.exam.institutionalaccess.model.vo.ThStudyDetailVO"> |
| | | SELECT |
| | | d.*, |
| | | cc.chapter_name, |
| | | cc.lesson_num |
| | | FROM |
| | | th_study_detail d |
| | | INNER JOIN th_batch_course bc on bc.batch_uuid = d.batch_uuid |
| | | LEFT JOIN th_course_chapter cc ON cc.uuid = d.chapter_uuid |
| | | WHERE |
| | | d.del_flag = 0 |
| | | AND bc.course_uuid = #{courseUuid} |
| | | </select> |
| | | </mapper> |
| | | |