select id,
project_code,
order_code,
version_code,
order_name,
customer_code,
customer_name,
customer_contact,
customer_phone,
customer_email,
customer_address,
industry_type,
customer_postcode,
order_type,
order_agent_code,
order_partner_code,
bg_type,
order_date,
status,
remark,
created_at,
updated_at,
deleted_at
from order_info
insert into order_info
project_code,
order_code,
version_code,
order_name,
customer_name,
customer_code,
customer_address,
customer_postcode,
customer_contact,
customer_phone,
customer_email,
order_type,
order_agent_code,
order_partner_code,
order_date,
status,
remark,
created_at,updated_at,create_by,status
#{projectCode},
#{orderCode},
#{versionCode},
#{orderName},
#{customerName},
#{customerCode},
#{customerAddress},
#{customerPostcode},
#{customerContact},
#{customerPhone},
#{customerEmail},
#{orderType},
#{orderAgentCode},
#{orderPartnerCode},
#{orderDate},
#{status},
#{remark},
NOW(),now(),#{createBy},0
update order_info
project_code = #{projectCode},
order_code = #{orderCode},
version_code = #{versionCode},
order_name = #{orderName},
customer_name = #{customerName},
customer_contact = #{customerContact},
customer_phone = #{customerPhone},
customer_email = #{customerEmail},
customer_code=#{customerCode},
customer_address=#{customerAddress},
customer_postcode=#{customerPostcode},
order_type = #{orderType},
order_agent_code = #{orderAgentCode},
order_partner_code = #{orderPartnerCode},
order_date = #{orderDate},
status = #{status},
remark = #{remark},
updated_at = NOW(),update_by = #{updateBy}
where id = #{id}
update order_list set deleted_at=NOW(), status=1 where id in
#{item.id}
update order_list
quantity = #{item.quantity},
amount = #{item.amount},
discount = #{item.discount},
price = #{item.price},
remark = #{item.remark},
updated_at = NOW(),update_by = #{item.updateBy}
where id = #{item.id}
update order_info
set deleted_at=NOW(),
updated_at=now(),
status=1
where id = #{id}
update order_info set deleted_at=NOW(), updated_at=NOW(), status=1 where id in
#{id}
update order_list set status=1, deleted_at=now() where order_id in
#{orderId}
delete
from order_list
where order_id = #{orderId}
delete from order_list where id in
#{item}
insert into order_list(id , order_id, product_code, quantity, price, amount,discount,remark, created_at, updated_at,create_by) values
( #{item.id}, #{item.orderId}, #{item.productCode}, #{item.quantity}, #{item.price}, #{item.amount},#{item.discount},
#{item.remark}, now(),now(),#{item.createBy})