|
@@ -9,14 +9,37 @@
|
|
|
<resultMap type="com.ym.mec.biz.dal.entity.MusicGroupCalenderRefundPeriod" id="MusicGroupCalenderRefundPeriod">
|
|
|
<result column="id_" property="id" />
|
|
|
<result column="organ_id_" property="organId" />
|
|
|
+ <result column="order_nos_" property="orderNos" />
|
|
|
<result column="cooperation_organ_id_" property="cooperationOrganId" />
|
|
|
<result column="calender_id_" property="calenderId" />
|
|
|
<result column="refund_date_" property="refundDate" />
|
|
|
<result column="refund_amount_" property="refundAmount" />
|
|
|
+ <result column="income_" property="income" />
|
|
|
<result column="sub_refund_amount_" property="subRefundAmount" />
|
|
|
+ <result column="refund_flag_" property="refundFlag" />
|
|
|
<result column="create_time_" property="createTime" />
|
|
|
<result column="update_time_" property="updateTime" />
|
|
|
</resultMap>
|
|
|
+
|
|
|
+ <update id="batchUpdate">
|
|
|
+ <foreach collection="refundPeriods" item="bean" index="index" open="" close="" separator=";">
|
|
|
+ UPDATE music_group_calender_refund_period <set>
|
|
|
+ <if test="bean.orderNos != null and bean.orderNos != ''">
|
|
|
+ order_nos_ = #{bean.orderNos},
|
|
|
+ </if>
|
|
|
+ <if test="bean.subRefundAmount != null">
|
|
|
+ sub_refund_amount_ = #{bean.subRefundAmount},
|
|
|
+ </if>
|
|
|
+ <if test="bean.income != null">
|
|
|
+ income_ = #{bean.income},
|
|
|
+ </if>
|
|
|
+ <if test="bean.refundFlag != null">
|
|
|
+ refund_flag_ = #{bean.refundFlag},
|
|
|
+ </if>
|
|
|
+ update_time_ = #{bean.updateTime}
|
|
|
+ </set> WHERE id_ = #{bean.id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
<delete id="deleteByCalenderId">
|
|
|
DELETE FROM music_group_calender_refund_period WHERE calender_id_ = #{calenderId}
|
|
|
</delete>
|
|
@@ -29,19 +52,36 @@
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupCalenderRefundPeriod" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
INSERT INTO music_group_calender_refund_period (organ_id_,cooperation_organ_id_,calender_id_,
|
|
|
- refund_date_,refund_amount_,sub_refund_amount_,create_time_,update_time_)
|
|
|
- VALUES(#{organId},#{cooperationOrganId},#{calenderId},#{refundDate},#{refundAmount},#{subRefundAmount},NOW(),NOW())
|
|
|
+ refund_date_,refund_amount_,sub_refund_amount_,income_,refund_flag_,order_nos_,create_time_,update_time_)
|
|
|
+ VALUES(#{organId},#{cooperationOrganId},#{calenderId},#{refundDate},#{refundAmount},#{subRefundAmount},#{income},#{refundFlag},#{orderNos},NOW(),NOW())
|
|
|
</insert>
|
|
|
<insert id="batchInsert">
|
|
|
INSERT INTO music_group_calender_refund_period (organ_id_,cooperation_organ_id_,calender_id_,
|
|
|
- refund_date_,refund_amount_,sub_refund_amount_,create_time_,update_time_)
|
|
|
+ refund_date_,refund_amount_,sub_refund_amount_,income_,refund_flag_,order_nos_,create_time_,update_time_)
|
|
|
VALUES
|
|
|
<foreach collection="refundPeriods" separator="," item="bean">
|
|
|
(#{bean.organId},#{bean.cooperationOrganId},#{bean.calenderId},#{bean.refundDate},
|
|
|
- #{bean.refundAmount},#{bean.subRefundAmount},#{bean.createTime},#{bean.updateTime})
|
|
|
+ #{bean.refundAmount},#{bean.subRefundAmount},#{bean.income},{bean.refundFlag},{bean.orderNos},#{bean.createTime},#{bean.updateTime})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
|
+ <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupCalenderRefundPeriod">
|
|
|
+ UPDATE music_group_calender_refund_period <set>
|
|
|
+ <if test="orderNos != null and orderNos != ''">
|
|
|
+ order_nos_ = #{orderNos},
|
|
|
+ </if>
|
|
|
+ <if test="subRefundAmount != null">
|
|
|
+ sub_refund_amount_ = #{subRefundAmount},
|
|
|
+ </if>
|
|
|
+ <if test="income != null">
|
|
|
+ income_ = #{income},
|
|
|
+ </if>
|
|
|
+ <if test="refundFlag != null">
|
|
|
+ refund_flag_ = #{refundFlag},
|
|
|
+ </if>
|
|
|
+ update_time_ = NOW()
|
|
|
+ </set> WHERE id_ = #{id}
|
|
|
+ </update>
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="queryPage" resultMap="MusicGroupCalenderRefundPeriod" parameterType="map">
|
|
@@ -99,10 +139,14 @@
|
|
|
<result property="prepaidFee" column="prepaidFee"/>
|
|
|
<result property="nextRefundDate" column="nextRefundDate"/>
|
|
|
<result property="refundStatus" column="refundStatus"/>
|
|
|
+ <result property="contractUrl" column="contract_url_"/>
|
|
|
</resultMap>
|
|
|
<sql id="queryCoopCalenderSql">
|
|
|
+ <if test="cooperationId != null">
|
|
|
+ AND crp.cooperation_organ_id_ = #{cooperationId}
|
|
|
+ </if>
|
|
|
<if test="calenderId != null">
|
|
|
- AND crp.calender_id_
|
|
|
+ AND crp.calender_id_ = #{calenderId}
|
|
|
</if>
|
|
|
<if test="refundStartDate != null and refundStartDate != ''">
|
|
|
AND crp.refund_date_ BETWEEN #{refundStartDate} AND #{refundEndDate}
|
|
@@ -124,7 +168,7 @@
|
|
|
<select id="queryCoopCalender" resultMap="CooperationCalenderRefundDto">
|
|
|
select crp.calender_id_,mgpc.music_group_id_,mg.name_ music_group_name_,mgpc.batch_no_,mgpc.payment_type_,mgpc.calender_fee_type_,
|
|
|
SUM(crp.refund_amount_) receivable_,SUM(crp.sub_refund_amount_) prepaidFee,
|
|
|
- MIN(CASE WHEN crp.refund_flag_ = 0 THEN crp.refund_date_ ELSE NULL END) nextRefundDate
|
|
|
+ MIN(CASE WHEN crp.refund_flag_ = 0 THEN crp.refund_date_ ELSE NULL END) nextRefundDate,crp.organ_id_,mgpc.contract_url_
|
|
|
from music_group_calender_refund_period crp
|
|
|
left join music_group_payment_calender mgpc ON mgpc.id_ = crp.calender_id_
|
|
|
left join music_group mg ON mg.id_ = mgpc.music_group_id_
|