insert into business_pay_fee_detail_discount(
operate,detail_discount_id,discount_price,detail_id,remark,b_id,community_id,discount_id,fee_id
) values (
#{operate},#{detailDiscountId},#{discountPrice},#{detailId},#{remark},#{bId},#{communityId},#{discountId},#{feeId}
)
insert into pay_fee_detail_discount(
create_time,detail_discount_id,discount_price,detail_id,status_cd,remark,b_id,community_id,discount_id,fee_id
) select
t.create_time,t.detail_discount_id,t.discount_price,t.detail_id,'0',t.remark,t.b_id,t.community_id,t.discount_id,t.fee_id
from business_pay_fee_detail_discount t where 1=1
and t.operate= 'ADD'
and t.create_time= #{createTime}
and t.detail_discount_id= #{detailDiscountId}
and t.discount_price= #{discountPrice}
and t.detail_id= #{detailId}
and t.remark= #{remark}
and t.b_id= #{bId}
and t.community_id= #{communityId}
and t.discount_id= #{discountId}
and t.fee_id= #{feeId}
update pay_fee_detail_discount t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.create_time= #{createTime}
, t.discount_price= #{discountPrice}
, t.detail_id= #{detailId}
, t.remark= #{remark}
, t.community_id= #{communityId}
, t.discount_id= #{discountId}
, t.fee_id= #{feeId}
where 1=1
and t.detail_discount_id= #{detailDiscountId}
and t.b_id= #{bId}