|
@@ -13,14 +13,17 @@
|
|
|
<result column="payment_status_" property="paymentStatus" />
|
|
|
<result column="user_status_" property="userStatus" />
|
|
|
<result column="pay_time_" property="payTime" />
|
|
|
+ <result column="start_payment_date_" property="startPaymentDate" />
|
|
|
+ <result column="deadline_payment_date_" property="deadlinePaymentDate" />
|
|
|
<result column="update_time_" property="updateTime" />
|
|
|
<result column="create_time_" property="createTime" />
|
|
|
<result column="open_" property="open" />
|
|
|
<association property="sysUser" javaType="com.ym.mec.auth.api.entity.SysUser">
|
|
|
<result column="username_" property="username" />
|
|
|
</association>
|
|
|
- <association property="student" javaType="com.ym.mec.biz.dal.entity.Student">
|
|
|
- <result column="subject_names_" property="subjectNames" />
|
|
|
+ <association property="studentRegistration" javaType="com.ym.mec.biz.dal.entity.StudentRegistration">
|
|
|
+ <result column="subject_names_" property="subjectName" />
|
|
|
+ <result column="music_group_status_" property="musicGroupStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
</association>
|
|
|
</resultMap>
|
|
|
|
|
@@ -38,20 +41,22 @@
|
|
|
<insert id="insert"
|
|
|
parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail"
|
|
|
useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
- <!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
|
|
|
- AS ID FROM DUAL </selectKey> -->
|
|
|
INSERT INTO music_group_payment_calender_detail
|
|
|
- (id_,music_group_payment_calender_id_,user_id_,expect_amount_,actual_amount_,payment_status_,user_status_,pay_time_,update_time_,create_time_,open_)
|
|
|
- VALUES(#{id},#{musicGroupPaymentCalenderId},#{userId},#{expectAmount},#{actualAmount},#{paymentStatus},#{userStatus},#{payTime},#{updateTime},#{createTime},#{open})
|
|
|
+ (id_,music_group_payment_calender_id_,user_id_,expect_amount_,actual_amount_,payment_status_,
|
|
|
+ user_status_,pay_time_,update_time_,create_time_,open_,start_payment_date_,deadline_payment_date_)
|
|
|
+ VALUES(#{id},#{musicGroupPaymentCalenderId},#{userId},#{expectAmount},#{actualAmount},#{paymentStatus},
|
|
|
+ #{userStatus},#{payTime},#{updateTime},#{createTime},#{open},#{startPaymentDate},#{deadlinePaymentDate})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail">
|
|
|
INSERT INTO music_group_payment_calender_detail
|
|
|
- (id_,music_group_payment_calender_id_,user_id_,expect_amount_,actual_amount_,payment_status_,user_status_,pay_time_,update_time_,create_time_,open_)
|
|
|
+ (id_,music_group_payment_calender_id_,user_id_,expect_amount_,actual_amount_,
|
|
|
+ payment_status_,user_status_,pay_time_,update_time_,create_time_,open_,start_payment_date_,deadline_payment_date_)
|
|
|
VALUES
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
(#{item.id},#{item.musicGroupPaymentCalenderId},#{item.userId},#{item.expectAmount},
|
|
|
- #{item.actualAmount},#{item.paymentStatus},#{item.userStatus},#{item.payTime},#{item.updateTime},#{item.createTime},#{item.open})
|
|
|
+ #{item.actualAmount},#{item.paymentStatus},#{item.userStatus},#{item.payTime},
|
|
|
+ #{item.updateTime},#{item.createTime},#{item.open},#{item.startPaymentDate},#{item.deadlinePaymentDate})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
@@ -60,6 +65,12 @@
|
|
|
parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail">
|
|
|
UPDATE music_group_payment_calender_detail
|
|
|
<set>
|
|
|
+ <if test="startPaymentDate != null">
|
|
|
+ start_payment_date_ = #{startPaymentDate},
|
|
|
+ </if>
|
|
|
+ <if test="deadlinePaymentDate != null">
|
|
|
+ deadline_payment_date_ = #{deadlinePaymentDate},
|
|
|
+ </if>
|
|
|
<if test="open != null">
|
|
|
open_ = #{open},
|
|
|
</if>
|
|
@@ -134,23 +145,25 @@
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="queryPage" resultMap="MusicGroupPaymentCalenderDetail"
|
|
|
parameterType="map">
|
|
|
- SELECT mgpc.*,su.username_,st.name_ subject_names_
|
|
|
- FROM music_group_payment_calender_detail mgpc
|
|
|
- LEFT JOIN sys_user su ON su.id_ = mgpc.user_id_
|
|
|
- LEFT JOIN student s ON s.user_id_ = mgpc.user_id_
|
|
|
- LEFT JOIN `subject` st ON FIND_IN_SET(st.id_,s.subject_id_list_)
|
|
|
+ SELECT mgpcd.*,su.username_,st.name_ subject_names_,sr.music_group_status_
|
|
|
+ FROM music_group_payment_calender_detail mgpcd
|
|
|
+ LEFT JOIN sys_user su ON su.id_ = mgpcd.user_id_
|
|
|
+ LEFT JOIN student_registration sr ON sr.user_id_ = mgpcd.user_id_
|
|
|
+ LEFT JOIN `subject` st ON st.id_ = sr.actual_subject_id_
|
|
|
+ LEFT JOIN music_group_payment_calender mgpc ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
|
|
|
<where>
|
|
|
+ mgpc.music_group_id_ = sr.music_group_id_
|
|
|
<if test="userId != null">
|
|
|
- mgpc.user_id_ = #{userId}
|
|
|
+ AND mgpcd.user_id_ = #{userId}
|
|
|
</if>
|
|
|
<if test="id != null">
|
|
|
- mgpc.music_group_payment_calender_id_ = #{id}
|
|
|
+ AND mgpcd.music_group_payment_calender_id_ = #{id}
|
|
|
</if>
|
|
|
<if test="paymentStatus != null">
|
|
|
- mgpc.payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
+ AND mgpcd.payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
</if>
|
|
|
<if test="subjectId != null">
|
|
|
- FIND_IN_SET(#{subjectId},s.subject_id_list_)
|
|
|
+ AND #{subjectId} = sr.actual_subject_id_
|
|
|
</if>
|
|
|
</where>
|
|
|
ORDER BY mgpc.create_time_
|
|
@@ -159,21 +172,21 @@
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(mgpc.id_) FROM music_group_payment_calender_detail mgpc
|
|
|
- LEFT JOIN student s ON s.user_id_ = mgpc.user_id_
|
|
|
- LEFT JOIN `subject` st ON FIND_IN_SET(st.id_,s.subject_id_list_)
|
|
|
+ SELECT COUNT(DISTINCT mgpcd.id_) FROM music_group_payment_calender_detail mgpcd
|
|
|
+ LEFT JOIN student_registration sr ON sr.user_id_ = mgpcd.user_id_
|
|
|
+ LEFT JOIN `subject` st ON st.id_ = sr.actual_subject_id_
|
|
|
<where>
|
|
|
<if test="userId != null">
|
|
|
- AND mgpc.user_id_ = #{userId}
|
|
|
+ AND mgpcd.user_id_ = #{userId}
|
|
|
</if>
|
|
|
<if test="id != null">
|
|
|
- AND mgpc.music_group_payment_calender_id_ = #{id}
|
|
|
+ AND mgpcd.music_group_payment_calender_id_ = #{id}
|
|
|
</if>
|
|
|
<if test="subjectId != null">
|
|
|
- AND FIND_IN_SET(#{subjectId},s.subject_id_list_)
|
|
|
+ AND #{subjectId} = sr.actual_subject_id_
|
|
|
</if>
|
|
|
<if test="paymentStatus != null">
|
|
|
- AND mgpc.payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
+ AND mgpcd.payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
@@ -196,4 +209,11 @@
|
|
|
SELECT SUM(mgpcd.actual_amount_) FROM music_group_payment_calender_detail mgpcd
|
|
|
WHERE mgpcd.music_group_payment_calender_id_ = #{id} AND mgpcd.payment_status_ = "PAID_COMPLETED"
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getUserLastCalenderDetail" resultMap="MusicGroupPaymentCalenderDetail">
|
|
|
+ SELECT * FROM music_group_payment_calender_detail mgpcd
|
|
|
+ LEFT JOIN music_group_payment_calender mgpc ON mgpcd.music_group_payment_calender_id_ = mgpc.id_
|
|
|
+ WHERE mgpc.music_group_id_=#{musicGroupId} AND mgpcd.user_id_=#{userId} AND mgpcd.payment_status_ = 'PROCESSING'
|
|
|
+ ORDER BY mgpc.start_payment_date_ DESC
|
|
|
+ </select>
|
|
|
</mapper>
|