insert into business_pay_fee( amount,operate,income_obj_id,fee_type_cd,start_time,end_time,community_id,b_id,fee_id,user_id,payer_obj_id,fee_flag,state,config_id,payer_obj_type ) values ( #{amount},#{operate},#{incomeObjId},#{feeTypeCd},#{startTime},#{endTime},#{communityId},#{bId},#{feeId},#{userId},#{payerObjId}, #{feeFlag},#{state},#{configId},#{payerObjType} ) insert into pay_fee( amount,income_obj_id,fee_type_cd,start_time,status_cd,end_time,community_id,b_id,fee_id,user_id,payer_obj_id,fee_flag,state,config_id,payer_obj_type ) select t.amount,t.income_obj_id,t.fee_type_cd,t.start_time,'0',t.end_time,t.community_id,t.b_id,t.fee_id,t.user_id,t.payer_obj_id ,t.fee_flag,t.state,t.config_id,t.payer_obj_type from business_pay_fee t where 1=1 and t.amount= #{amount} and t.operate= 'ADD' and t.income_obj_id= #{incomeObjId} and t.fee_type_cd= #{feeTypeCd} and t.start_time= #{startTime} and t.end_time= #{endTime} and t.community_id= #{communityId} and t.b_id= #{bId} and t.fee_id= #{feeId} and t.user_id= #{userId} and t.payer_obj_id= #{payerObjId} and t.state= #{state} and t.fee_flag= #{feeFlag} and t.config_id= #{configId} and t.payer_obj_type = #{payerObjType} update pay_fee t set t.status_cd = #{statusCd} ,t.b_id = #{newBId} , t.amount= #{amount} , t.income_obj_id= #{incomeObjId} , t.fee_type_cd= #{feeTypeCd} , t.start_time= #{startTime} , t.end_time= #{endTime} , t.community_id= #{communityId} , t.user_id= #{userId} , t.payer_obj_id= #{payerObjId} , t.state= #{state} , t.fee_flag= #{feeFlag} where 1=1 and t.b_id= #{bId} and t.fee_id= #{feeId}