select id, project_id,province, city, business_person, business_email, business_phone, order_code, currencyType,
shipment_amount, actual_purchase_amount, order_end_time, delivery_time, company_delivery, notifier,
notifier_email, notifier_phone, duty, duty_email, duty_phone, order_channel, partner_code, supplier,notifier_address,
remark, order_status, create_by, create_time, update_by, update_time,version_code,process_type,process_template,discount_fold,
delivery_status,sign_status,outer_status,approve_time,payment_method,payment_ratio,payment_description
from project_order_info t1
select t1.id, t1.project_id,t1.province, t1.city, t1.business_person, t1.business_email, t1.business_phone, t1.order_code, t1.currencyType,
t1.shipment_amount, t1.actual_purchase_amount, t1.order_end_time, t1.delivery_time, t1.company_delivery, t1.notifier,
t1.notifier_email, t1.notifier_phone, t1.duty, t1.duty_email, t1.duty_phone, t1.order_channel, t1.partner_code, t1.supplier,
t1.remark, t1.order_status, t1.create_by, t1.create_time, t1.update_by, t1.update_time,t1.partner_user_name,t1.partner_email
,t1.partner_phone,t1.version_code,t1.process_type,t1.process_template,t1.discount_fold,t1.notifier_address,
t1.delivery_status,t1.sign_status,t1.outer_status,t1.approve_time,t1.payment_method,t1.payment_ratio,t1.payment_description
,t2.project_code,t2.project_name,t2.province,t2.customer_name,t2.customer_code,t2.industry_type,t2.bg_property,t2.agent_code,t2.estimated_order_time
,t2.customer_phone,t2.customer_user_name,t2.agent_code,t2.customer_code,t2.partner_name project_partner_name
,t3.partner_name,t3.level,t3.system_user_id
,t4.agent_name
,t5.user_name as duty_name
from project_order_info t1
left join project_info t2 on t1.project_id = t2.id
left join partner_info t3 on t1.partner_code=t3.partner_code
left join agent_info t4 on t2.agent_code=t4.agent_code
left join sys_user t5 on t1.duty=t5.user_id
insert into project_order_info
project_id,
province,
city,
business_person,
business_email,
business_phone,
order_code,
version_code,
currencyType,
shipment_amount,
actual_purchase_amount,
order_end_time,
delivery_time,
company_delivery,
notifier,
notifier_email,
notifier_phone,
notifier_address,
duty,
duty_email,
duty_phone,
order_channel,
partner_code,
partner_email,
partner_user_name,
partner_phone,
supplier,
remark,
order_status,
create_by,
create_time,
update_by,
update_time,
process_type,
process_template,
discount_fold,
payment_method,
payment_ratio,
payment_description,
#{projectId},
#{province},
#{city},
#{businessPerson},
#{businessEmail},
#{businessPhone},
#{orderCode},
#{versionCode},
#{currencyType},
#{shipmentAmount},
#{actualPurchaseAmount},
#{orderEndTime},
#{deliveryTime},
#{companyDelivery},
#{notifier},
#{notifierEmail},
#{notifierPhone},
#{notifierAddress},
#{duty},
#{dutyEmail},
#{dutyPhone},
#{orderChannel},
#{partnerCode},
#{partnerEmail},
#{partnerUserName},
#{partnerPhone},
#{supplier},
#{remark},
#{orderStatus},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
#{processType},
#{processTemplate},
#{discountFold},
#{paymentMethod},
#{paymentRatio},
#{paymentDescription},
insert into project_order_info_log(id,
project_id,
province,
city,
business_person,
business_email,
business_phone,
version_code,
order_code,
currencyType,
shipment_amount,
actual_purchase_amount,
order_end_time,
delivery_time,
company_delivery,
notifier,
notifier_email,
notifier_phone,
notifier_address,
duty,
duty_email,
duty_phone,
order_channel,
partner_user_name,
partner_phone,
partner_email,
partner_code,
supplier,
remark,
delivery_status,
sign_status,
outer_status,
approve_time,
order_status,
create_by,
create_time,
update_by,
update_time,
process_type,
process_template,
discount_fold)
select id,
project_id,
province,
city,
business_person,
business_email,
business_phone,
version_code,
order_code,
currencyType,
shipment_amount,
actual_purchase_amount,
order_end_time,
delivery_time,
company_delivery,
notifier,
notifier_email,
notifier_phone,
notifier_address,
duty,
duty_email,
duty_phone,
order_channel,
partner_user_name,
partner_phone,
partner_email,
partner_code,
supplier,
remark,
delivery_status,
sign_status,
outer_status,
approve_time,
order_status,
create_by,
create_time,
update_by,
update_time,
process_type,
process_template,
discount_fold
from project_order_info
where order_code = #{orderCode}
update project_order_info
project_id = #{projectId},
province = #{province},
city = #{city},
business_person = #{businessPerson},
business_email = #{businessEmail},
business_phone = #{businessPhone},
order_code = #{orderCode},
version_code=#{versionCode},
currencyType = #{currencyType},
shipment_amount = #{shipmentAmount},
actual_purchase_amount = #{actualPurchaseAmount},
order_end_time = #{orderEndTime},
delivery_time = #{deliveryTime},
company_delivery = #{companyDelivery},
notifier = #{notifier},
notifier_email = #{notifierEmail},
notifier_phone = #{notifierPhone},
notifier_address = #{notifierAddress},
duty = #{duty},
duty_email = #{dutyEmail},
duty_phone = #{dutyPhone},
order_channel = #{orderChannel},
partner_code = #{partnerCode},
partner_email=#{partnerEmail},
process_type=#{processType},
process_template=#{processTemplate},
discount_fold=#{discountFold},
partner_user_name=#{partnerUserName},
partner_phone=#{partnerPhone},
supplier = #{supplier},
remark = #{remark},
order_status = #{orderStatus},
outer_status = #{outerStatus},
delivery_status = #{deliveryStatus},
sign_status = #{signStatus},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
approve_time = #{approveTime},
payment_method = #{paymentMethod},
payment_ratio = #{paymentRatio},
payment_description = #{paymentDescription},
where id = #{id}
update project_order_info
project_id = #{projectId},
province = #{province},
city = #{city},
business_person = #{businessPerson},
business_email = #{businessEmail},
business_phone = #{businessPhone},
approve_time = #{approveTime},
payment_method = #{paymentMethod},
payment_ratio = #{paymentRatio},
payment_description = #{paymentDescription},
version_code = cast(version_code as UNSIGNED) +1,
version_code = #{versionCode},
process_type=${processType},
process_template=${processTemplate},
discount_fold=${discountFold},
currencyType = #{currencyType},
shipment_amount = #{shipmentAmount},
actual_purchase_amount = #{actualPurchaseAmount},
order_end_time = #{orderEndTime},
delivery_time = #{deliveryTime},
company_delivery = #{companyDelivery},
notifier = #{notifier},
notifier_email = #{notifierEmail},
notifier_phone = #{notifierPhone},
notifier_address = #{notifierAddress},
duty = #{duty},
duty_email = #{dutyEmail},
duty_phone = #{dutyPhone},
order_channel = #{orderChannel},
partner_code = #{partnerCode},
partner_email=#{partnerEmail},
partner_user_name=#{partnerUserName},
partner_phone=#{partnerPhone},
supplier = #{supplier},
remark = #{remark},
order_status = #{orderStatus},
outer_status = #{outerStatus},
delivery_status = #{deliveryStatus},
sign_status = #{signStatus},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
where order_code = #{orderCode}
delete from project_order_info where id = #{id}
delete from project_order_info where id in
#{id}