|
@@ -17,6 +17,7 @@
|
|
|
<result column="expect_num_" property="expectNum"/>
|
|
|
<result column="actual_num_" property="actualNum"/>
|
|
|
<result column="memo_" property="memo"/>
|
|
|
+ <result column="audit_memo_" property="auditMemo"/>
|
|
|
<result column="reject_reason_" property="rejectReason"/>
|
|
|
<result column="is_give_music_network_" property="isGiveMusicNetwork"/>
|
|
|
<result column="create_time_" property="createTime"/>
|
|
@@ -24,7 +25,7 @@
|
|
|
<result column="payment_valid_start_date_" property="paymentValidStartDate"/>
|
|
|
<result column="payment_valid_end_date_" property="paymentValidEndDate"/>
|
|
|
<result column="payment_pattern_" property="paymentPattern"/>
|
|
|
- <result column="payment_type_" property="paymentType"/>
|
|
|
+ <result column="payment_type_" property="paymentType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="batch_no_" property="batchNo"/>
|
|
|
</resultMap>
|
|
|
|
|
@@ -43,22 +44,25 @@
|
|
|
keyColumn="id_" keyProperty="id">
|
|
|
INSERT INTO music_group_payment_calender
|
|
|
(music_group_id_,music_group_organization_course_settings_id_,pay_user_type_,reject_reason_,start_payment_date_,deadline_payment_date_,status_,expect_num_,
|
|
|
- actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_,payment_type_,batch_no_)
|
|
|
- VALUES(#{musicGroupId},#{musicGroupOrganizationCourseSettingId},#{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{rejectReason},#{startPaymentDate},#{deadlinePaymentDate},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_,payment_type_,batch_no_,audit_memo_)
|
|
|
+ VALUES(#{musicGroupId},#{musicGroupOrganizationCourseSettingId},#{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ #{rejectReason},#{startPaymentDate},#{deadlinePaymentDate},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
#{expectNum},#{actualNum},#{memo},#{isGiveMusicNetwork},now(),now(),
|
|
|
- #{paymentValidStartDate},#{paymentValidEndDate},#{paymentPattern},#{paymentType},#{batchNo})
|
|
|
+ #{paymentValidStartDate},#{paymentValidEndDate},#{paymentPattern},#{paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{batchNo},#{auditMemo})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender" useGeneratedKeys="true"
|
|
|
keyColumn="id_" keyProperty="id">
|
|
|
INSERT INTO music_group_payment_calender
|
|
|
(music_group_id_,music_group_organization_course_settings_id_,pay_user_type_,reject_reason_,start_payment_date_,deadline_payment_date_,status_,expect_num_,
|
|
|
- actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_,payment_type_,batch_no_)
|
|
|
+ actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_,
|
|
|
+ payment_type_,batch_no_,audit_memo_)
|
|
|
VALUES
|
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
|
(#{item.musicGroupId},#{item.musicGroupOrganizationCourseSettingId},#{item.payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.rejectReason},#{item.startPaymentDate},#{item.deadlinePaymentDate},#{item.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
#{item.expectNum},#{item.actualNum},#{item.memo},#{item.isGiveMusicNetwork},now(),now(),
|
|
|
- #{item.paymentValidStartDate},#{item.paymentValidEndDate},#{item.paymentPattern},#{item.paymentType},#{item.batchNo})
|
|
|
+ #{item.paymentValidStartDate},#{item.paymentValidEndDate},#{item.paymentPattern},#{item.paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ #{item.batchNo},#{item.auditMemo})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
@@ -66,8 +70,11 @@
|
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender">
|
|
|
UPDATE music_group_payment_calender
|
|
|
<set>
|
|
|
+ <if test="auditMemo != null and auditMemo != ''">
|
|
|
+ audit_memo_ = #{auditMemo},
|
|
|
+ </if>
|
|
|
<if test="paymentType != null">
|
|
|
- payment_type_ = #{paymentType},
|
|
|
+ payment_type_ = #{paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
</if>
|
|
|
<if test="paymentValidStartDate != null">
|
|
|
payment_valid_start_date_ = #{paymentValidStartDate},
|
|
@@ -123,6 +130,9 @@
|
|
|
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
|
|
|
UPDATE music_group_payment_calender
|
|
|
<set>
|
|
|
+ <if test="item.auditMemo != null and item.auditMemo != ''">
|
|
|
+ audit_memo_ = #{auditMemo},
|
|
|
+ </if>
|
|
|
<if test="item.paymentPattern != null">
|
|
|
payment_pattern_ = #{item.paymentPattern},
|
|
|
</if>
|
|
@@ -337,7 +347,64 @@
|
|
|
ORDER BY create_time_ LIMIT 1;
|
|
|
</select>
|
|
|
|
|
|
- <select id="findByBatchNo" resultMap="MusicGroupPaymentCalender">
|
|
|
+ <select id="findByBatchNo" resultMap="MusicGroupPaymentCalender">
|
|
|
SELECT * FROM music_group_payment_calender WHERE batch_no_=#{batchNo}
|
|
|
</select>
|
|
|
+
|
|
|
+ <resultMap id="MusicGroupPaymentCalenderAuditDtoMap" type="com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto">
|
|
|
+ <result property="musicGroupId" column="music_group_id_"/>
|
|
|
+ <result property="musicGroupName" column="music_group_name_"/>
|
|
|
+ <result property="organId" column="organ_id_"/>
|
|
|
+ <result property="createTime" column="create_time_"/>
|
|
|
+ <result property="paymentType" column="payment_type_"/>
|
|
|
+ <result property="memo" column="memo_"/>
|
|
|
+ <result property="operator" column="operator_"/>
|
|
|
+ <result property="auditStatus" column="status_"/>
|
|
|
+ <result property="addCourseTotalTime" column="course_total_minuties_"/>
|
|
|
+ <result property="courseCurrentPrice" column="course_current_price_"/>
|
|
|
+ <result property="courseOriginalPrice" column="course_original_price_"/>
|
|
|
+ <result property="musicGroupPaymentCalenderId" column="id_"/>
|
|
|
+ <result property="payUserType" column="pay_user_type_"/>
|
|
|
+ <result property="calenderSettingsName" column="calender_settings_name_"/>
|
|
|
+ <result property="paymentPattern" column="payment_pattern_"/>
|
|
|
+ <result property="paymentValidEndDate" column="payment_valid_start_date_"/>
|
|
|
+ <result property="paymentValidEndDate" column="payment_valid_end_date_"/>
|
|
|
+ <result property="startPaymentDate" column="start_payment_date_"/>
|
|
|
+ <result property="deadlinePaymentDate" column="deadline_payment_date_"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="MusicGroupPaymentCalenderAuditDtoSql">
|
|
|
+ <where>
|
|
|
+ <if test="paymentType != null and paymentType != ''">
|
|
|
+ AND mgpc.payment_type_ = #{paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
+ </if>
|
|
|
+ <if test="paymentCalenderStatus != null and paymentCalenderStatus != ''">
|
|
|
+ AND mgpc.status_ = #{paymentCalenderStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
+ </if>
|
|
|
+ <if test="organId != null and organId != ''">
|
|
|
+ AND FIND_IN_SET(mg.organ_id_,#{organId})
|
|
|
+ </if>
|
|
|
+ <if test="search != null and search != ''">
|
|
|
+ AND (mg.id_ LIKE CONCAT('%',#{search},'%') OR mg.name_ LIKE CONCAT('%',#{search},'%'))
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <select id="countAuditList" resultType="java.lang.Integer">
|
|
|
+ SELECT COUNT(DISTINCT mgpc.id_)
|
|
|
+ FROM music_group_payment_calender mgpc
|
|
|
+ LEFT JOIN music_group mg ON mg.id_ = mgpc.music_group_id_
|
|
|
+ <include refid="MusicGroupPaymentCalenderAuditDtoSql"/>
|
|
|
+ </select>
|
|
|
+ <select id="queryAuditList" resultMap="MusicGroupPaymentCalenderAuditDtoMap">
|
|
|
+ SELECT mgpc.id_,mgpc.music_group_id_,mgpc.create_time_,mgpc.payment_type_,mgpc.operator_,
|
|
|
+ mgpc.pay_user_type_,mgpc.memo_,mgpc.status_,SUM(mgpccs.course_total_minuties_) course_total_minuties_,
|
|
|
+ SUM(mgpccs.course_original_price_) course_original_price_,SUM(mgpccs.course_current_price_) course_current_price_,
|
|
|
+ MAX(mg.name_) music_group_name_,MAX(mg.organ_id_) organ_id_,MAX(mgpccs.name_) calender_settings_name_,mgpc.payment_pattern_,mgpc.payment_valid_start_date_,
|
|
|
+ mgpc.payment_valid_end_date_,mgpc.start_payment_date_,mgpc.deadline_payment_date_
|
|
|
+ FROM music_group_payment_calender mgpc
|
|
|
+ LEFT JOIN music_group mg ON mg.id_ = mgpc.music_group_id_
|
|
|
+ LEFT JOIN music_group_payment_calender_course_settings mgpccs ON mgpc.id_ = mgpccs.music_group_payment_calender_id_
|
|
|
+ <include refid="MusicGroupPaymentCalenderAuditDtoSql"/>
|
|
|
+ GROUP BY mgpc.id_
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
</mapper>
|