|
@@ -19,6 +19,7 @@
|
|
|
<result column="create_time_" property="createTime"/>
|
|
|
<result column="update_time_" property="updateTime"/>
|
|
|
<result column="parents_name_" property="parentsName"/>
|
|
|
+ <result column="parents_phone_" property="parentsPhone"/>
|
|
|
<result column="parents_company_" property="parentsCompany"/>
|
|
|
<result column="payment_status_" property="paymentStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="last_payment_date_" property="lastPaymentDate"/>
|
|
@@ -44,14 +45,17 @@
|
|
|
</selectKey>
|
|
|
-->
|
|
|
INSERT INTO student_registration
|
|
|
- (id_,user_id_,music_group_id_,current_grade_,current_class_,subject_id_,is_allow_adjust_,kit_purchase_method_,remark_,create_time_,update_time_,parents_name_,parents_company_,payment_status_,last_payment_date_,next_payment_date_)
|
|
|
- VALUES(#{id},#{userId},#{musicGroupId},#{currentGrade},#{currentClass},#{subjectId},#{isAllowAdjust,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{kitPurchaseMethod},#{remark},#{createTime},#{updateTime},#{parentsName},#{parentsCompany},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{lastPaymentDate},#{nextPaymentDate})
|
|
|
+ (parents_phone_,id_,user_id_,music_group_id_,current_grade_,current_class_,subject_id_,is_allow_adjust_,kit_purchase_method_,remark_,create_time_,update_time_,parents_name_,parents_company_,payment_status_,last_payment_date_,next_payment_date_)
|
|
|
+ VALUES(#{parentsPhone},#{id},#{userId},#{musicGroupId},#{currentGrade},#{currentClass},#{subjectId},#{isAllowAdjust,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{kitPurchaseMethod},#{remark},#{createTime},#{updateTime},#{parentsName},#{parentsCompany},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{lastPaymentDate},#{nextPaymentDate})
|
|
|
</insert>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
<update id="update" parameterType="com.ym.mec.web.dal.entity.StudentRegistration">
|
|
|
UPDATE student_registration
|
|
|
<set>
|
|
|
+ <if test="parentsPhone != null">
|
|
|
+ parents_phone_ = #{parentsPhone},
|
|
|
+ </if>
|
|
|
<if test="subjectId != null">
|
|
|
subject_id_ = #{subjectId},
|
|
|
</if>
|
|
@@ -103,6 +107,17 @@
|
|
|
DELETE FROM student_registration WHERE id_ = #{id}
|
|
|
</delete>
|
|
|
|
|
|
+ <sql id="queryPageSql">
|
|
|
+ <where>
|
|
|
+ <if test="isAllowAdjust != null">
|
|
|
+ AND is_allow_adjust_ = #{isAllowAdjust,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
+ </if>
|
|
|
+ <if test="subjectId != null">
|
|
|
+ AND subject_id_ = #{subjectId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="queryPage" resultMap="StudentRegistration" parameterType="map">
|
|
|
SELECT * FROM student_registration ORDER BY id_
|
|
@@ -113,4 +128,41 @@
|
|
|
<select id="queryCount" resultType="int">
|
|
|
SELECT COUNT(*) FROM student_registration
|
|
|
</select>
|
|
|
+
|
|
|
+ <resultMap type="com.ym.mec.web.dal.utilEntity.StudentApplyDetailUtilEntity" id="studentApplyDetail">
|
|
|
+ <result column="current_grade_" property="currentGrade"/>
|
|
|
+ <result column="current_class_" property="currentClass"/>
|
|
|
+ <result column="is_allow_adjust_" property="isAllowAdjust" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
+ <result column="parents_name_" property="parentsName"/>
|
|
|
+ <result column="parents_phone_" property="parentsPhone"/>
|
|
|
+ <result column="subject_name_" property="subjectName"/>
|
|
|
+ <result column="student_name_" property="studentName"/>
|
|
|
+ <result column="gender_" property="gender"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="queryStudentDetailPageSql">
|
|
|
+ <where>
|
|
|
+ <if test="musicGroupId">
|
|
|
+ sr.music_group_id_ = #{musicGroupId}
|
|
|
+ </if>
|
|
|
+ <if test="subjectId">
|
|
|
+ sr.subject_id_ = #{subjectId}
|
|
|
+ </if>
|
|
|
+ <if test="isAllowAdjust">
|
|
|
+ sr.is_allow_adjust_ = #{isAllowAdjust}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="queryStudentDetailPage" resultMap="studentApplyDetail">
|
|
|
+ SELECT su.username_,sr.parents_name_,sr.current_class_,sr.current_grade_,su.gender_,sr.is_allow_adjust_, s.name_,sr.parents_phone_
|
|
|
+ FROM student_registration sr
|
|
|
+ LEFT JOIN sys_user su ON sr.subject_id_ = su.id_
|
|
|
+ LEFT JOIN `subject` s ON sr.subject_id_ = s.id_
|
|
|
+ <include refid="queryStudentDetailPageSql"/>
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
+ <select id="queryStudentDetailCount" resultType="java.lang.Integer">
|
|
|
+ SELECT COUNT(sr.id_) FROM student_registration sr
|
|
|
+ <include refid="queryStudentDetailPageSql"/>
|
|
|
+ </select>
|
|
|
</mapper>
|