From 3067d24d5f5d20b5c69e626169227a07e1bf1f49 Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期三, 23 四月 2025 09:46:29 +0800
Subject: [PATCH] 提交 app质检审核查询部分代码
---
north-glass-erp/src/main/resources/mapper/pp/GlassOptimize.xml | 61 ++++++++++++++++++++++++++++++
1 files changed, 61 insertions(+), 0 deletions(-)
diff --git a/north-glass-erp/src/main/resources/mapper/pp/GlassOptimize.xml b/north-glass-erp/src/main/resources/mapper/pp/GlassOptimize.xml
index e26a46c..e449f52 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/GlassOptimize.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/GlassOptimize.xml
@@ -286,6 +286,67 @@
`i`.`available_quantity` DESC ;
</select>
+ <!--浣欐枡淇℃伅-->
+ <select id="surplusMaterialsMp">
+ SELECT
+ i.id AS id,
+ '' AS producer,
+ i.quantity AS available_quantity,
+ i.width,
+ i.height,
+ i.thickness,
+ i.colour AS name,
+ i.colour
+ FROM mm.surplus_materials as i
+ WHERE
+ i.quantity>0 and i.colour=#{model} and i.thickness=#{thickness}
+ ORDER BY
+ i.quantity DESC ;
+ </select>
+
+ <!--搴撳瓨浣欐枡淇℃伅-->
+ <select id="materialStoreSurplusMp">
+ (SELECT
+ i.id AS id,
+ i.producer AS producer,
+ i.available_quantity-i.plan_quantity AS available_quantity,
+ JSON_EXTRACT(s.json, '$.width') AS width,
+ JSON_EXTRACT(s.json, '$.height') AS height,
+ JSON_EXTRACT(s.json, '$.thickness') AS thickness,
+ JSON_EXTRACT(s.json, '$.name') AS name,
+ JSON_EXTRACT(s.json, '$.model') AS model
+ FROM mm.material_inventory as `i`
+ LEFT JOIN mm.material_store as s ON (
+ (
+ `i`.`material_code` = `s`.`id`
+ )
+ )
+ WHERE
+ (
+ (`s`.`type` = '鍘熺墖')
+ AND (`i`.`optimize_state` = 1)
+ AND (`i`.`available_quantity`-i.plan_quantity > 0)
+ AND JSON_EXTRACT(s.json, '$.thickness') = #{thickness}
+ AND JSON_EXTRACT(s.json, '$.model') = #{model}
+ )
+ ORDER BY
+ `i`.`available_quantity` DESC) union
+ (SELECT
+ i.id AS id,
+ '' AS producer,
+ i.quantity AS available_quantity,
+ i.width,
+ i.height,
+ i.thickness,
+ i.colour AS name,
+ i.colour
+ FROM mm.surplus_materials as i
+ WHERE
+ i.quantity>0 and i.colour=#{model} and i.thickness=#{thickness}
+ ORDER BY
+ i.quantity DESC );
+ </select>
+
<select id="materialStoreOptimizeUse">
select ms.id AS id,
--
Gitblit v1.8.0