Browse Source

Merge branch 'dev_1.0.0' of http://git.qmth.com.cn/scan-central/server.git into dev_1.0.0

xiatian 7 months ago
parent
commit
a9d9b1860e

+ 22 - 11
src/main/java/cn/com/qmth/scancentral/bean/AnswerQueryDomain.java

@@ -15,9 +15,9 @@ public class AnswerQueryDomain extends PagerQuery {
 
     private List<ScanStatus> status;
 
-    private ExamStatus examStatus;
+    private List<ExamStatus> examStatus;
 
-    private String examNumber;
+    private List<String> examNumber;
 
     private String name;
 
@@ -57,6 +57,8 @@ public class AnswerQueryDomain extends PagerQuery {
 
     private Integer assignedCheckCount;
 
+    private Boolean hasFilled;
+
     public Long getExamId() {
         return examId;
     }
@@ -73,13 +75,6 @@ public class AnswerQueryDomain extends PagerQuery {
         this.status = status;
     }
 
-    public String getExamNumber() {
-        return examNumber;
-    }
-
-    public void setExamNumber(String examNumber) {
-        this.examNumber = examNumber;
-    }
 
     public String getName() {
         return name;
@@ -169,14 +164,22 @@ public class AnswerQueryDomain extends PagerQuery {
         this.withOmrDetail = withOmrDetail;
     }
 
-    public ExamStatus getExamStatus() {
+    public List<ExamStatus> getExamStatus() {
         return examStatus;
     }
 
-    public void setExamStatus(ExamStatus examStatus) {
+    public void setExamStatus(List<ExamStatus> examStatus) {
         this.examStatus = examStatus;
     }
 
+    public List<String> getExamNumber() {
+        return examNumber;
+    }
+
+    public void setExamNumber(List<String> examNumber) {
+        this.examNumber = examNumber;
+    }
+
     public String getCampusCode() {
         return campusCode;
     }
@@ -233,6 +236,14 @@ public class AnswerQueryDomain extends PagerQuery {
         this.assignedSuspect = assignedSuspect;
     }
 
+    public Boolean getHasFilled() {
+        return hasFilled;
+    }
+
+    public void setHasFilled(Boolean hasFilled) {
+        this.hasFilled = hasFilled;
+    }
+
     public Integer getAssignedCheckCount() {
         return assignedCheckCount;
     }

+ 101 - 99
src/main/resources/mapper/StudentMapper.xml

@@ -65,100 +65,7 @@
         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=#{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>
+        <include refid="paramWhereAndOrder"/>
         order by t.id
     </select>
     <select id="querySummary" resultType="string">
@@ -166,7 +73,7 @@
         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="queryWhereAndOrder"/>
+        <include refid="paramWhereAndOrder"/>
         order by t.id
     </select>
     <select id="exportList"
@@ -179,7 +86,7 @@
         from sc_student t
         left join sc_subject s on s.code = t.subject_code and s.exam_id =
         t.exam_id
-        <include refid="queryWhereAndOrder"/>
+        <include refid="paramWhereAndOrder"/>
         order by t.id
     </select>
 
@@ -633,7 +540,7 @@
         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="queryWhereAndOrder"/>
+        <include refid="paramWhereAndOrder"/>
         order by t.exam_number
     </select>
     <select id="studentExamRoomExport"
@@ -643,7 +550,7 @@
         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="queryWhereAndOrder"/>
+        <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
@@ -754,5 +661,100 @@
           )
          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>