|
@@ -19,6 +19,10 @@
|
|
|
<result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="create_time_" property="createTime"/>
|
|
|
<result column="update_time_" property="updateTime"/>
|
|
|
+ <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"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -35,9 +39,11 @@
|
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender" useGeneratedKeys="true"
|
|
|
keyColumn="id" keyProperty="id">
|
|
|
INSERT INTO music_group_payment_calender
|
|
|
- (music_group_id_,payment_month_,start_payment_date_,deadline_payment_date_,payment_status_,expect_num_,actual_num_,memo_,type_,create_time_,update_time_)
|
|
|
+ (music_group_id_,payment_month_,start_payment_date_,deadline_payment_date_,payment_status_,expect_num_,
|
|
|
+ actual_num_,memo_,type_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_,payment_type_)
|
|
|
VALUES(#{musicGroupId},#{paymentMonth},#{startPaymentDate},#{deadlinePaymentDate},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- #{expectNum},#{actualNum},#{memo},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now())
|
|
|
+ #{expectNum},#{actualNum},#{memo},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now(),
|
|
|
+ #{paymentValidStartDate},#{paymentValidEndDate},#{paymentPattern},#{paymentType})
|
|
|
</insert>
|
|
|
<insert id="batchAdd">
|
|
|
INSERT INTO music_group_payment_calender
|
|
@@ -52,6 +58,18 @@
|
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender">
|
|
|
UPDATE music_group_payment_calender
|
|
|
<set>
|
|
|
+ <if test="paymentType != null">
|
|
|
+ payment_type_ = #{paymentType},
|
|
|
+ </if>
|
|
|
+ <if test="paymentValidStartDate != null">
|
|
|
+ payment_valid_start_date_ = #{paymentValidStartDate},
|
|
|
+ </if>
|
|
|
+ <if test="paymentValidEndDate != null">
|
|
|
+ payment_valid_end_date_ = #{paymentValidEndDate},
|
|
|
+ </if>
|
|
|
+ <if test="paymentPattern != null">
|
|
|
+ payment_pattern_ = #{paymentPattern},
|
|
|
+ </if>
|
|
|
<if test="type != null">
|
|
|
type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
</if>
|
|
@@ -90,6 +108,9 @@
|
|
|
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
|
|
|
UPDATE music_group_payment_calender
|
|
|
<set>
|
|
|
+ <if test="paymentPattern != null">
|
|
|
+ payment_pattern_ = #{paymentPattern},
|
|
|
+ </if>
|
|
|
<if test="item.type != null">
|
|
|
type_ = #{item.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
</if>
|
|
@@ -210,4 +231,41 @@
|
|
|
AND (payment_valid_start_date_ BETWEEN #{paymentValidStartDate} AND #{paymentValidEndDate}
|
|
|
OR payment_valid_end_date_ BETWEEN #{paymentValidStartDate} AND #{paymentValidEndDate})
|
|
|
</select>
|
|
|
+ <select id="queryCalenderByDay" resultType="java.util.Map">
|
|
|
+ SELECT mgpcd.music_group_payment_calender_id_ 'key',COUNT(mgpcd.payment_status_) 'value'
|
|
|
+ FROM music_group_payment_calender_detail mgpcd
|
|
|
+ WHERE mgpcd.music_group_payment_calender_id_ IN
|
|
|
+ (SELECT id_ FROM music_group_payment_calender WHERE payment_status_ != 0 AND DATEDIFF('',DATE_FORMAT(start_payment_date_,'%Y-%m-%d')) = #{configValue})
|
|
|
+ AND mgpcd.payment_status_ = 'NON_PAYMENT'
|
|
|
+ GROUP BY mgpcd.music_group_payment_calender_id_
|
|
|
+ </select>
|
|
|
+ <select id="queryByIds" resultMap="MusicGroupPaymentCalender">
|
|
|
+ SELECT * FROM music_group_payment_calender WHERE id_ IN
|
|
|
+ <foreach collection="calenderId" open="(" close=")" item="item" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+ <select id="queryEndIds" resultType="java.lang.Long">
|
|
|
+ SELECT DISTINCT mgpc.id_ FROM music_group_payment_calender mgpc
|
|
|
+ WHERE mgpc.payment_status_ = 2 AND DATEDIFF(#{format},DATE_FORMAT(mgpc.payment_valid_end_date_,'%Y-%m-%d')) = #{configValue1};
|
|
|
+ </select>
|
|
|
+ <resultMap id="CalenderPushDto" type="com.ym.mec.biz.dal.dto.CalenderPushDto">
|
|
|
+ <result property="paymentValidEndDate" column="payment_valid_end_date_"/>
|
|
|
+ <result property="paymentValidStartDate" column="payment_valid_start_date_"/>
|
|
|
+ <result property="teacherId" column="educational_teacher_id_"/>
|
|
|
+ <result property="musicGroupName" column="name_"/>
|
|
|
+ <result property="teacherPhone" column="phone_"/>
|
|
|
+ <result property="calenderId" column="id_"/>
|
|
|
+ </resultMap>
|
|
|
+ <select id="getCalenderPushDto" resultMap="CalenderPushDto">
|
|
|
+ SELECT mgpc.id_,mgpc.payment_valid_start_date_,mgpc.payment_valid_end_date_,
|
|
|
+ mg.educational_teacher_id_,su.real_name_,mg.name_,su.phone_
|
|
|
+ FROM music_group_payment_calender mgpc
|
|
|
+ LEFT JOIN music_group mg ON mgpc.music_group_id_ = mg.id_
|
|
|
+ LEFT JOIN sys_user su ON su.id_ = mg.educational_teacher_id_
|
|
|
+ WHERE mgpc.id_ IN
|
|
|
+ <foreach collection="calenderIds" open="(" close=")" separator="," item="item">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
</mapper>
|