select
id,
operation_type,
biz_type,
wl_type,
cangku,
operation_time,
operator,
is_chuku,
status,
exec_status,
remark,
bill_no,
xj,
xm_no,
xm_ms,
xm_no_ck,
xm_ms_ck,
wl_no,
wl_ms,
gys_no,
gys_mc,
jh_amt,
ht_dj,
sap_no,
xh,
jh_qty,
ht_qty,
dw,
real_qty,
pcode,
pcode_id,
tray_code,
entity_id,
team_code,
borrow_time,
return_time,
has_moved,
is_borrowed,
create_by,
create_time,
update_by,
update_time,
is_delete,
gys_jh_id,
rdid,
rdid_ck,
sid,
is_delivery,
fycde_1,
fycde_2,
is_update,
/* 新增库龄计算 */
DATEDIFF(CURRENT_DATE, operation_time) AS stock_age -- 库龄(天)
from rk_info
delete from rk_info where id = #{id}
delete from rk_info
where id in
#{item}
insert into rk_info (
operation_type, biz_type, wl_type, cangku, operation_time, operator,
is_chuku, status, exec_status, remark, bill_no,
xj, xm_no, xm_ms, xm_no_ck, xm_ms_ck,
wl_no, wl_ms,
gys_no, gys_mc,
jh_amt, ht_dj, sap_no, xh,
jh_qty, ht_qty, dw, real_qty,
pcode, pcode_id, tray_code, entity_id,
team_code, borrow_time, return_time,
has_moved, is_borrowed,
gys_jh_id,
rdid, rdid_ck, sid,
is_delivery,
fycde_1, fycde_2,
is_update,
create_by, create_time, is_delete
)
values (
#{operationType}, #{bizType}, #{wlType}, #{cangku}, #{operationTime}, #{operator},
#{isChuku}, #{status}, #{execStatus}, #{remark}, #{billNo},
#{xj}, #{xmNo}, #{xmMs}, #{xmNoCk}, #{xmMsCk},
#{wlNo}, #{wlMs},
#{gysNo}, #{gysMc},
#{jhAmt}, #{htDj}, #{sapNo}, #{xh},
#{jhQty}, #{htQty}, #{dw}, #{realQty},
#{pcode}, #{pcodeId}, #{trayCode}, #{entityId},
#{teamCode}, #{borrowTime}, #{returnTime},
#{hasMoved}, #{isBorrowed},
#{gysJhId},
#{rdid}, #{rdidCk}, #{sid},
#{isDelivery},
#{fycde1}, #{fycde2},
#{isUpdate},
#{createBy}, #{createTime}, #{isDelete}
)
update rk_info
operation_type = #{operationType},
biz_type = #{bizType},
wl_type = #{wlType},
cangku = #{cangku},
status = #{status},
exec_status = #{execStatus},
update_by = #{updateBy},
update_time = #{updateTime},
where id = #{id}