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,
timeout_,
timeout_fine_times
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.draw_cash_status,
od.timeout_,
od.timeout_fine_times
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},
update_by = #{updateBy},
ledger_account_status = #{ledgerAccountStatus},
timeout_ = #{timeout},
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
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()
)
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}