insert into contract_collection_detail(contract_id, collection_period_start, collection_period_end,
receivable_money, collection_date, collection_amount,
special_reduction, unpaid_money, charge_type, invoice_receipt_no, white_list_archive_no)
values (#{contractId}, #{collectionPeriodStart}, #{collectionPeriodEnd},
#{receivableMoney}, #{collectionDate}, #{collectionAmount},
#{specialReduction}, #{unpaidMoney}, #{chargeType}, #{invoiceReceiptNo}, #{whiteListArchiveNo})
update contract_collection_detail t set
t.collection_period_start= #{collectionPeriodStart},
t.collection_period_end= #{collectionPeriodEnd},
t.receivable_money= #{receivableMoney},
t.collection_date= #{collectionDate},
t.collection_amount= #{collectionAmount},
t.special_reduction= #{specialReduction},
t.unpaid_money= #{unpaidMoney}
where 1=1
and t.id= #{id}
and t.contract_id= #{contractId}