SELECT id, dept_id, code, customer_id, address_id, order_type, order_mode, pay_mode, 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 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 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}, 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, 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, create_time )VALUES( #{deptId}, #{code}, #{customerId}, #{addressId}, #{goodsId}, #{orderType}, #{orderMode}, #{payMode}, #{orderStatus}, #{payType}, #{payStatus}, #{workerId}, #{payTime}, #{revTime}, #{remark}, #{goodsBrand}, #{goodsSpecification}, #{expectTimeStart}, #{expectTimeEnd}, #{createBy}, SYSDATE() ) UPDATE order_master SET timeout_ = #{timeout} ,timeout_fine_times = #{timeoutFineTimes} WHERE id = #{id} UPDATE order_master SET worker_id = NULL, update_time = SYSDATE() WHERE id = #{id}