and mod.order_id like '%' + #{order_id} + '%' and mod.brand like '%' + #{brand} + '%' and mod.maktx like '%' + #{maktx} + '%' and mod.batch like '%' + #{batch} + '%' update man_order_detl set qty = qty + #{qty} where 1=1 and order_id = #{orderId} and matnr = #{matnr} and batch = #{batch} and (batch IS NULL OR batch = '') update man_order_detl set work_qty = work_qty - #{qty} where 1=1 and order_no = #{orderNo} and matnr = #{matnr} and batch = #{batch} and (batch IS NULL OR batch = '') update man_order_detl set status = #{status} where 1=1 and order_id = #{orderId} INSERT INTO man_order_detl_log SELECT * FROM man_order_detl WHERE id = #{id} INSERT INTO man_order_detl(brand,batch,order_id,order_no,create_by,create_time,status,qty,anfme) VALUES ( #{item.brand}, #{item.batch}, #{item.orderId}, #{item.orderNo}, #{item.createBy}, #{item.createTime}, #{item.status}, #{item.qty}, #{item.anfme} ) update man_order_detl set qty = qty + #{qty} where 1=1 and order_no = #{orderNo} and model = #{matnr} and batch = #{batch} and (batch IS NULL OR batch = '') update man_order_detl set work_qty = work_qty + #{workQty} where 1=1 and order_id = #{orderId} and matnr = #{matnr} and batch = #{batch} and (batch IS NULL OR batch = '') update man_order_detl set work_qty = #{count} where 1=1 and order_no= #{orderNo} and brand = #{brand} update man_order_detl set qty = 1 where 1=1 and order_no = #{orderNo} and brand = #{brand}