Browse Source

add:school_name_

yonge 3 years ago
parent
commit
a9eac6c985

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Student.java

@@ -21,6 +21,8 @@ public class Student extends SysUser {
 	/**  */
 	private Integer userId;
 	
+	private String schoolName;
+	
 	/**  */
 	private String subjectIdList;
 
@@ -154,6 +156,14 @@ public class Student extends SysUser {
 		return this.userId;
 	}
 			
+	public String getSchoolName() {
+		return schoolName;
+	}
+
+	public void setSchoolName(String schoolName) {
+		this.schoolName = schoolName;
+	}
+
 	public void setSubjectIdList(String subjectIdList){
 		this.subjectIdList = subjectIdList;
 	}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPreRegistration.java

@@ -14,6 +14,8 @@ public class StudentPreRegistration {
 	
 	private String musicGroupId;
 	
+	private String school;
+	
 	/** 用户编号 */
 	private Integer userId;
 	
@@ -83,6 +85,14 @@ public class StudentPreRegistration {
 		this.musicGroupId = musicGroupId;
 	}
 
+	public String getSchool() {
+		return school;
+	}
+
+	public void setSchool(String school) {
+		this.school = school;
+	}
+
 	public void setUserId(Integer userId){
 		this.userId = userId;
 	}

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java

@@ -175,6 +175,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         student.setCreateTime(date);
         student.setUpdateTime(date);
         student.setIsNewUser(true);
+        student.setSchoolName(studentPreRegistration.getSchool());
         student.setCurrentGradeNum(studentPreRegistration.getCurrentGradeNum());
         student.setCurrentClass(studentPreRegistration.getCurrentClass());
         studentDao.insert(student);

+ 9 - 2
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -8,6 +8,7 @@
 
     <resultMap type="com.ym.mec.biz.dal.entity.Student" id="Student">
         <result column="user_id_" property="userId"/>
+        <result column="school_name_" property="schoolName"/>
         <result column="subject_id_list_" property="subjectIdList"/>
         <result column="subject_name_" property="subjectNames"/>
         <result column="service_tag_" property="serviceTag"/>
@@ -77,7 +78,7 @@
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Student" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
-        INSERT INTO student (user_id_,subject_id_list_,
+        INSERT INTO student (user_id_,school_name_,subject_id_list_,
         <if test="serviceTag != null">
             service_tag_,
         </if>
@@ -87,7 +88,7 @@
         teacher_id_,create_time_,update_time_,service_tag_update_time_,cooperation_organ_id_,
         care_package_,come_on_package_,member_rank_setting_id_,membership_start_time_,membership_end_time_)
         VALUES
-        (#{userId},#{subjectIdList},
+        (#{userId},#{schoolName},#{subjectIdList},
         <if test="serviceTag != null">
             #{serviceTag},
         </if>
@@ -101,6 +102,9 @@
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.Student">
         UPDATE student
         <set>
+            <if test="schoolName != null">
+                school_name_ = #{schoolName},
+            </if>
             <if test="subjectIdList != null">
                 subject_id_list_ = #{subjectIdList},
             </if>
@@ -232,6 +236,9 @@
         <foreach collection="studentList" item="item" index="index" open="" close="" separator=";">
             UPDATE student
             <set>
+	            <if test="item.schoolName != null">
+	                school_name_ = #{item.schoolName},
+	            </if>
                 <if test="item.subjectIdList != null">
                     subject_id_list_ = #{item.subjectIdList},
                 </if>