zouxuan 5 年之前
父節點
當前提交
dde3adbfb7

+ 2 - 0
mec-web/src/main/java/com/ym/mec/web/dal/entity/MusicGroupStudentFee.java

@@ -14,9 +14,11 @@ public class MusicGroupStudentFee {
 	private Long id;
 	
 	/**  */
+	@ApiModelProperty(value = "乐团编号",required = false)
 	private Integer musicGroupId;
 	
 	/**  */
+	@ApiModelProperty(value = "用户编号",required = false)
 	private Integer userId;
 	
 	/** 课程费用 */

+ 15 - 8
mec-web/src/main/java/com/ym/mec/web/dal/entity/TeacherClassFee.java

@@ -1,5 +1,7 @@
 package com.ym.mec.web.dal.entity;
 
+import com.ym.mec.web.dal.enums.TeachTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 /**
@@ -11,18 +13,23 @@ public class TeacherClassFee {
 	private Long id;
 	
 	/**  */
+	@ApiModelProperty(value = "乐团编号",required = false)
 	private Integer musicGroupId;
 	
 	/**  */
+	@ApiModelProperty(value = "课程组编号",required = false)
 	private Integer classGroupId;
 	
 	/**  */
+	@ApiModelProperty(value = "教师编号",required = false)
 	private Integer teacherId;
 	
 	/** 职务类型(助教、主教) */
-	private String jobType;
+	@ApiModelProperty(value = "职务类型",required = false)
+	private TeachTypeEnum jobType;
 	
 	/**  */
+	@ApiModelProperty(value = "教师编号",required = false)
 	private long classFee;
 	
 	/**  */
@@ -62,15 +69,15 @@ public class TeacherClassFee {
 	public Integer getTeacherId(){
 		return this.teacherId;
 	}
-			
-	public void setJobType(String jobType){
-		this.jobType = jobType;
+
+	public TeachTypeEnum getJobType() {
+		return jobType;
 	}
-	
-	public String getJobType(){
-		return this.jobType;
+
+	public void setJobType(TeachTypeEnum jobType) {
+		this.jobType = jobType;
 	}
-			
+
 	public void setClassFee(long classFee){
 		this.classFee = classFee;
 	}

+ 35 - 0
mec-web/src/main/java/com/ym/mec/web/dal/enums/TeachTypeEnum.java

@@ -0,0 +1,35 @@
+package com.ym.mec.web.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+//职务类型(助教、主教)
+public enum TeachTypeEnum implements BaseEnum<String, TeachTypeEnum> {
+    TEACHING("TEACHING","助教"),
+    BISHOP("BISHOP","主教");
+
+    private String code;
+
+    private String msg;
+
+    TeachTypeEnum(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    @Override
+    public String getCode() {
+        return this.code;
+    }
+}

+ 3 - 9
mec-web/src/main/resources/config/mybatis/TeacherClassFeeMapper.xml

@@ -9,7 +9,7 @@
 		<result column="music_group_id_" property="musicGroupId" />
 		<result column="class_group_id_" property="classGroupId" />
 		<result column="teacher_id_" property="teacherId" />
-		<result column="job_type_" property="jobType" />
+		<result column="job_type_" property="jobType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
 		<result column="class_fee_" property="classFee" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
@@ -34,7 +34,7 @@
 			AS ID FROM DUAL </selectKey> -->
 		INSERT INTO teacher_class_fee
 		(id_,music_group_id_,class_group_id_,teacher_id_,job_type_,class_fee_,create_time_,update_time_)
-		VALUES(#{id},#{musicGroupId},#{classGroupId},#{teacherId},#{jobType},#{classFee},#{createTime},#{updateTime})
+		VALUES(#{id},#{musicGroupId},#{classGroupId},#{teacherId},#{jobType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{classFee},now(),now)
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -42,10 +42,7 @@
 		UPDATE teacher_class_fee
 		<set>
 			<if test="jobType != null">
-				job_type_ = #{jobType},
-			</if>
-			<if test="id != null">
-				id_ = #{id},
+				job_type_ = #{jobType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 			</if>
 			<if test="classGroupId != null">
 				class_group_id_ = #{classGroupId},
@@ -62,9 +59,6 @@
 			<if test="musicGroupId != null">
 				music_group_id_ = #{musicGroupId},
 			</if>
-			<if test="createTime != null">
-				create_time_ = #{createTime},
-			</if>
 		</set>
 		WHERE id_ = #{id}
 	</update>