This commit is contained in:
sungsu
2024-01-21 23:25:34 +09:00
parent 75b5155ee7
commit c4776ac8a2
22 changed files with 215 additions and 72 deletions

View File

@@ -119,6 +119,12 @@
set quantity = #{quantity}, expected_delivery_date = #{expected_delivery_date}, delivery_date = #{delivery_date}
where id = #{id};
</update>
<update id="stockQuantityUpdate" parameterType="com.no1.wms.out.ProductOutDto">
update stock
set quantity = quantity - #{quantity}
where product_id = #{product_id} and warehouse_id = #{warehouse_id};
</update>
<!-- update -->

View File

@@ -27,6 +27,7 @@
<when test="searchn == 0">s.activation = 1 and p.name like concat('%',#{search},'%')</when>
<when test="searchn == 1">s.activation = 1 and c.cls_Nm_4 like concat('%',#{search},'%')</when>
<when test="searchn == 2">s.activation = 1 and s.quantity like concat('%',#{search},'%')</when>
<when test="searchn == 3">s.activation = 1 and w.name like concat('%',#{search},'%')</when>
</choose>
</where>
</select>
@@ -44,6 +45,7 @@
<when test="searchn == 0">s.activation = 1 and p.name like concat('%',#{search},'%')</when>
<when test="searchn == 1">s.activation = 1 and c.cls_Nm_4 like concat('%',#{search},'%')</when>
<when test="searchn == 2">s.activation = 1 and s.quantity like concat('%',#{search},'%')</when>
<when test="searchn == 3">s.activation = 1 and w.name like concat('%',#{search},'%')</when>
</choose>
</where>
order by s.id desc limit #{start}, #{perPage}
@@ -62,6 +64,7 @@
<when test="searchn == 0"> quantity &lt;= 200 and s.activation = 1 and p.name like concat('%',#{search},'%')</when>
<when test="searchn == 1"> quantity &lt;= 200 and s.activation = 1 and c.cls_Nm_4 like concat('%',#{search},'%')</when>
<when test="searchn == 2"> quantity &lt;= 200 and s.activation = 1 and s.quantity like concat('%',#{search},'%')</when>
<when test="searchn == 3">s.activation = 1 and w.name like concat('%',#{search},'%')</when>
</choose>
</where>
</select>
@@ -79,13 +82,22 @@
<when test="searchn == 0"> quantity &lt;= 200 and s.activation = 1 and p.name like concat('%',#{search},'%')</when>
<when test="searchn == 1"> quantity &lt;= 200 and s.activation = 1 and c.cls_Nm_4 like concat('%',#{search},'%')</when>
<when test="searchn == 2"> quantity &lt;= 200 and s.activation = 1 and s.quantity like concat('%',#{search},'%')</when>
<when test="searchn == 3">s.activation = 1 and w.name like concat('%',#{search},'%')</when>
</choose>
</where>
order by s.id desc limit #{start}, #{perPage}
</select>
<select id="stockOne" parameterType="Map" resultType="Map">
select s.id as id, s.warehouse_id as warehouseId, s.product_id as productId, s.quantity, p.name as productName, p.kan_code, c.cls_nm_4, w.name as warehouseName, p.company_name, w.address, w.capacity, w.current_capacity
select s.id as id,
s.warehouse_id as warehouseId,
s.product_id as productId, s.quantity,
p.name as productName,
p.kan_code, c.cls_nm_4, w.name as warehouseName,
p.company_name,
w.address,
w.capacity,
(SELECT SUM(s.quantity) FROM stock s WHERE s.warehouse_id = w.id) AS current_capacity
from stock s
left join warehouse w on s.warehouse_id = w.id
@@ -125,7 +137,11 @@
</select>
<select id="warehouseSelect" parameterType="Map" resultType="Map">
select w.id as warehouseId, w.name as warehouseName, capacity, current_capacity ,address
select w.id as warehouseId,
w.name as warehouseName,
capacity,
(SELECT SUM(s.quantity) FROM stock s WHERE s.warehouse_id = w.id) AS current_capacity ,
address
from warehouse w
left join stock s on s.warehouse_id = w.id

View File

@@ -5,7 +5,7 @@
<mapper namespace="com.no1.wms.vendor.VendorMapper">
<select id="selectAll" resultType="VendorDto">
select
select id,
name,
president_name,
address,
@@ -14,7 +14,9 @@
president_telephone,
vendor_manager,
vendor_manager_telephone,
main_products
main_product,
manager_id,
activation
from vendor;
</select>
@@ -108,7 +110,12 @@
<!-- insert -->
<insert id="createVendor" parameterType="VendorDto">
insert into vendor (id, name, president_name, address, registration_number, email, president_telephone, vendor_manager, vendor_manager_telephone, main_product, manager_id, activation)
values (UUID(), #{name}, #{president_name}, #{address}, #{registration_number}, #{email}, #{president_telephone}, #{vendor_manager}, #{vendor_manager_telephone}, #{main_product}, #{manager_id}, #{activation})
values (UUID(), #{name}, #{president_name}, #{address}, #{registration_number}, #{email}, #{president_telephone}, #{vendor_manager}, #{vendor_manager_telephone}, #{main_product}, #{manager_id}, 1)
</insert>
<insert id="createProcess" parameterType="VendorDto">
insert into vendor (id, name, president_name, address, registration_number, email, president_telephone, vendor_manager, vendor_manager_telephone, main_product, manager_id, activation)
values (UUID(), #{name}, #{president_name}, #{address}, #{registration_number}, #{email}, #{president_telephone}, #{vendor_manager}, #{vendor_manager_telephone}, #{main_product}, #{manager_id}, 1)
</insert>
<!-- insert -->

View File

@@ -6,7 +6,7 @@
<select id="count" parameterType="map" resultType="java.lang.Integer">
select count(*)
select count(w.id)
from warehouse w
@@ -20,9 +20,11 @@
</select>
<select id="list" parameterType="map" resultType="com.no1.wms.warehouse.WarehouseDto">
select w.id, w.name, w.capacity, w.current_capacity as currentCapacity
from warehouse w
SELECT w.id,
w.name,
w.capacity,
(SELECT SUM(s.quantity) FROM stock s WHERE s.warehouse_id = w.id) AS current_capacity
FROM warehouse w
<where>
<choose>