|
@@ -13,6 +13,7 @@
|
|
|
<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="remark_" property="remark"/>
|
|
@@ -39,15 +40,10 @@
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
<insert id="insert" parameterType="com.ym.mec.web.dal.entity.StudentRegistration" useGeneratedKeys="true"
|
|
|
keyColumn="id" keyProperty="id">
|
|
|
- <!--
|
|
|
- <selectKey resultClass="int" keyProperty="id" >
|
|
|
- SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
|
- </selectKey>
|
|
|
- -->
|
|
|
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_)
|
|
|
+ (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},
|
|
|
- #{remark},now(),now(),#{parentsName},#{parentsCompany},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{lastPaymentDate},#{nextPaymentDate})
|
|
|
+ #{remark},now(),now(),#{parentsName},#{parentsCompany},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{lastPaymentDate},#{nextPaymentDate},#{subjectId})
|
|
|
</insert>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -99,6 +95,9 @@
|
|
|
<if test="musicGroupId != null">
|
|
|
music_group_id_ = #{musicGroupId},
|
|
|
</if>
|
|
|
+ <if test="actualSubjectId != null">
|
|
|
+ actual_subject_id_ = #{actualSubjectId},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
WHERE id_ = #{id}
|
|
|
</update>
|
|
@@ -130,35 +129,42 @@
|
|
|
SELECT COUNT(*) FROM student_registration
|
|
|
</select>
|
|
|
|
|
|
- <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="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">
|
|
|
+ <if test="musicGroupId != null">
|
|
|
sr.music_group_id_ = #{musicGroupId}
|
|
|
</if>
|
|
|
- <if test="subjectId">
|
|
|
+ <if test="subjectId != null">
|
|
|
sr.subject_id_ = #{subjectId}
|
|
|
</if>
|
|
|
- <if test="isAllowAdjust">
|
|
|
+ <if test="isAllowAdjust != null">
|
|
|
sr.is_allow_adjust_ = #{isAllowAdjust}
|
|
|
</if>
|
|
|
+ <if test="actualSubjectId != null">
|
|
|
+ sr.actual_subject_id_ = #{actualSubjectId}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
|
|
|
+ <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="parents_name_" property="parentsName"/>
|
|
|
+ <result column="parents_phone_" property="parentsPhone"/>
|
|
|
+ <result column="subject_name_" property="subjectName"/>
|
|
|
+ <result column="username_" property="studentName"/>
|
|
|
+ <result column="actual_subject_name_" property="actualSubjectName"/>
|
|
|
+ <result column="gender_" property="gender" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
+ </resultMap>
|
|
|
<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_
|
|
|
+ SELECT su.username_,sr.parents_name_,sr.current_class_,sr.current_grade_,
|
|
|
+ su.gender_,sr.is_allow_adjust_, s.name_ subject_name_,ss.name_ actual_subject_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_
|
|
|
+ LEFT JOIN `subject` ss ON sr.actual_subject_id_ = s.id_
|
|
|
<include refid="queryStudentDetailPageSql"/>
|
|
|
<include refid="global.limit"/>
|
|
|
</select>
|
|
@@ -166,4 +172,19 @@
|
|
|
SELECT COUNT(sr.id_) FROM student_registration sr
|
|
|
<include refid="queryStudentDetailPageSql"/>
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="countPayNum" resultType="java.lang.Integer">
|
|
|
+ SELECT COUNT(DISTINCT user_id_) FROM student_registration
|
|
|
+ WHERE music_group_id_ = #{musicGroupId} AND subject_id_ = #{subjectId} AND payment_status_ = 1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <resultMap id="queryFeeDetailMap" type="com.ym.mec.web.dal.dto.StudentFeeDto">
|
|
|
+ <result column="deposit_fee_" property="depositFee"/>
|
|
|
+ <result column="course_fee_" property="courseFee"/>
|
|
|
+ <result column="musical_fee_" property="musicalFee"/>
|
|
|
+ <result column="total_amount_" property="totalAmount"/>
|
|
|
+ </resultMap>
|
|
|
+ <select id="queryFeeDetail" resultMap="queryFeeDetailMap">
|
|
|
+
|
|
|
+ </select>
|
|
|
</mapper>
|