insert into business_pay_fee_config(
fee_type_cd,computing_formula,additional_amount,square_price,is_default,operate,config_id,fee_flag,fee_name,
start_time,end_time,community_id,b_id,bill_type,payment_cd,payment_cycle,computing_formula_text
) values (
#{feeTypeCd},#{computingFormula},#{additionalAmount},#{squarePrice},#{isDefault},#{operate},#{configId},
#{feeFlag},#{feeName},#{startTime},#{endTime},#{communityId},#{bId},#{billType},#{paymentCd},#{paymentCycle},
#{computingFormulaText}
)
insert into pay_fee_config(
fee_type_cd,computing_formula,additional_amount,status_cd,square_price,is_default,config_id,fee_flag,fee_name,
start_time,end_time,community_id,b_id,bill_type,payment_cd,payment_cycle,t.computing_formula_text
) select
t.fee_type_cd,t.computing_formula,t.additional_amount,'0',t.square_price,t.is_default,t.config_id,t.fee_flag,t.fee_name,
t.start_time,t.end_time,t.community_id,
t.b_id,t.bill_type,t.payment_cd,t.payment_cycle,t.computing_formula_text
from business_pay_fee_config t where 1=1
and t.fee_type_cd= #{feeTypeCd}
and t.computing_formula= #{computingFormula}
and t.additional_amount= #{additionalAmount}
and t.square_price= #{squarePrice}
and t.is_default= #{isDefault}
and t.operate= 'ADD'
and t.config_id= #{configId}
and t.fee_flag= #{feeFlag}
and t.fee_name= #{feeName}
and t.bill_type= #{billType}
and t.start_time= #{startTime}
and t.end_time= #{endTime}
and t.community_id= #{communityId}
and t.b_id= #{bId}
update pay_fee_config t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.fee_type_cd= #{feeTypeCd}
, t.computing_formula= #{computingFormula}
, t.computing_formula_text= #{computingFormulaText}
, t.additional_amount= #{additionalAmount}
, t.square_price= #{squarePrice}
, t.payment_cd= #{paymentCd}
, t.payment_cycle= #{paymentCycle}
, t.is_default= #{isDefault}
, t.fee_flag= #{feeFlag}
, t.fee_name= #{feeName}
, t.bill_type= #{billType}
, t.start_time= #{startTime}
, t.end_time= #{endTime}
, t.community_id= #{communityId}
where 1=1
and t.config_id= #{configId}
and t.b_id= #{bId}
insert into pay_fee_config(
fee_type_cd,computing_formula,additional_amount,status_cd,square_price,is_default,config_id,fee_flag,fee_name,
start_time,end_time,community_id,b_id,bill_type,payment_cd,payment_cycle,computing_formula_text
) values (
#{feeTypeCd},#{computingFormula},#{additionalAmount},'0',#{squarePrice},#{isDefault},#{configId},
#{feeFlag},#{feeName},#{startTime},#{endTime},#{communityId},'-1',#{billType},#{paymentCd},#{paymentCycle},#{computingFormulaText}
)