Parcourir la source

分部增加学年制字段

周箭河 il y a 4 ans
Parent
commit
8e6a4ee5ec

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Organization.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.ym.mec.biz.dal.enums.GradeTypeEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 
 import io.swagger.annotations.ApiModelProperty;
@@ -51,6 +52,9 @@ public class Organization {
 	@ApiModelProperty(value = "地址",required = false)
 	private String address;
 
+	@ApiModelProperty(value = "学年制",required = false)
+	private GradeTypeEnum gradeType;
+
 	@ApiModelProperty(value = "子节点列表",required = false)
 	private List<Organization> organizations;
 
@@ -155,4 +159,11 @@ public class Organization {
 		return ToStringBuilder.reflectionToString(this);
 	}
 
+	public GradeTypeEnum getGradeType() {
+		return gradeType;
+	}
+
+	public void setGradeType(GradeTypeEnum gradeType) {
+		this.gradeType = gradeType;
+	}
 }

+ 27 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/GradeTypeEnum.java

@@ -0,0 +1,27 @@
+package com.ym.mec.biz.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+public enum GradeTypeEnum implements BaseEnum<Integer, GradeTypeEnum> {
+	SIX_PLUS(0, "6+3学制"),
+	FIVE_PLUS(1, "5+4学制");
+
+	private Integer code;
+
+	private String desc;
+
+	private GradeTypeEnum(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	@Override
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 6 - 2
mec-biz/src/main/resources/config/mybatis/OrganizationMapper.xml

@@ -18,6 +18,7 @@
         <result column="linkman_" property="linkman"/>
         <result column="mobile_" property="mobile"/>
         <result column="address_" property="address"/>
+        <result column="grade_type_" property="gradeType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -33,8 +34,8 @@
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Organization" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
-        INSERT INTO organization (id_,name_,area_id_,create_time_,update_time_,register_date_,linkman_,mobile_,address_)
-        VALUES(#{id},#{name},#{areaId},now(),now(),#{registerDate},#{linkman},#{mobile},#{address})
+        INSERT INTO organization (id_,name_,area_id_,create_time_,update_time_,register_date_,linkman_,mobile_,address_,grade_type_)
+        VALUES(#{id},#{name},#{areaId},now(),now(),#{registerDate},#{linkman},#{mobile},#{address},#{gradeType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -65,6 +66,9 @@
             <if test="address != null">
                 address_ = #{address},
             </if>
+            <if test="gradeType != null">
+                grade_type_ = #{gradeType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
         </set>
         WHERE id_ = #{id}
     </update>