123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760 |
- <?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="cn.com.qmth.scancentral.dao.StudentDao">
- <select id="absentInfo"
- resultType="cn.com.qmth.scancentral.vo.AbsentInfoVo">
- select
- count(1) totalCount,
- sum(case
- when t.status='SCANNED' then 1 else 0 end)
- scannedCount,
- sum(case when
- t.status='UNEXIST' then 1 else 0 end)
- unexistCount,
- sum(case when
- t.status='MANUAL_ABSENT' then 1 else 0 end)
- manualAbsentCount,
- sum(case
- when t.omr_absent=1 then 1 else 0 end)
- omrAbsentCount,
- sum(case when
- t.absent_suspect=1 then 1 else 0 end)
- absentSuspectCount
- from sc_student t
- where t.exam_id=#{examId}
- <if test="groupType != null and groupName != null">
- and t.${groupType}=#{groupName}
- </if>
- group by t.exam_id
- <if test="groupType != null and groupName != null">
- , t.${groupType}
- </if>
- </select>
- <select id="absentQuerySummary" resultType="string">
- select tem.groupName from (
- <include refid="absentInnerQuery"/>
- ) tem
- <include refid="absentWhereQuery"/>
- </select>
- <select id="absentExportList"
- resultType="cn.com.qmth.scancentral.vo.AbsentQueryVo">
- select tem.* from (
- <include refid="absentInnerQuery"/>
- ) tem
- <include refid="absentWhereQuery"/>
- </select>
- <select id="absentQueryPage"
- resultType="cn.com.qmth.scancentral.vo.AbsentQueryVo">
- select tem.* from (
- <include refid="absentInnerQuery"/>
- ) tem
- <include refid="absentWhereQuery"/>
- </select>
- <select id="queryPage"
- resultType="cn.com.qmth.scancentral.vo.answerquery.AnswerQueryVo">
- select
- t.*,
- c.paper_count cardPaperCount,
- s.name subjectName
- from sc_student t
- left join sc_answer_card c on t.exam_id=c.exam_id and
- t.card_number=c.number
- left join sc_subject s on s.code=t.subject_code and s.exam_id=t.exam_id
- <include refid="paramWhereAndOrder"/>
- order by t.id
- </select>
- <select id="querySummary" resultType="string">
- select
- t.exam_number
- from sc_student t
- left join sc_subject s on s.exam_id=t.exam_id and s.code=t.subject_code
- <include refid="paramWhereAndOrder"/>
- order by t.id
- </select>
- <select id="exportList"
- resultType="cn.com.qmth.scancentral.vo.AnswerExportVo">
- select
- t.*,
- s.name subjectName,
- (select count(sp.paper_id) from sc_student_paper sp where sp.student_id=t.id)
- as paperCount
- from sc_student t
- left join sc_subject s on s.code = t.subject_code and s.exam_id =
- t.exam_id
- <include refid="paramWhereAndOrder"/>
- order by t.id
- </select>
- <select id="findToUpload"
- resultType="cn.com.qmth.scancentral.vo.StudentUploadVo">
- select t.*
- from sc_student t
- inner join sc_exam e on t.exam_id = e.id
- where e.enable_upload = 1
- and e.enable = 1
- and (t.file_upload_status = 'WAITING_UPLOAD' or t.data_upload_status =
- 'WAITING_UPLOAD')
- limit #{pageSize}
- </select>
- <select id="findUploadError"
- resultType="cn.com.qmth.scancentral.vo.StudentUploadVo">
- select t.*
- from sc_student t
- inner join sc_exam e on t.exam_id = e.id
- where e.enable_upload = 1
- and e.enable = 1
- and (t.file_upload_status = 'ERROR' or t.data_upload_status = 'ERROR')
- limit #{pageSize}
- </select>
- <select id="getPackageCountByExam" resultType="int">
- select count(distinct t.package_code)
- from sc_student t
- where t.exam_id = #{examId}
- </select>
- <select id="countByQuery" resultType="int">
- select count(*) from sc_student t
- where t.exam_id=#{query.examId}
- <if test="query.examNumber != null and query.examNumber !=''">
- and t.exam_number=#{query.examNumber}
- </if>
- <if test="query.name != null and query.name !=''">
- and t.name=#{query.name}
- </if>
- <if test="query.packageCode != null and query.packageCode !=''">
- and t.package_code=#{query.packageCode}
- </if>
- <if test="query.campusName != null and query.campusName !=''">
- and t.campus_name=#{query.campusName}
- </if>
- <if test="query.subjectCode != null and query.subjectCode !=''">
- and t.subject_code=#{query.subjectCode}
- </if>
- <if test="query.examSite != null and query.examSite!=''">
- and t.exam_site=#{query.examSite}
- </if>
- <if test="query.examRoom != null and query.examRoom !=''">
- and t.exam_room=#{query.examRoom}
- </if>
- <if test="query.seatNumber != null and query.seatNumber !=''">
- and t.seat_number=#{query.seatNumber}
- </if>
- <if test="query.scanStatus != null">
- and t.status=#{query.scanStatus}
- </if>
- </select>
- <select id="countStudent" resultType="cn.com.qmth.scancentral.vo.studentimport.StudentCountVo">
- select sb.code as subject_code, sb.name as subjectName
- ,(select count(1) from sc_student stu where stu.exam_id=sb.exam_id and stu.subject_code = sb.code) studentCount
- from sc_subject sb
- where sb.exam_id = #{examId}
- </select>
- <select id="listPageQuery"
- resultType="cn.com.qmth.scancentral.vo.ImportStudentVo">
- select
- t.id,
- t.exam_number,
- t.student_code,
- t.name,
- t.subject_code,
- s.name subjectName,
- t.package_code,
- t.campus_name,
- t.campus_code,
- t.exam_site,
- t.exam_site_name,
- t.exam_room,
- t.seat_number
- from sc_student t
- left join sc_subject s on s.code=t.subject_code and s.exam_id=t.exam_id
- where t.exam_id=#{query.examId}
- <if test="query.examNumber != null and query.examNumber !=''">
- and t.exam_number=#{query.examNumber}
- </if>
- <if test="query.name != null and query.name !=''">
- and t.name=#{query.name}
- </if>
- <if test="query.packageCode != null and query.packageCode !=''">
- and t.package_code=#{query.packageCode}
- </if>
- <if test="query.campusName != null and query.campusName !=''">
- and t.campus_name=#{query.campusName}
- </if>
- <if test="query.subjectCode != null and query.subjectCode !=''">
- and t.subject_code=#{query.subjectCode}
- </if>
- <if test="query.examSite != null and query.examSite!=''">
- and t.exam_site=#{query.examSite}
- </if>
- <if test="query.examRoom != null and query.examRoom !=''">
- and t.exam_room=#{query.examRoom}
- </if>
- <if test="query.seatNumber != null and query.seatNumber !=''">
- and t.seat_number=#{query.seatNumber}
- </if>
- <if test="query.scanStatus != null">
- and t.status=#{query.scanStatus}
- </if>
- order by t.id
- </select>
- <select id="findToPictureCopy"
- resultType="cn.com.qmth.scancentral.vo.StudentUploadVo">
- select t.*,
- e.mode
- from sc_student t
- inner join sc_exam e on t.exam_id = e.id
- where e.enable = 1
- and e.mode = 'CET'
- and t.file_upload_status = 'WAITING_UPLOAD'
- limit #{pageSize}
- </select>
- <select id="getUploadedCount" resultType="int">
- select count(1)
- from sc_student t
- where t.exam_id = #{examId}
- and t.file_upload_status = 'UPLOADED'
- and t.data_upload_status = 'UPLOADED'
- </select>
- <select id="getNeedUploadCount" resultType="int">
- select count(1)
- from sc_student t
- where t.exam_id = #{examId}
- and (
- t.file_upload_status in ('WAITING_UPLOAD', 'ERROR') or
- t.data_upload_status in ('WAITING_UPLOAD', 'ERROR')
- )
- </select>
- <select id="listCetMarkingPage"
- resultType="cn.com.qmth.scancentral.vo.ExportCetVo">
- select t.*
- from sc_student t
- where t.exam_id = #{query.examId}
- <if test="query.subjectCode != null and query.subjectCode !=''">
- and t.subject_code=#{query.subjectCode}
- </if>
- and t.status = 'SCANNED'
- and t.file_upload_status = 'UPLOADED'
- order by t.id
- </select>
- <select id="countCetMarking" resultType="int">
- select count(1)
- from sc_student t
- where t.exam_id = #{query.examId}
- <if test="query.subjectCode != null and query.subjectCode !=''">
- and t.subject_code=#{query.subjectCode}
- </if>
- and t.status = 'SCANNED'
- and t.file_upload_status = 'UPLOADED'
- </select>
- <select id="getInfoCountByExam" resultType="cn.com.qmth.scancentral.vo.ScanAnswerInfoVo">
- select count(1) as totalCount,
- count(case when t.absent_suspect = 1 then 1 end) as absentSuspectCount,
- count(case when t.assigned = 1 then 1 end) as assignedCount,
- count(case when t.omr_absent = 1 then 1 end) as omrAbsentCount,
- count(case when t.incomplete = 1 then 1 end) as incompleteCount,
- count(case when t.status = 'MANUAL_ABSENT' then 1 end) as manualAbsentCount,
- count(case when t.status = 'SCANNED' then 1 end) as scannedCount,
- count(case when t.status = 'UNEXIST' then 1 end) as unexistCount
- from sc_student t
- where t.exam_id = #{examId}
- </select>
- <sql id="queryWhereAndOrder">
- where t.exam_id=#{query.examId}
- <if test="query.status != null and query.status.size>0">
- AND t.status in
- <foreach collection="query.status" index="index" item="st"
- open="(" separator="," close=")">
- #{st}
- </foreach>
- </if>
- <if test="query.examStatus != null">
- and t.exam_status=#{query.examStatus}
- </if>
- <if test="query.examNumber != null and query.examNumber !=''">
- and t.exam_number =#{query.examNumber}
- </if>
- <if test="query.name != null and query.name !=''">
- and t.name=#{query.name}
- </if>
- <if test="query.packageCode != null and query.packageCode !=''">
- and t.package_code=#{query.packageCode}
- </if>
- <if test="query.campusName != null and query.campusName !=''">
- and t.campus_name=#{query.campusName}
- </if>
- <if test="query.campusCode != null and query.campusCode !=''">
- and t.campus_code=#{query.campusCode}
- </if>
- <if test="query.subjectCode != null and query.subjectCode !=''">
- and t.subject_code=#{query.subjectCode}
- </if>
- <if test="query.examSite != null and query.examSite!=''">
- and t.exam_site=#{query.examSite}
- </if>
- <if test="query.examRoom != null and query.examRoom !=''">
- and t.exam_room=#{query.examRoom}
- </if>
- <if test="query.province != null and query.province !=''">
- and t.province=#{query.province}
- </if>
- <if test="query.absentSuspect != null">
- and t.absent_suspect=#{query.absentSuspect}
- </if>
- <if test="query.omrAbsent != null">
- and t.omr_absent=#{query.omrAbsent}
- </if>
- <if test="query.assigned != null">
- and t.assigned=#{query.assigned}
- </if>
- <if test="query.incomplete != null">
- and t.incomplete=#{query.incomplete}
- </if>
- <if test="query.questionFilled != null">
- and t.question_filled=#{query.questionFilled}
- </if>
- <if test="query.subjectiveFilled != null">
- and t.subjective_filled=#{query.subjectiveFilled}
- </if>
- <if test="query.device != null and query.device !=''">
- and t.device=#{query.device}
- </if>
- <if test="query.assignedCheckCount != null and query.assignedCheckCount !=''">
- and t.assigned_check_count=#{query.assignedCheckCount}
- </if>
- <if test="query.assignedSuspect != null">
- and t.assigned_suspect=#{query.assignedSuspect}
- </if>
- <if test="query.paperTypeStatus != null">
- <if test="query.paperTypeStatus ==@cn.com.qmth.scancentral.enums.PaperTypeStatus@OK">
- and t.paper_type!='#' and t.paper_type!='?'
- </if>
- <if test="query.paperTypeStatus ==@cn.com.qmth.scancentral.enums.PaperTypeStatus@BLANK">
- and t.paper_type='#'
- </if>
- <if test="query.paperTypeStatus ==@cn.com.qmth.scancentral.enums.PaperTypeStatus@ERROR">
- and t.paper_type='?'
- </if>
- </if>
- </sql>
- <sql id="absentInnerQuery">
- select
- #{query.groupType} groupType,
- t.${groupNameCol} groupName,
- count(1) totalCount,
- sum(case
- when t.status='SCANNED' then 1 else 0 end)
- scannedCount,
- sum(case when
- t.status='UNEXIST' then 1 else 0 end)
- unexistCount,
- sum(case when
- t.status='MANUAL_ABSENT' then 1 else 0 end)
- manualAbsentCount,
- sum(case
- when t.omr_absent=1 then 1 else 0 end)
- omrAbsentCount,
- sum(case when
- t.absent_suspect=1 then 1 else 0 end)
- absentSuspectCount
- from sc_student t
- where
- t.exam_id=#{query.examId}
- and t.${groupNameCol} is not null
- <if test="query.campusCode != null and query.campusCode!=''">
- and t.campus_code=#{query.campusCode}
- </if>
- <if test="query.subjectCode != null and query.subjectCode !=''">
- and t.subject_code=#{query.subjectCode}
- </if>
- <if test="query.examSite != null and query.examSite !=''">
- and t.exam_site=#{query.examSite}
- </if>
- <if test="query.examRoom != null and query.examRoom !=''">
- and t.exam_room=#{query.examRoom}
- </if>
- group by t.${groupNameCol}
- </sql>
- <sql id="absentWhereQuery">
- where 1=1
- <if test="!query.status.isEmpty()">
- and (1=2
- <if test="query.status.contains('UNEXIST')">
- or tem.unexistCount>0
- </if>
- <if test="query.status.contains('MANUAL_ABSENT')">
- or tem.manualAbsentCount>0
- </if>
- <if test="query.status.contains('OMR_ABSENT')">
- or tem.omrAbsentCount>0
- </if>
- <if test="query.status.contains('ABSENT_SUSPECT')">
- or tem.absentSuspectCount>0
- </if>
- )
- </if>
- <if test="query.scanned != null">
- <if test="query.scanned">
- and tem.scannedCount>0
- </if>
- <if test="!query.scanned">
- and tem.scannedCount=0
- </if>
- </if>
- order by tem.groupName
- </sql>
- <select id="exportAssignedCheckPage"
- resultType="cn.com.qmth.scancentral.vo.assginedcheck.AssignedCheckExport">
- select t.*
- from sc_student t
- <include refid="queryWhereAndOrder"/>
- order by t.id
- </select>
- <select id="queryAssignedCheckPage"
- resultType="cn.com.qmth.scancentral.vo.answerquery.AnswerQueryVo">
- select
- t.*,
- s.name subjectName,
- h.user_id auditorId
- from sc_student t
- left join sc_subject s on s.code=t.subject_code and s.exam_id=t.exam_id
- left join (
- SELECT MAX(id) id,student_id FROM sc_assigned_check_history h GROUP BY student_id
- ) m on t.id=m.student_id
- left join sc_assigned_check_history h on h.id=m.id and h.student_id=t.id
- <!-- <if test="query.startTime != null || query.endTime != null">-->
- <!-- left join sc_student_paper sp on sp.student_id=t.id-->
- <!-- </if>-->
- <include refid="queryWhereAndOrder"/>
- <if test="query.auditorId != null">
- and h.user_id = #{query.auditorId}
- </if>
- <if test="query.startTime != null">
- and t.update_time >= #{query.startTime}
- </if>
- <if test="query.endTime != null">
- and t.update_time <= #{query.endTime}
- </if>
- order by t.id
- </select>
- <select id="findUnCheck" resultType="cn.com.qmth.scancentral.vo.answerquery.AnswerQueryVo">
- select t.*,
- c.paper_count cardPaperCount,
- s.name subjectName
- from sc_student t
- left join sc_answer_card c on t.exam_id = c.exam_id and
- t.card_number = c.number
- left join sc_subject s on s.code = t.subject_code and s.exam_id = t.exam_id
- where t.exam_id = #{examId}
- and t.subject_code = #{subjectCode}
- and t.assigned_check_count = #{checkCount}
- and t.assigned = 1
- order by t.id
- </select>
- <select id="getAssignedCheckTaskHistory" resultType="cn.com.qmth.scancentral.vo.answerquery.AnswerQueryVo">
- select t.*,
- c.paper_count cardPaperCount,
- s.name subjectName
- from sc_assigned_check_history h
- left join sc_student t on t.id = h.student_id
- left join sc_answer_card c on t.exam_id = c.exam_id and
- t.card_number = c.number
- left join sc_subject s on s.code = t.subject_code and s.exam_id = t.exam_id
- where h.user_id = #{userId}
- and h.exam_id = #{examId}
- and h.subject_code = #{subjectCode}
- order by h.id desc
- </select>
- <update id="updateAssignedCheckCount">
- UPDATE sc_student
- SET assigned_check_count = (SELECT count(1)
- FROM sc_assigned_check_history h
- WHERE h.student_id = #{id})
- WHERE id = #{id}
- </update>
- <select id="scanProgress" resultType="cn.com.qmth.scancentral.vo.subject.SubjectScanProgressVo">
- select t.subject_code,s.name subject_name,
- sum(case when t.status='UNEXIST' then 1 else 0 end) unexistCount,
- count(1) studentCount
- from sc_student t
- inner join sc_subject s on t.exam_id=s.exam_id and t.subject_code=s.code
- where t.exam_id=#{examId}
- <if test="subjectCode != null and subjectCode !=''">
- and t.subject_code=#{subjectCode}
- </if>
- group by t.subject_code
- </select>
- <select id="studentPage" resultType="cn.com.qmth.scancentral.vo.student.StudentPageVo">
- select t.*,ss.device_name,su.name subjectName
- from sc_student t
- left join sc_scanner ss on t.device=ss.device
- left join sc_subject su on t.exam_id=su.exam_id and t.subject_code=su.code
- where t.exam_id=#{req.examId}
- <if test="req.campusCode != null and req.campusCode !=''">
- and t.campus_code=#{req.campusCode}
- </if>
- <if test="req.examNumber != null and req.examNumber !=''">
- and t.exam_number=#{req.examNumber}
- </if>
- <if test="req.subjectCode != null and req.subjectCode !=''">
- and t.subject_code=#{req.subjectCode}
- </if>
- <if test="req.examSite != null and req.examSite !=''">
- and t.exam_site=#{req.examSite}
- </if>
- <if test="req.name != null and req.name !=''">
- and t.name like concat('%',#{req.name}, '%')
- </if>
- <if test="req.packageCode != null and req.packageCode !=''">
- and t.package_code=#{req.packageCode}
- </if>
- </select>
- <select id="studentExport"
- resultType="cn.com.qmth.scancentral.vo.student.StudentVo">
- select
- t.*,
- s.name subjectName
- from sc_student t
- left join sc_subject s on s.code=t.subject_code and s.exam_id=t.exam_id
- <include refid="paramWhereAndOrder"/>
- order by t.exam_number
- </select>
- <select id="studentExamRoomExport"
- resultType="cn.com.qmth.scancentral.vo.student.StudentExamRoomVo">
- select tm.* from (select t.campus_code,t.exam_site,t.exam_site_name,t.exam_room,
- s.code subject_code,
- s.name subject_name
- from sc_student t
- left join sc_subject s on s.code=t.subject_code and s.exam_id=t.exam_id
- <include refid="paramWhereAndOrder"/>
- group by t.campus_code,t.exam_site,t.exam_room,s.code
- ) tm
- order by tm.exam_site,tm.exam_room
- </select>
- <select id="queryImageCheckWaitingList" resultType="java.lang.Long">
- select id
- from sc_student
- where exam_id = #{examId}
- and file_upload_status = 'UPLOADED'
- and image_check_status in ('WAITING', 'FAILED')
- and id > #{startId}
- order by id
- limit #{batchSize}
- </select>
- <select id="countImageCheck" resultType="cn.com.qmth.scancentral.vo.imagecheck.ImageCheckVo">
- select stu.subject_code,
- sb.name as subjectName,
- count(1) as totalCount,
- sum(case
- when
- (stu.file_upload_status = 'ERROR')
- or (stu.file_upload_status = 'UPLOADED' and stu.image_check_status in('SUCCESS','FAILED') )
- then 1
- else 0 end) disposedCount,
- sum(case
- when stu.file_upload_status = 'ERROR' or stu.image_check_status = 'FAILED' then 1
- else 0 end) failedCount
- from sc_student stu
- inner join sc_subject sb on sb.exam_id = stu.exam_id and sb.code = stu.subject_code
- where stu.exam_id = #{examId}
- group by stu.subject_code
- </select>
- <select id="failedPage" resultType="cn.com.qmth.scancentral.vo.imagecheck.ImageCheckDetailVo">
- select stu.subject_code,
- sb.name as subject_name,
- stu.campus_code,
- stu.campus_name,
- stu.exam_site,
- stu.exam_site_name,
- stu.exam_room,
- stu.image_check_status,
- sum(case when stu.file_upload_status='ERROR' or stu.image_check_status = 'FAILED' then 1 else 0 end)
- failedCount
- from sc_student stu
- inner join sc_subject sb on sb.exam_id = stu.exam_id and sb.code = stu.subject_code
- where stu.exam_id = #{query.examId}
- and stu.subject_code = #{query.subjectCode}
- and (stu.file_upload_status = 'ERROR' or stu.image_check_status = 'FAILED')
- group by stu.exam_room
- </select>
- <select id="exportAssignedCheck" resultType="cn.com.qmth.scancentral.vo.assginedcheck.AssignedCheckExamRoomExport">
- select stu.subject_code,
- sb.name as subject_name,
- stu.campus_code,
- stu.campus_name,
- stu.exam_site,
- stu.exam_site_name,
- stu.exam_room
- from sc_student stu
- left join sc_subject sb on sb.exam_id = stu.exam_id and sb.code = stu.subject_code
- where stu.exam_id = #{examId}
- and stu.subject_code = #{subjectCode}
- and stu.assigned = 1
- and stu.assigned_suspect = 1
- group by stu.exam_room
- </select>
- <select id="getStudentVo"
- resultType="cn.com.qmth.scancentral.vo.student.StudentAnswerVo">
- select t.*,
- c.paper_count cardPaperCount,
- s.name subjectName
- from sc_student t
- left join sc_answer_card c on t.exam_id = c.exam_id and
- t.card_number = c.number
- left join sc_subject s on s.code = t.subject_code and s.exam_id = t.exam_id
- where t.id = #{studentId}
- </select>
- <select id="getImageCheckFailedCount" resultType="int">
- select count(*)
- from sc_student stu
- where stu.exam_id = #{examId}
- and stu.subject_code = #{subjectCode}
- and (stu.file_upload_status = 'ERROR' or stu.image_check_status = 'FAILED')
- </select>
- <select id="getImageCheckDisposedCount" resultType="int">
- select count(*)
- from sc_student stu
- where stu.exam_id = #{examId}
- and stu.subject_code = #{subjectCode}
- and ((stu.file_upload_status = 'ERROR')
- or (stu.file_upload_status = 'UPLOADED' and stu.image_check_status in('SUCCESS','FAILED')) )
- </select>
- <select id="getImageCheckUnFinish" resultType="long">
- select stu.id
- from sc_student stu
- where stu.exam_id = #{examId}
- and stu.subject_code = #{subjectCode}
- and (
- stu.file_upload_status in('WAITING_UPLOAD','ERROR')
- or
- (stu.file_upload_status='UPLOADED' and stu.image_check_status in('WAITING','FAILED') )
- )
- limit 1
- </select>
- <sql id="paramWhereAndOrder">
- where t.exam_id=#{query.examId}
- <if test="query.status != null and query.status.size>0">
- AND t.status in
- <foreach collection="query.status" index="index" item="st"
- open="(" separator="," close=")">
- #{st}
- </foreach>
- </if>
- <if test="query.examStatus != null and query.examStatus.size>0">
- AND t.exam_status in
- <foreach collection="query.examStatus" index="index" item="st"
- open="(" separator="," close=")">
- #{st}
- </foreach>
- </if>
- <if test="query.examNumber != null and query.examNumber.size>0">
- and t.exam_number in
- <foreach collection="query.examNumber" index="index" item="en"
- open="(" separator="," close=")">
- #{en}
- </foreach>
- </if>
- <if test="query.name != null and query.name !=''">
- and t.name=#{query.name}
- </if>
- <if test="query.packageCode != null and query.packageCode !=''">
- and t.package_code=#{query.packageCode}
- </if>
- <if test="query.campusName != null and query.campusName !=''">
- and t.campus_name=#{query.campusName}
- </if>
- <if test="query.campusCode != null and query.campusCode !=''">
- and t.campus_code=#{query.campusCode}
- </if>
- <if test="query.subjectCode != null and query.subjectCode !=''">
- and t.subject_code=#{query.subjectCode}
- </if>
- <if test="query.examSite != null and query.examSite!=''">
- and t.exam_site=#{query.examSite}
- </if>
- <if test="query.examRoom != null and query.examRoom !=''">
- and t.exam_room=#{query.examRoom}
- </if>
- <if test="query.province != null and query.province !=''">
- and t.province=#{query.province}
- </if>
- <if test="query.absentSuspect != null">
- and t.absent_suspect=#{query.absentSuspect}
- </if>
- <if test="query.omrAbsent != null">
- and t.omr_absent=#{query.omrAbsent}
- </if>
- <if test="query.assigned != null">
- and t.assigned=#{query.assigned}
- </if>
- <if test="query.incomplete != null">
- and t.incomplete=#{query.incomplete}
- </if>
- <if test="query.questionFilled != null">
- and t.question_filled=#{query.questionFilled}
- </if>
- <if test="query.subjectiveFilled != null">
- and t.subjective_filled=#{query.subjectiveFilled}
- </if>
- <if test="query.device != null and query.device !=''">
- and t.device=#{query.device}
- </if>
- <if test="query.assignedCheckCount != null and query.assignedCheckCount !=''">
- and t.assigned_check_count=#{query.assignedCheckCount}
- </if>
- <if test="query.assignedSuspect != null">
- and t.assigned_suspect=#{query.assignedSuspect}
- </if>
- <if test="query.paperTypeStatus != null">
- <if test="query.paperTypeStatus ==@cn.com.qmth.scancentral.enums.PaperTypeStatus@OK">
- and t.paper_type!='#' and t.paper_type!='?'
- </if>
- <if test="query.paperTypeStatus ==@cn.com.qmth.scancentral.enums.PaperTypeStatus@BLANK">
- and t.paper_type='#'
- </if>
- <if test="query.paperTypeStatus ==@cn.com.qmth.scancentral.enums.PaperTypeStatus@ERROR">
- and t.paper_type='?'
- </if>
- </if>
- <if test="query.hasFilled != null">
- <if test="query.hasFilled">
- and (t.question_filled=1 or t.subjective_filled=1)
- </if>
- <if test="!query.hasFilled">
- and t.question_filled=0 and t.subjective_filled=0
- </if>
- </if>
- </sql>
- </mapper>
|