Переглянути джерело

枚举条件不能与字符空比较

mingfu 1 місяць тому
батько
коміт
177a4decfa

+ 11 - 7
ie-common/src/main/java/com/ruoyi/common/enums/ExamType.java

@@ -1,9 +1,16 @@
 package com.ruoyi.common.enums;
 
+import lombok.AllArgsConstructor;
+
+@AllArgsConstructor
 public enum ExamType {
-    OHS("单招(应届普高)", "Ordinary High School"),
-    SVS("单招(中职)", "Secondary Vocational School"),
-    VHS("职高对口升学", "Vocational High School");
+    OHS(1, "单招(应届普高)", "Ordinary High School"),
+    SVS(2, "单招(中职)", "Secondary Vocational School"),
+    VHS(3, "职高对口升学", "Vocational High School");
+
+    public Integer code() {
+        return code;
+    }
 
     public String title() {
         return title;
@@ -13,10 +20,7 @@ public enum ExamType {
         return nameEn;
     }
 
+    private final Integer code;
     private final String title;
     private final String nameEn;
-    ExamType(String title, String nameEn) {
-        this.title = title;
-        this.nameEn = nameEn;
-    }
 }

+ 6 - 6
ie-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -173,8 +173,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null and status != ''">status,</if>
  			<if test="pwdUpdateDate != null">pwd_update_date,</if>
 		    <if test="location != null and location != ''">location,</if>
-		    <if test="examType != null and examType != ''">exam_type,</if>
-		    <if test="regStatus != null and regStatus != ''">reg_status,</if>
+		    <if test="examType != null">exam_type,</if>
+		    <if test="regStatus != null">reg_status,</if>
 		    <if test="endYear != null">end_year,</if>
 		    <if test="inviteCode != null and inviteCode != ''">invite_code,</if>
 		    <if test="scores != null and scores != ''">scores,</if>
@@ -198,8 +198,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null and status != ''">#{status},</if>
  			<if test="pwdUpdateDate != null">#{pwdUpdateDate},</if>
  			<if test="location != null and location != ''">#{location},</if>
- 			<if test="examType != null and examType != ''">#{examType},</if>
- 			<if test="regStatus != null and regStatus != ''">#{regStatus},</if>
+ 			<if test="examType != null">#{examType},</if>
+ 			<if test="regStatus != null">#{regStatus},</if>
  			<if test="endYear != null and endYear != ''">#{endYear},</if>
  			<if test="inviteCode != null and inviteCode != ''">#{inviteCode},</if>
  			<if test="scores != null and scores != ''">#{scores, typeHandler=com.ruoyi.system.handlers.SubjectScoreTypeHandler},</if>
@@ -225,8 +225,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="password2 != null and password2 != ''">password2 = #{password2},</if>
  			<if test="status != null and status != ''">status = #{status},</if>
 			<if test="location != null and location != ''">location = #{location},</if>
-			<if test="examType != null and examType != ''">exam_type = #{examType},</if>
-			<if test="regStatus != null and regStatus != ''">reg_status = #{regStatus},</if>
+			<if test="examType != null">exam_type = #{examType},</if>
+			<if test="regStatus != null">reg_status = #{regStatus},</if>
 			<if test="endYear != null and endYear != ''">end_year = #{endYear},</if>
 			<if test="inviteCode != null and inviteCode != ''">invite_code = #{inviteCode},</if>
 			<if test="scores != null and scores != ''">scores = #{scores, typeHandler=com.ruoyi.system.handlers.SubjectScoreTypeHandler},</if>