From 3aae8ddd5b9624626921abdcc33122dccdcd5c61 Mon Sep 17 00:00:00 2001 From: “djh” <“3298565835@qq.com”> Date: 星期五, 27 十二月 2024 13:24:46 +0800 Subject: [PATCH] 修改学时证书接收接口 --- exam-system/src/main/resources/mapper/institutionaccess/ThExamRecordMapper.xml | 88 +++++++++++++++++++++++++++++++++----------- 1 files changed, 66 insertions(+), 22 deletions(-) diff --git a/exam-system/src/main/resources/mapper/institutionaccess/ThExamRecordMapper.xml b/exam-system/src/main/resources/mapper/institutionaccess/ThExamRecordMapper.xml index 2bfb2fd..c373aa4 100644 --- a/exam-system/src/main/resources/mapper/institutionaccess/ThExamRecordMapper.xml +++ b/exam-system/src/main/resources/mapper/institutionaccess/ThExamRecordMapper.xml @@ -1,32 +1,76 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.gkhy.exam.institutionalaccess.mapper.ThExamRecordMapper"> -<select id="listByPage" resultType="com.gkhy.exam.institutionalaccess.model.vo.ThExamRecordVO"> - SELECT + <select id="listByPage" resultType="com.gkhy.exam.institutionalaccess.model.vo.ThExamRecordVO"> + SELECT e.*, s.`name`, - c.course_name, b.batch_name - FROM + FROM th_exam_record e - LEFT JOIN th_student s ON s.idcard = e.idcard - LEFT JOIN th_course c ON c.uuid = e.course_uuid - LEFT JOIN th_batch b ON b.uuid = e.batch_uuid - WHERE e.del_flag = 0 - <if test="query.idcard != null and query.idcard != ''"> - and e.idcard = #{query.idcard} - </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(e.exam_start_time,'%y-%m-%d') >= date_format(#{query.startTime},'%y-%m-%d') - </if> - <if test="query.endTime != null"><!-- 结束时间检索 --> - and date_format(e.exam_start_time,'%y-%m-%d') <= date_format(#{query.endTime},'%y-%m-%d') - </if> - order by e.create_time desc -</select> + LEFT JOIN th_student s ON s.idcard = e.idcard + LEFT JOIN th_batch b ON b.uuid = e.batch_uuid + WHERE + e.del_flag = 0 and s.del_flag = 0 and b.del_flag = 0 + <if test="query.idcard != null and query.idcard != ''"> + and e.idcard = #{query.idcard} + </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(e.exam_start_time,'%y-%m-%d') >= date_format(#{query.startTime},'%y-%m-%d') + </if> + <if test="query.endTime != null"><!-- 结束时间检索 --> + and date_format(e.exam_start_time,'%y-%m-%d') <= date_format(#{query.endTime},'%y-%m-%d') + </if> + order by e.create_time desc + </select> + <insert id="insertBatch"> + INSERT INTO th_exam_record (id,uuid,idcard,batch_uuid, institution_id, institution_name,train_org_name,exam_name, + exam_start_time,exam_submit_time,exam_user_score,exam_total_score,exam_pass_score,exam_is_pass, + del_flag,create_time,update_time,create_by,update_by) VALUES + <foreach collection="list" separator="," item="item"> + (#{item.id},#{item.uuid},#{item.idcard},#{item.batchUuid},#{item.institutionId},#{item.institutionName},#{item.trainOrgName}, + #{item.examName},#{item.examStartTime},#{item.examSubmitTime},#{item.examUserScore},#{item.examTotalScore},#{item.examPassScore},#{item.examIsPass},#{item.delFlag},#{item.createTime}, + #{item.updateTime},#{item.createBy},#{item.updateBy},#{item.finishStatus}) + </foreach> + </insert> + + <select id="getByUuids" resultType="com.gkhy.exam.institutionalaccess.entity.ThExamRecord" > + select id,uuid,idcard,batch_uuid, institution_id, institution_name,train_org_name,exam_name, + exam_start_time,exam_submit_time,exam_user_score,exam_total_score,exam_pass_score,exam_is_pass from th_exam_record where del_flag = 0 and idcard in + <foreach collection="examUuids" item="examUuid" index ="index" open="(" close=")" separator=","> + #{examUuid} + </foreach> + </select> + + <select id="getStatistic" resultType="com.gkhy.exam.institutionalaccess.model.vo.ThTrainVO"> + SELECT + e.institution_id, + count(DISTINCT e.idcard) passCount + FROM + th_exam_record e + LEFT JOIN th_batch b ON e.batch_uuid = b.uuid + WHERE + e.del_flag = 0 + AND e.exam_is_pass = 1 + AND b.have_exam = 1 + <if test="query.subjectCode != null and query.subjectCode != ''"> + and b.subject_code like concat(#{query.subjectCode}, '%') + </if> + <if test="query.trainOrgName != null and query.trainOrgName != ''"> + and b.train_org_name = #{query.trainOrgName}, '%') + </if> + <if test="query.startTime != null"><!-- 开始时间检索 --> + and date_format(b.actual_start_time,'%y-%m-%d') >= date_format(#{query.startTime},'%y-%m-%d') + </if> + <if test="query.endTime != null"><!-- 结束时间检索 --> + and date_format(b.actual_start_time,'%y-%m-%d') <= date_format(#{query.endTime},'%y-%m-%d') + </if> + GROUP BY + e.institution_id + </select> </mapper> -- Gitblit v1.9.2