Joburgess 5 سال پیش
والد
کامیت
a2e70851a4

+ 67 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamRegistrationQueryInfo.java

@@ -0,0 +1,67 @@
+package com.keao.edu.user.page;
+
+import com.keao.edu.common.page.QueryInfo;
+import com.keao.edu.user.enums.StudentRegistrationStatusEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.06.23
+ */
+public class ExamRegistrationQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "考试项目编号")
+    private Integer examId;
+
+    @ApiModelProperty(value = "机构编号")
+    private Integer agencyId;
+
+    @ApiModelProperty(value = "专业编号")
+    private Integer subjectId;
+
+    @ApiModelProperty(value = "报考级别")
+    private Integer level;
+
+    @ApiModelProperty(value = "学员状态")
+    private StudentRegistrationStatusEnum status;
+
+    public Integer getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Integer examId) {
+        this.examId = examId;
+    }
+
+    public Integer getAgencyId() {
+        return agencyId;
+    }
+
+    public void setAgencyId(Integer agencyId) {
+        this.agencyId = agencyId;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public Integer getLevel() {
+        return level;
+    }
+
+    public void setLevel(Integer level) {
+        this.level = level;
+    }
+
+    public StudentRegistrationStatusEnum getStatus() {
+        return status;
+    }
+
+    public void setStatus(StudentRegistrationStatusEnum status) {
+        this.status = status;
+    }
+}

+ 33 - 3
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml

@@ -100,18 +100,48 @@
 
 	<sql id="queryCondition">
 		<where>
-
+			<if test="examId!=null">
+				AND er.examination_basic_id_ = #{examId}
+			</if>
+			<if test="agencyId!=null">
+				AND er.agency_id_ = #{agencyId}
+			</if>
+			<if test="subjectId!=null">
+				AND er.subject_id_ = #{subjectId}
+			</if>
+			<if test="level!=null">
+				AND er.level_ = #{level}
+			</if>
+			<if test="status!=null">
+				AND er.status_ = #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
+			</if>
 		</where>
 	</sql>
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="ExamRegistration" parameterType="map">
-		SELECT * FROM exam_registration
-		ORDER BY id_ <include refid="global.limit"/>
+		SELECT
+			er.id_,
+			er.card_no_,
+			er.student_id_,
+			su.real_name_,
+			er.agency_id_,
+			er.subject_id_,
+			er.level_,
+			erp.trans_amount_,
+			er.status_
+		FROM
+			exam_registration er
+			LEFT JOIN sys_user su ON er.student_id_ = su.id_
+			LEFT JOIN exam_registration_payment erp ON er.id_ = erp.exam_registration_id_
+		<include refid="queryCondition"/>
+		ORDER BY er.id_
+		<include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM exam_registration
+		<include refid="queryCondition"/>
 	</select>
 </mapper>