SELECT id,
dept_id,
code,
customer_id,
address_id,
order_type,
order_status,
pay_type,
pay_status,
worker_id,
pay_time,
rev_time,
expect_time_start,
expect_time_end,
create_by,
create_time,
remark,
all_self_assigned
FROM order_master
SELECT om.id,
om.dept_id,
om.code,
om.customer_id,
om.address_id,
om.order_type,
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.remark,
om.all_self_assigned,
om.goods_id
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
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},
update_time = SYSDATE()
WHERE id = #{id}
UPDATE order_master
SET order_status = #{orderStatus},
update_time = SYSDATE()
WHERE id = #{orderMasterId}
INSERT INTO order_master(
dept_id,
code,
customer_id,
address_id,
goods_id,
order_type,
order_status,
pay_type,
pay_status,
worker_id,
pay_time,
rev_time,
remark,
expect_time_start,
expect_time_end,
create_by,
create_time
)VALUES(
#{deptId},
#{code},
#{customerId},
#{addressId},
#{goodsId},
#{orderType},
#{orderStatus},
#{payType},
#{payStatus},
#{workerId},
#{payTime},
#{revTime},
#{remark},
#{expectTimeStart},
#{expectTimeEnd},
#{createBy},
SYSDATE()
)