mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 19:54:00 +09:00
#update
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
left join warehouse w on o.warehouse_id = w.id
|
||||
left join stock s on o.product_id = s.product_id and o.warehouse_id = s.warehouse_id
|
||||
|
||||
where o.id = #{id}
|
||||
where o.id = #{id} and s.activation = 1
|
||||
</select>
|
||||
|
||||
<select id="stockSelect" parameterType="Map" resultType="Map">
|
||||
@@ -55,8 +55,8 @@
|
||||
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 0"> o.id IS NULL and p.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> o.id IS NULL and p.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 0"> o.id IS NULL and p.activation = 1 and s.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> o.id IS NULL and p.activation = 1 and s.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
||||
</choose>
|
||||
</where>
|
||||
order by p.name desc limit #{start}, #{perPage}
|
||||
@@ -71,8 +71,8 @@
|
||||
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 0"> o.id IS NULL and p.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> o.id IS NULL and p.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 0"> o.id IS NULL and p.activation = 1 and s.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> o.id IS NULL and p.activation = 1 and s.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
||||
</choose>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
p.company_name,
|
||||
w.address,
|
||||
w.capacity,
|
||||
(SELECT SUM(s.quantity) FROM stock s WHERE s.warehouse_id = w.id) AS current_capacity
|
||||
(SELECT SUM(s.quantity) FROM stock s WHERE s.warehouse_id = w.id and s.activation = 1) AS current_capacity
|
||||
|
||||
from stock s
|
||||
left join warehouse w on s.warehouse_id = w.id
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
SELECT w.id,
|
||||
w.name,
|
||||
w.capacity,
|
||||
(SELECT SUM(s.quantity) FROM stock s WHERE s.warehouse_id = w.id) AS current_capacity
|
||||
(SELECT SUM(s.quantity) FROM stock s WHERE s.warehouse_id = w.id and s.activation = 1) AS current_capacity
|
||||
FROM warehouse w
|
||||
|
||||
<where>
|
||||
@@ -33,11 +33,11 @@
|
||||
<when test="searchn == 2"> w.activation = 1 and w.current_capacity like concat('%',#{search},'%')</when>
|
||||
</choose>
|
||||
</where>
|
||||
order by w.name ASC limit #{start}, #{perPage}
|
||||
order by w.name deSC limit #{start}, #{perPage}
|
||||
</select>
|
||||
|
||||
<select id="One" parameterType="String" resultType="com.no1.wms.warehouse.WarehouseDto">
|
||||
select w.id, w.name, w.capacity, (SELECT SUM(s.quantity) FROM stock s WHERE s.warehouse_id = w.id) AS current_capacity, w.address
|
||||
select w.id, w.name, w.capacity, (SELECT SUM(s.quantity) FROM stock s WHERE s.warehouse_id = w.id and s.activation = 1) AS current_capacity, w.address
|
||||
|
||||
from warehouse w
|
||||
|
||||
@@ -53,8 +53,8 @@
|
||||
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 0"> w.id = #{id} and w.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> w.id = #{id} and w.activation = 1 and s.quantity like concat('%',#{search},'%') </when>
|
||||
<when test="searchn == 0"> w.id = #{id} and w.activation = 1 and s.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> w.id = #{id} and w.activation = 1 and s.activation = 1 and s.quantity like concat('%',#{search},'%') </when>
|
||||
</choose>
|
||||
</where>
|
||||
|
||||
@@ -71,8 +71,8 @@
|
||||
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 0"> w.id = #{id} and w.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> w.id = #{id} and w.activation = 1 and s.quantity like concat('%',#{search},'%') </when>
|
||||
<when test="searchn == 0"> w.id = #{id} and w.activation = 1 and s.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> w.id = #{id} and w.activation = 1 and s.activation = 1 and s.quantity like concat('%',#{search},'%') </when>
|
||||
</choose>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user