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 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
|
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>
|
||||||
|
|
||||||
<select id="stockSelect" parameterType="Map" resultType="Map">
|
<select id="stockSelect" parameterType="Map" resultType="Map">
|
||||||
@@ -55,8 +55,8 @@
|
|||||||
|
|
||||||
<where>
|
<where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="searchn == 0"> o.id IS NULL and p.activation = 1 and p.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 w.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>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
order by p.name desc limit #{start}, #{perPage}
|
order by p.name desc limit #{start}, #{perPage}
|
||||||
@@ -71,8 +71,8 @@
|
|||||||
|
|
||||||
<where>
|
<where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="searchn == 0"> o.id IS NULL and p.activation = 1 and p.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 w.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>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
p.company_name,
|
p.company_name,
|
||||||
w.address,
|
w.address,
|
||||||
w.capacity,
|
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
|
from stock s
|
||||||
left join warehouse w on s.warehouse_id = w.id
|
left join warehouse w on s.warehouse_id = w.id
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
SELECT w.id,
|
SELECT w.id,
|
||||||
w.name,
|
w.name,
|
||||||
w.capacity,
|
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
|
FROM warehouse w
|
||||||
|
|
||||||
<where>
|
<where>
|
||||||
@@ -33,11 +33,11 @@
|
|||||||
<when test="searchn == 2"> w.activation = 1 and w.current_capacity like concat('%',#{search},'%')</when>
|
<when test="searchn == 2"> w.activation = 1 and w.current_capacity like concat('%',#{search},'%')</when>
|
||||||
</choose>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
order by w.name ASC limit #{start}, #{perPage}
|
order by w.name deSC limit #{start}, #{perPage}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="One" parameterType="String" resultType="com.no1.wms.warehouse.WarehouseDto">
|
<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
|
from warehouse w
|
||||||
|
|
||||||
@@ -53,8 +53,8 @@
|
|||||||
|
|
||||||
<where>
|
<where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="searchn == 0"> w.id = #{id} and w.activation = 1 and p.name 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.quantity 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>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
|
|
||||||
@@ -71,8 +71,8 @@
|
|||||||
|
|
||||||
<where>
|
<where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="searchn == 0"> w.id = #{id} and w.activation = 1 and p.name 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.quantity 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>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user