insert into pay_fee_detail_month(
detail_month,detail_year,detail_id,receivable_amount,discount_amount,remark,received_amount,community_id,fee_id,month_id
) values (
#{detailMonth},#{detailYear},#{detailId},#{receivableAmount},#{discountAmount},#{remark},#{receivedAmount},#{communityId},#{feeId},#{monthId}
)
insert into pay_fee_detail_month(
detail_month,detail_year,detail_id,receivable_amount,discount_amount,remark,received_amount,community_id,fee_id,month_id,
obj_name,obj_id,owner_name,owner_id,link,state,pay_fee_time
) values
(
#{item.detailMonth},#{item.detailYear},#{item.detailId},#{item.receivableAmount},#{item.discountAmount},
#{item.remark},#{item.receivedAmount},#{item.communityId},#{item.feeId},#{item.monthId},
#{item.objName},#{item.objId},#{item.ownerName},#{item.ownerId},#{item.link},#{item.state},#{item.payFeeTime}
)
update pay_fee_detail_month t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.detail_month= #{detailMonth}
, t.detail_year= #{detailYear}
, t.receivable_amount= #{receivableAmount}
, t.discount_amount= #{discountAmount}
, t.remark= #{remark}
, t.received_amount= #{receivedAmount}
, t.obj_name= #{objName}
, t.obj_id= #{objId}
, t.owner_name= #{ownerName}
, t.owner_id= #{ownerId}
, t.state= #{state}
, t.pay_fee_time= #{payFeeTime}
where 1=1
and t.month_id= #{monthId}
and t.community_id= #{communityId}
and t.fee_id= #{feeId}
and t.detail_id= #{detailId}
and t.cur_month_time >= #{curMonthStartTime}
and t.cur_month_time <= #{curMonthEndTime}