zhangf
2024-07-24 790c2ba4a0b46edf191e3bac84931f796bd42b8f
exam-system/src/main/resources/mapper/institutionaccess/ThExamRecordMapper.xml
@@ -5,14 +5,13 @@
    SELECT
        e.*,
        s.`name`,
        c.course_name,
        b.batch_name
    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
        WHERE
        e.del_flag = 0
    <if test="query.idcard != null and query.idcard != ''">
        and e.idcard = #{query.idcard}
    </if>
@@ -28,5 +27,24 @@
    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>
</mapper>