|  | @@ -27,6 +27,7 @@
 | 
	
		
			
				|  |  |          <result column="payment_pattern_" property="paymentPattern"/>
 | 
	
		
			
				|  |  |          <result column="payment_type_" property="paymentType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
 | 
	
		
			
				|  |  |          <result column="batch_no_" property="batchNo"/>
 | 
	
		
			
				|  |  | +        <result column="payment_amount_" property="paymentAmount"/>
 | 
	
		
			
				|  |  |      </resultMap>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <!-- 根据主键查询一条记录 -->
 | 
	
	
		
			
				|  | @@ -44,24 +45,24 @@
 | 
	
		
			
				|  |  |              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_,audit_memo_)
 | 
	
		
			
				|  |  | +        actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_,payment_type_,payment_amount_,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,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{batchNo},#{auditMemo})
 | 
	
		
			
				|  |  | +        #{paymentValidStartDate},#{paymentValidEndDate},#{paymentPattern},#{paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{paymentAmount},#{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_,
 | 
	
		
			
				|  |  | +        actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_,payment_amount_,
 | 
	
		
			
				|  |  |          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,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 | 
	
		
			
				|  |  | +        #{item.paymentValidStartDate},#{item.paymentValidEndDate},#{item.paymentPattern},#{item.paymentAmount},#{item.paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 | 
	
		
			
				|  |  |          #{item.batchNo},#{item.auditMemo})
 | 
	
		
			
				|  |  |          </foreach>
 | 
	
		
			
				|  |  |      </insert>
 | 
	
	
		
			
				|  | @@ -122,6 +123,9 @@
 | 
	
		
			
				|  |  |              <if test="batchNo != null">
 | 
	
		
			
				|  |  |                  batch_no_ = #{batchNo},
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  | +            <if test="paymentAmount != null">
 | 
	
		
			
				|  |  | +                payment_amount_ = #{paymentAmount},
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  |          </set>
 | 
	
		
			
				|  |  |          WHERE id_ = #{id}
 | 
	
		
			
				|  |  |      </update>
 | 
	
	
		
			
				|  | @@ -175,6 +179,9 @@
 | 
	
		
			
				|  |  |                  <if test="item.batchNo != null">
 | 
	
		
			
				|  |  |                      batch_no_ = #{item.batchNo},
 | 
	
		
			
				|  |  |                  </if>
 | 
	
		
			
				|  |  | +	            <if test="item.paymentAmount != null">
 | 
	
		
			
				|  |  | +	                payment_amount_ = #{item.paymentAmount},
 | 
	
		
			
				|  |  | +	            </if>
 | 
	
		
			
				|  |  |  	        </set>
 | 
	
		
			
				|  |  |  	        WHERE id_ = #{item.id}
 | 
	
		
			
				|  |  |  		</foreach>
 | 
	
	
		
			
				|  | @@ -371,6 +378,7 @@
 | 
	
		
			
				|  |  |          <result property="paymentValidEndDate" column="payment_valid_end_date_"/>
 | 
	
		
			
				|  |  |          <result property="startPaymentDate" column="start_payment_date_"/>
 | 
	
		
			
				|  |  |          <result property="deadlinePaymentDate" column="deadline_payment_date_"/>
 | 
	
		
			
				|  |  | +        <result property="auditMemo" column="audit_memo_"/>
 | 
	
		
			
				|  |  |      </resultMap>
 | 
	
		
			
				|  |  |      <sql id="MusicGroupPaymentCalenderAuditDtoSql">
 | 
	
		
			
				|  |  |          <where>
 | 
	
	
		
			
				|  | @@ -398,8 +406,7 @@
 | 
	
		
			
				|  |  |          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_
 | 
	
		
			
				|  |  | +        MAX(mg.name_) music_group_name_,MAX(mg.organ_id_) organ_id_,mgpc.payment_pattern_
 | 
	
		
			
				|  |  |          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_
 | 
	
	
		
			
				|  | @@ -419,4 +426,15 @@
 | 
	
		
			
				|  |  |          AND mgpcd.payment_status_ = 'PAID_COMPLETED'
 | 
	
		
			
				|  |  |          GROUP BY mgpcd.music_group_payment_calender_id_
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  | +    <select id="getAuditDetail" 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_,mgpc.audit_memo_
 | 
	
		
			
				|  |  | +        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_
 | 
	
		
			
				|  |  | +        WHERE mgpc.id_ = #{calenderId} LIMIT 1
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  |  </mapper>
 |