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, clock_in_location, create_by, create_time, update_time, remark 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.clock_in_location, od.create_by, od.create_time, od.remark 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 DELETE FROM order_detail WHERE id IN #{orderDetailId} 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}, work_begin_time = #{workBeginTime}, work_finish_time = #{workFinishTime}, clock_in_location = #{clockInLocation}, remark = #{remark}, update_by = #{updateBy}, update_time = SYSDATE() WHERE id = #{id} UPDATE order_detail SET order_status = #{orderStatus}, 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, 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}, #{expectTimeStart}, #{expectTimeEnd}, #{workBeginTime}, #{workFinishTime}, #{createBy}, SYSDATE() )