select id,
contract_no,
pat_id,
contract_type,
sales_channel,
contract_amount,
payment_status,
contract_status,
start_date,
end_date,
actual_end_date,
pid,
guid,
del_flag,
create_by,
update_by,
update_time,
orgid,
auto_renew,
renewal_reminder_days,
special_terms,
signed_at,
signed_by_patient,
signed_by_hospital,
cancellation_reason,
cancelled_at
from pat_service_contract
insert into pat_service_contract
id,
contract_no,
pat_id,
contract_type,
sales_channel,
contract_amount,
payment_status,
contract_status,
start_date,
end_date,
actual_end_date,
pid,
guid,
del_flag,
create_by,
update_by,
update_time,
orgid,
auto_renew,
renewal_reminder_days,
special_terms,
signed_at,
signed_by_patient,
signed_by_hospital,
cancellation_reason,
cancelled_at,
#{id},
#{contractNo},
#{patId},
#{contractType},
#{salesChannel},
#{contractAmount},
#{paymentStatus},
#{contractStatus},
#{startDate},
#{endDate},
#{actualEndDate},
#{pid},
#{guid},
#{delFlag},
#{createBy},
#{updateBy},
#{updateTime},
#{orgid},
#{autoRenew},
#{renewalReminderDays},
#{specialTerms},
#{signedAt},
#{signedByPatient},
#{signedByHospital},
#{cancellationReason},
#{cancelledAt},
update pat_service_contract
contract_no =
#{contractNo},
pat_id =
#{patId},
contract_type =
#{contractType},
sales_channel =
#{salesChannel},
contract_amount =
#{contractAmount},
payment_status =
#{paymentStatus},
contract_status =
#{contractStatus},
start_date =
#{startDate},
end_date =
#{endDate},
actual_end_date =
#{actualEndDate},
pid =
#{pid},
guid =
#{guid},
del_flag =
#{delFlag},
create_by =
#{createBy},
update_by =
#{updateBy},
update_time =
#{updateTime},
orgid =
#{orgid},
auto_renew =
#{autoRenew},
renewal_reminder_days =
#{renewalReminderDays},
special_terms =
#{specialTerms},
signed_at =
#{signedAt},
signed_by_patient =
#{signedByPatient},
signed_by_hospital =
#{signedByHospital},
cancellation_reason =
#{cancellationReason},
cancelled_at =
#{cancelledAt},
where id = #{id}
update pat_service_contract
del_flag =1
where id = #{id}
update pat_service_contract
del_flag =1
where id in
#{id}