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}
)
select t.amount,t.operate,t.income_obj_id,t.income_obj_id incomeObjId,t.fee_type_cd,t.fee_type_cd
feeTypeCd,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.community_id,t.community_id
communityId,t.b_id,t.b_id bId,t.fee_id,t.fee_id feeId,t.user_id,t.user_id userId,t.payer_obj_id,t.payer_obj_id
payerObjId,t.fee_flag,t.fee_flag feeFlag,t.state,t.config_id,t.config_id
configId,t.payer_obj_type,t.payer_obj_type payerObjType
from business_pay_fee t
where 1 =1
and t.amount= #{amount}
and t.operate= #{operate}
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}
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}
select t.amount,t.income_obj_id,t.income_obj_id incomeObjId,t.fee_type_cd,t.fee_type_cd
feeTypeCd,t.start_time,t.start_time startTime,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time
endTime,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.fee_id,t.fee_id feeId,t.user_id,t.user_id
userId,t.payer_obj_id,t.payer_obj_id payerObjId,pfc.square_price squarePrice,pfc.additional_amount
additionalAmount,t.fee_flag,t.fee_flag feeFlag,t.state,t.config_id,t.config_id configId,
pfc.fee_name feeName,td1.name feeTypeCdName,td2.name stateName,td3.name feeFlagName,pfc.computing_formula
computingFormula,
t.payer_obj_type,t.payer_obj_type payerObjType,pfc.is_default isDefault,pfc.start_time
configStartTime,pfc.end_time configEndTime
from pay_fee t,pay_fee_config pfc,t_dict td1,t_dict td2,t_dict td3
where 1 =1
and t.fee_type_cd = pfc.fee_type_cd
and t.config_id = pfc.config_id
and pfc.status_cd = '0'
and pfc.fee_type_cd = td1.status_cd
and td1.table_name = 'pay_fee_config'
and td1.table_columns = 'fee_type_cd'
and t.state = td2.status_cd
and td2.table_name = 'pay_fee'
and td2.table_columns = 'state'
and t.fee_flag = td3.status_cd
and td3.table_name = 'pay_fee'
and td3.table_columns = 'fee_flag'
and t.amount= #{amount}
and t.income_obj_id= #{incomeObjId}
and t.fee_type_cd= #{feeTypeCd}
and t.fee_type_cd in
#{item}
and t.start_time= #{startTime}
and t.status_cd= #{statusCd}
and t.end_time= #{endTime}
and t.end_time < #{arrearsEndTime}
and t.community_id= #{communityId}
and pfc.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.payer_obj_id in
#{item}
and t.state= #{state}
and t.fee_flag= #{feeFlag}
and t.config_id= #{configId}
and t.payer_obj_type = #{payerObjType}
order by t.create_time desc
limit #{page}, #{row}
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}
select count(1) count
from pay_fee t,pay_fee_config pfc,t_dict td1,t_dict td2,t_dict td3
where 1 =1
and t.fee_type_cd = pfc.fee_type_cd
and t.config_id = pfc.config_id
and pfc.status_cd = '0'
and pfc.fee_type_cd = td1.status_cd
and td1.table_name = 'pay_fee_config'
and td1.table_columns = 'fee_type_cd'
and t.state = td2.status_cd
and td2.table_name = 'pay_fee'
and td2.table_columns = 'state'
and t.fee_flag = td3.status_cd
and td3.table_name = 'pay_fee'
and td3.table_columns = 'fee_flag'
and t.amount= #{amount}
and t.income_obj_id= #{incomeObjId}
and t.fee_type_cd= #{feeTypeCd}
and t.fee_type_cd in
#{item}
and t.start_time= #{startTime}
and t.status_cd= #{statusCd}
and t.end_time= #{endTime}
and t.end_time < #{arrearsEndTime}
and t.end_time > #{noArrearsEndTime}
and t.community_id= #{communityId}
and pfc.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.payer_obj_id in
#{item}
and t.state= #{state}
and t.fee_flag= #{feeFlag}
and t.config_id= #{configId}
and t.payer_obj_type = #{payerObjType}
select
t.bill_id billId,
t.bill_name billName,
t.receivable,
t.receipts,
t.bill_time billTime,
t.community_id communityId,
t.config_id configId,
t.cur_bill curBill
from bill t
where 1 =1
and t.bill_id= #{billId}
and t.bill_name= #{billName}
and t.receivable= #{receivable}
and t.receipts= #{receipts}
and t.bill_time= #{billTime}
and t.community_id= #{communityId}
and t.config_id = #{configId}
and t.cur_bill = #{curBill}
order by t.create_time desc
limit #{page}, #{row}
select count(1) count
from bill t
where 1 =1
and t.bill_id= #{billId}
and t.bill_name= #{billName}
and t.receivable= #{receivable}
and t.cur_receivable= #{curReceivable}
and t.receipts= #{receipts}
and t.bill_time= #{billTime}
and t.community_id= #{communityId}
and t.config_id = #{configId}
and t.cur_bill = #{curBill}
select
t.owe_id oweId,
t.bill_id billId,
t.fee_id feeId,
t.bill_amount_owed billAmountOwed,
t.amount_owed amountOwed,
t.fee_end_time feeEndTime,
t.owner_id ownerId,
t.owner_name ownerName,
t.owner_tel ownerTel,
t.payer_obj_name payerObjName,
t.payer_obj_type payerObjType,
t.community_id communityId,
t.state,
t.create_time createTime
from bill_owe_fee t
where 1 =1
and t.owe_id= #{oweId}
and t.bill_id= #{billId}
and t.fee_id= #{feeId}
and t.bill_amount_owed= #{billAmountOwed}
and t.amount_owed= #{amountOwed}
and t.fee_end_time = #{feeEndTime}
and t.owner_id = #{ownerId}
and t.owner_name = #{ownerName}
and t.community_id= #{communityId}
and t.state= #{state}
order by t.create_time desc
limit #{page}, #{row}
select count(1) count
from bill_owe_fee t
where 1 =1
and t.owe_id= #{oweId}
and t.bill_id= #{billId}
and t.fee_id= #{feeId}
and t.bill_amount_owed= #{billAmountOwed}
and t.amount_owed= #{amountOwed}
and t.fee_end_time = #{feeEndTime}
and t.owner_id = #{ownerId}
and t.owner_name = #{ownerName}
and t.community_id= #{communityId}
and t.state= #{state}