select t.id, t.acc_code, t.temp_credit_money_adjust, t.start_date, t.end_date,
t.remark, t.del_flag, t.create_by, t.create_time, t.update_by, t.update_time,
t.create_site, t.update_site, c.trans_type, d.customer_name
from emis_temp_credit_customer t
left join emis_credit_customer c on t.acc_code = c.acc_code and c.del_flag = '0'
left join emis_customer_user d on c.customer_code = d.customer_code and d.del_flag = '0'
insert into emis_temp_credit_customer
id,acc_code,temp_credit_money_adjust,start_date,end_date,remark,del_flag,create_by,create_time,update_by,update_time,create_site,update_site,#{id},#{accCode},#{tempCreditMoneyAdjust},#{startDate},#{endDate},#{remark},#{delFlag},#{createBy},#{createTime},#{updateBy},#{updateTime},#{createSite},#{updateSite},
update emis_temp_credit_customer
acc_code = #{accCode},temp_credit_money_adjust = #{tempCreditMoneyAdjust},start_date = #{startDate},end_date = #{endDate},remark = #{remark},del_flag = #{delFlag},create_by = #{createBy},create_time = #{createTime},update_by = #{updateBy},update_time = #{updateTime},create_site = #{createSite},update_site = #{updateSite},
where id = #{id}
update emis_temp_credit_customer set del_flag = '1' where id = #{id}
update emis_temp_credit_customer set del_flag = '1' where id in
#{id}