SELECT id, code, order_master_id, order_master_code, customer_id, order_type, order_status, worker_id, rev_time, expect_time_start, expect_time_end, work_begin_time, work_finish_time, draw_cash_id, draw_cash_time, arrival_time, draw_cash_status, clock_in_location, ledger_account_status, shelve_status, create_by, create_time, update_time, remark, handover_images, handover_remark, confirm_start_time, timeout_, timeout_fine_times, after_timeout, delay_count, return_reason, return_reason_detail, return_images, worker_remark, after_service_status, share_account_countdown_end_time, share_account_countdown_duration FROM order_detail SELECT od.id, od.code, od.order_master_id, od.order_master_code, od.customer_id, od.order_type, od.order_status, od.worker_id, od.rev_time, od.expect_time_start, od.expect_time_end, od.work_begin_time, od.work_finish_time, od.draw_cash_id, od.draw_cash_time, od.arrival_time, od.draw_cash_status, od.clock_in_location, od.ledger_account_status, od.shelve_status, od.create_by, od.create_time, od.update_time, od.remark, od.handover_images, od.handover_remark, od.confirm_start_time, od.draw_cash_status, od.timeout_, od.timeout_fine_times, od.after_timeout, od.delay_count, od.return_reason, od.return_reason_detail, od.return_images, od.worker_remark, od.after_service_status, od.share_account_countdown_end_time, od.share_account_countdown_duration FROM order_detail od LEFT JOIN order_master om ON om.id = od.order_master_id 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 worker w on od.worker_id = w.worker_id DELETE FROM order_detail WHERE id IN #{orderDetailId} DELETE FROM order_detail WHERE order_master_id = #{masterId} UPDATE order_detail code = #{code}, order_master_id = #{orderMasterId}, order_master_code = #{orderMasterCode}, customer_id = #{customerId}, order_type = #{orderType}, order_status = #{orderStatus}, worker_id = #{workerId}, rev_time = #{revTime}, expect_time_start = #{expectTimeStart}, expect_time_end = #{expectTimeEnd}, expect_time_end = null, work_begin_time = #{workBeginTime}, work_finish_time = #{workFinishTime}, draw_cash_id = #{drawCashId}, draw_cash_time = #{drawCashTime}, arrival_time = #{arrivalTime}, draw_cash_status = #{drawCashStatus}, clock_in_location = #{clockInLocation}, remark = #{remark}, handover_images = #{handoverImages}, handover_remark = #{handoverRemark}, confirm_start_time = #{confirmStartTime}, update_by = #{updateBy}, ledger_account_status = #{ledgerAccountStatus}, timeout_ = #{timeout}, delay_count = #{delayCount}, return_reason = #{returnReason}, return_reason_detail = #{returnReasonDetail}, return_images = #{returnImages}, worker_remark = #{workerRemark}, after_service_status = #{afterServiceStatus}, share_account_countdown_end_time = #{shareAccountCountdownEndTime}, share_account_countdown_duration = #{shareAccountCountdownDuration}, update_time = SYSDATE() WHERE id = #{id} UPDATE order_detail SET order_status = #{orderStatus}, update_time = SYSDATE() WHERE id = #{id} UPDATE order_detail SET timeout_ = #{timeout}, timeout_fine_times = #{timeoutFineTimes} WHERE id = #{id} UPDATE order_detail SET after_timeout = #{timeout}, timeout_fine_times = #{timeoutFineTimes}, update_time = SYSDATE() WHERE id = #{id} UPDATE order_detail order_status = #{orderStatus}, update_time = SYSDATE() WHERE order_master_id = #{orderMasterId} INSERT INTO order_detail( code, order_master_id, order_master_code, customer_id, order_type, order_status, worker_id, rev_time, remark, handover_images, handover_remark, confirm_start_time, delay_count, return_reason, return_reason_detail, return_images, worker_remark, share_account_countdown_end_time, share_account_countdown_duration, expect_time_start, expect_time_end, work_begin_time, work_finish_time, create_by, create_time )VALUES( #{code}, #{orderMasterId}, #{orderMasterCode}, #{customerId}, #{orderType}, #{orderStatus}, #{workerId}, #{revTime}, #{remark}, #{handoverImages}, #{handoverRemark}, #{confirmStartTime}, #{delayCount}, #{returnReason}, #{returnReasonDetail}, #{returnImages}, #{workerRemark}, #{shareAccountCountdownEndTime}, #{shareAccountCountdownDuration}, #{expectTimeStart}, #{expectTimeEnd}, #{workBeginTime}, #{workFinishTime}, #{createBy}, SYSDATE() ) UPDATE order_detail SET draw_cash_id = #{drawCashId}, draw_cash_time = #{drawCashTime}, arrival_time = #{arrivalTime}, draw_cash_status = #{drawCashStatus}, update_time = NOW() WHERE draw_cash_id = #{drawCashId}