|
@@ -9,40 +9,48 @@
|
|
|
<resultMap type="com.ym.mec.web.dal.entity.StudentRegistration" id="StudentRegistration">
|
|
|
<result column="id_" property="id"/>
|
|
|
<result column="user_id_" property="userId"/>
|
|
|
+ <result column="name_" property="name"/>
|
|
|
<result column="music_group_id_" property="musicGroupId"/>
|
|
|
<result column="current_grade_" property="currentGrade"/>
|
|
|
<result column="current_class_" property="currentClass"/>
|
|
|
<result column="subject_id_" property="subjectId"/>
|
|
|
<result column="actual_subject_id_" property="actualSubjectId"/>
|
|
|
- <result column="is_allow_adjust_" property="isAllowAdjust" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
- <result column="kit_purchase_method_" property="kitPurchaseMethod" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
+ <result column="is_allow_adjust_" property="isAllowAdjust"
|
|
|
+ typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
+ <result column="kit_purchase_method_" property="kitPurchaseMethod"
|
|
|
+ typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="remark_" property="remark"/>
|
|
|
+ <result column="class_group_id_" property="classGroupId"/>
|
|
|
<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="payment_status_" property="paymentStatus"
|
|
|
+ typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="last_payment_date_" property="lastPaymentDate"/>
|
|
|
<result column="next_payment_date_" property="nextPaymentDate"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
<select id="get" resultMap="StudentRegistration">
|
|
|
- SELECT * FROM student_registration WHERE id_ = #{id}
|
|
|
- </select>
|
|
|
+ SELECT * FROM student_registration WHERE id_ = #{id}
|
|
|
+ </select>
|
|
|
|
|
|
<!-- 全查询 -->
|
|
|
<select id="findAll" resultMap="StudentRegistration">
|
|
|
- SELECT * FROM student_registration ORDER BY id_
|
|
|
- </select>
|
|
|
+ SELECT *
|
|
|
+ FROM student_registration
|
|
|
+ ORDER BY id_
|
|
|
+ </select>
|
|
|
+
|
|
|
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
<insert id="insert" parameterType="com.ym.mec.web.dal.entity.StudentRegistration" useGeneratedKeys="true"
|
|
|
keyColumn="id" keyProperty="id">
|
|
|
INSERT INTO student_registration
|
|
|
- (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_,actual_subject_id_)
|
|
|
- VALUES(#{parentsPhone},#{id},#{userId},#{musicGroupId},#{currentGrade},#{currentClass},#{subjectId},#{isAllowAdjust,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{kitPurchaseMethod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ (parents_phone_,id_,user_id_,name_,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_,actual_subject_id_)
|
|
|
+ VALUES(#{parentsPhone},#{id},#{userId},#{name},#{musicGroupId},#{currentGrade},#{currentClass},#{subjectId},#{isAllowAdjust,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{kitPurchaseMethod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
#{remark},now(),now(),#{parentsName},#{parentsCompany},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{lastPaymentDate},#{nextPaymentDate},#{subjectId})
|
|
|
</insert>
|
|
|
|
|
@@ -77,6 +85,9 @@
|
|
|
<if test="userId != null">
|
|
|
user_id_ = #{userId},
|
|
|
</if>
|
|
|
+ <if test="name != null">
|
|
|
+ name_ = #{name},
|
|
|
+ </if>
|
|
|
<if test="remark != null">
|
|
|
remark_ = #{remark},
|
|
|
</if>
|
|
@@ -104,8 +115,8 @@
|
|
|
|
|
|
<!-- 根据主键删除一条记录 -->
|
|
|
<delete id="delete">
|
|
|
- DELETE FROM student_registration WHERE id_ = #{id}
|
|
|
- </delete>
|
|
|
+ DELETE FROM student_registration WHERE id_ = #{id}
|
|
|
+ </delete>
|
|
|
|
|
|
<sql id="queryPageSql">
|
|
|
<where>
|
|
@@ -126,8 +137,9 @@
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(*) FROM student_registration
|
|
|
- </select>
|
|
|
+ SELECT COUNT(*)
|
|
|
+ FROM student_registration
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
<sql id="queryStudentDetailPageSql">
|
|
@@ -150,7 +162,8 @@
|
|
|
<resultMap type="com.ym.mec.web.dal.dto.StudentApplyDetailDto" 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="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"/>
|
|
@@ -187,4 +200,16 @@
|
|
|
<select id="queryFeeDetail" resultMap="queryFeeDetailMap">
|
|
|
|
|
|
</select>
|
|
|
+
|
|
|
+ <!-- 根据乐团和声部获取未分班的学生 -->
|
|
|
+ <select id="getNoClassStuBySubjectId" resultMap="StudentRegistration">
|
|
|
+ SELECT * FROM student_registration WHERE music_group_id_ = #{musicGroupId} AND actual_subject_id_ =
|
|
|
+ #{actualSubjectId} AND class_group_id_ >=1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据乐团和声部获取未分班人数 -->
|
|
|
+ <select id="getNoClassStuCountBySubjectId" resultType="java.lang.Integer">
|
|
|
+ SELECT count(*) FROM student_registration WHERE music_group_id_ = #{musicGroupId} AND actual_subject_id_ =
|
|
|
+ #{actualSubjectId} AND class_group_id_ >=1
|
|
|
+ </select>
|
|
|
</mapper>
|