SELECT id, dept_id, code, customer_id, address_id, order_type, order_mode, pay_mode, consult_mode, insurance_id, is_charge, is_contact, order_status, pay_type, pay_status, worker_id, pay_time, rev_time, expect_time_start, expect_time_end, create_by, create_time, update_time, remark, all_self_assigned, goods_id, timeout_, timeout_fine_times, is_call, order_mode, goods_brand, goods_specification, province_id, city_id , country_id, street_id, address , name , province_name, city_name , country_name , street_name , phone, has_dispatched_all, withdrawn, server_goods_id, service_shop_id, goods_order_master_id, tracking_number, server_goods_money, has_service_order, order_images, is_delivery_to_store, delivery_type, delivery_remark, delivery_images, is_invoiced, is_need_bill, original_worker_id, return_reason, return_reason_detail, return_images, worker_remark, after_service_status FROM order_master SELECT om.id, om.dept_id, om.code, om.customer_id, om.address_id, om.order_type, om.order_mode, om.pay_mode, om.is_charge, om.is_contact, om.order_status, om.pay_type, om.pay_status, om.worker_id, om.pay_time, om.rev_time, om.expect_time_start, om.expect_time_end, om.create_by, om.create_time, om.update_time, om.remark, om.all_self_assigned, om.goods_id, om.timeout_, om.timeout_fine_times, om.is_call, fm.server_money, om.goods_brand, om.goods_specification, om.consult_mode, om.insurance_id, om.province_id, om.city_id , om.country_id, om.street_id, om.address , om.name , om.province_name, om.city_name , om.country_name , om.street_name , om.phone, om.has_dispatched_all, om.withdrawn, om.server_goods_id, om.service_shop_id, om.goods_order_master_id, om.tracking_number, om.server_goods_money, om.has_service_order, om.order_images, om.is_delivery_to_store, om.delivery_type, om.delivery_remark, om.delivery_images, om.is_invoiced, om.is_need_bill, om.original_worker_id, om.return_reason, om.return_reason_detail, om.return_images, om.worker_remark, om.after_service_status FROM order_master om LEFT JOIN customer_address ca ON ca.customer_address_id = om.address_id LEFT JOIN goods g ON g.goods_id = om.goods_id LEFT JOIN financial_master fm ON om.id = fm.order_master_id left join worker w on om.worker_id = w.worker_id DELETE FROM order_master WHERE id IN #{orderMasterId} UPDATE order_master code = #{code}, customer_id = #{customerId}, order_type = #{orderType}, order_status = #{orderStatus}, pay_type = #{payType}, pay_status = #{payStatus}, worker_id = #{workerId}, worker_id = NULL, pay_time = #{payTime}, rev_time = #{revTime}, expect_time_start = #{expectTimeStart}, expect_time_end = #{expectTimeEnd}, expect_time_end = null, update_by = #{updateBy}, all_self_assigned = #{allSelfAssigned}, all_self_assigned = null, has_dispatched_all = #{hasDispatchedAll}, is_call = #{isCall}, is_charge = #{isCharge}, is_contact = #{isContact}, timeout_ = #{timeout}, insurance_id = #{insuranceId}, server_goods_id = #{serverGoodsId}, service_shop_id = #{serviceShopId}, goods_order_master_id = #{goodsOrderMasterId}, tracking_number = #{trackingNumber}, server_goods_money = #{serverGoodsMoney}, has_service_order = #{hasServiceOrder}, order_images = #{orderImages}, is_delivery_to_store = #{isDeliveryToStore}, delivery_type = #{deliveryType}, delivery_remark = #{deliveryRemark}, delivery_images = #{deliveryImages}, is_invoiced = #{isInvoiced}, is_need_bill = #{isNeedBill}, original_worker_id = #{originalWorkerId}, return_reason = #{returnReason}, return_reason_detail = #{returnReasonDetail}, return_images = #{returnImages}, worker_remark = #{workerRemark}, after_service_status = #{afterServiceStatus}, update_time = SYSDATE() WHERE id = #{id} UPDATE order_master SET order_status = #{orderStatus}, update_time = SYSDATE() WHERE id = #{orderMasterId} UPDATE order_master SET pay_status = #{payStatus}, update_time = SYSDATE() WHERE id = #{orderMasterId} INSERT INTO order_master( dept_id, code, customer_id, address_id, goods_id, order_type, order_mode, pay_mode, consult_mode, insurance_id, order_status, pay_type, pay_status, worker_id, pay_time, rev_time, remark, goods_brand, goods_specification, expect_time_start, expect_time_end, create_by, province_id, city_id, country_id, street_id, address, name, phone, province_name, city_name, country_name, street_name, server_goods_id, service_shop_id, goods_order_master_id, tracking_number, server_goods_money, has_service_order, order_images, is_delivery_to_store, delivery_type, delivery_remark, delivery_images, is_invoiced, is_need_bill, original_worker_id, return_reason, return_reason_detail, return_images, worker_remark, create_time )VALUES( #{deptId}, #{code}, #{customerId}, #{addressId}, #{goodsId}, #{orderType}, #{orderMode}, #{payMode}, #{consultMode}, #{insuranceId}, #{orderStatus}, #{payType}, #{payStatus}, #{workerId}, #{payTime}, #{revTime}, #{remark}, #{goodsBrand}, #{goodsSpecification}, #{expectTimeStart}, #{expectTimeEnd}, #{createBy}, #{provinceId}, #{cityId}, #{countryId}, #{streetId}, #{address}, #{name}, #{phone}, #{provinceName}, #{cityName}, #{countryName}, #{streetName}, #{serverGoodsId}, #{serviceShopId}, #{goodsOrderMasterId}, #{trackingNumber}, #{serverGoodsMoney}, #{hasServiceOrder}, #{orderImages}, #{isDeliveryToStore}, #{deliveryType}, #{deliveryRemark}, #{deliveryImages}, #{isInvoiced}, #{isNeedBill}, #{originalWorkerId}, #{returnReason}, #{returnReasonDetail}, #{returnImages}, #{workerRemark}, SYSDATE() ) UPDATE order_master SET timeout_ = #{timeout} ,timeout_fine_times = #{timeoutFineTimes} WHERE id = #{id} UPDATE order_master SET create_time = SYSDATE() WHERE id = #{id} UPDATE order_master SET worker_id = NULL, update_time = SYSDATE() WHERE id = #{id} UPDATE order_master name = #{name}, phone = #{phone}, province_id = #{provinceId}, province_name = #{provinceName}, city_name = #{cityName}, country_name = #{countryName}, street_name = #{streetName}, city_id = #{cityId}, country_id = #{countryId}, street_id = #{streetId}, address = #{address} WHERE id = #{id}