From 8475b3a408eeff9b293a842628b4b074aa4d40fe Mon Sep 17 00:00:00 2001 From: Suh Date: Wed, 17 Jan 2024 15:50:12 +0900 Subject: [PATCH] =?UTF-8?q?planinMapper=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mappers/PlainInMapper.xml | 115 +++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 src/main/resources/mappers/PlainInMapper.xml diff --git a/src/main/resources/mappers/PlainInMapper.xml b/src/main/resources/mappers/PlainInMapper.xml new file mode 100644 index 0000000..543b18a --- /dev/null +++ b/src/main/resources/mappers/PlainInMapper.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into plan_In + ( + group_number, product_id, quantity, date, + vendor_id, manager_id, warehouse_id, qr_hash, + url, clear, vendor_date, other, activation, view_group_number + ) + VALUES + ( + UUID(), #{productId}, #{quantity}, + #{date}, #{vendorId}, + #{managerId},#{warehouseId},#{qrHash}, + #{url},#{clear}, #{vendor_date}, + #{other},#{activation}, (select MAX(c.group_number)+1 as cnt + from ( select group_number,MAX(group_number) from plan_In group by group_number ) as c) + ) + + + + + update plan_In SET + quantity = #{quantity}, + date = #{date}, + vendor_id = #{vendorId}, + manager_id = #{managerId}, + warehouse_id = #{warehouseId}, + qr_hash = #{qrHash}, + url = #{url}, + clear = #{clear}, + vendor_date = #{vendorDate}, + other = #{other}, + activation = #{activation}, + product_id = #{productId} + WHERE group_number = #{groupNumber} and product_id = #{oldProductId} + + + update plan_In SET activation = false WHERE group_number = #{groupNumber} + + + update plan_In SET activation = false WHERE group_number = #{groupNumber} and product_id = #{productId} + + + \ No newline at end of file