From 4c5af84c8d4c0d5249fdfb4bbc1031f3689a9002 Mon Sep 17 00:00:00 2001
From: hyingbo <1363390067@qq.com>
Date: 星期一, 04 八月 2025 11:42:07 +0800
Subject: [PATCH] 启封审批设置审批类型

---
 lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/xml/ToolLedgerDetailMapper.xml |  190 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 190 insertions(+), 0 deletions(-)

diff --git a/lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/xml/ToolLedgerDetailMapper.xml b/lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/xml/ToolLedgerDetailMapper.xml
index 6cc0837..78cb6cf 100644
--- a/lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/xml/ToolLedgerDetailMapper.xml
+++ b/lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/xml/ToolLedgerDetailMapper.xml
@@ -2,4 +2,194 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.tms.mapper.ToolLedgerDetailMapper">
 
+    <select id="queryPageList" resultType="org.jeecg.modules.tms.entity.ToolLedgerDetail">
+        SELECT
+            t.id,
+            t.id toolLedgerDetailId,
+            t.tool_code toolCode,
+            p.tool_code toolNum,
+            t.tool_id toolId,
+            p.chinese_name toolName,
+            p.tool_model toolModel,
+            t.quantity,
+            t.warehouse_id warehouseId,
+            ISNULL(q.warehouse_id, '') + '/' + ISNULL(q.warehouse_name, '') warehouseName,
+            t.position_code positionCode
+        FROM tms_tool_ledger_detail t
+        LEFT JOIN tms_base_tools p on t.tool_code = p.id
+        LEFT JOIN tms_warehouse q on t.warehouse_id = q.id
+        ${ew.customSqlSegment}
+    </select>
+
+    <!--<select id="queryToolByStatus"  resultType="map" parameterType="String">
+        SELECT
+            t.id,
+            t.tool_code toolCodeId,
+            p.tool_code toolCode,
+            t.tool_id onlyCode,
+            p.chinese_name chineseName,
+            p.accuracy_class accuracyClass,
+            p.tool_model toolModel,
+            t.quantity,
+            t.warehouse_id warehouseId,
+            ISNULL(q.warehouse_id, '') + '/' + ISNULL(q.warehouse_name, '') warehouseName,
+            t.position_code positionCode,
+            t2.item_text applicationTypeName
+        FROM tms_tool_ledger_detail t
+                 LEFT JOIN tms_base_tools p on t.tool_code = p.id
+                 LEFT JOIN tms_warehouse q on t.warehouse_id = q.id
+                 left join tms_tools_config_property t1 on t1.tool_code = p.id
+                 left join (select * from v_sys_dict where dict_code = 'application_type') t2 on t2.item_value = t1.application_type
+            ${ew.customSqlSegment}
+    </select>-->
+
+    <select id="queryLendTool"  resultType="map" parameterType="String">
+        SELECT
+            temp.id,
+            temp.toolCodeId,
+            temp.toolCode,
+            temp.onlyCode,
+            temp.chineseName,
+            temp.accuracyClass,
+            temp.toolModel,
+            temp.quantity,
+            temp.warehouseId,
+            temp.warehouseName,
+            temp.positionCode,
+            temp.applicationTypeName
+        FROM
+            (
+                SELECT
+                    t.id,
+                    t.tool_code toolCodeId,
+                    p.tool_code toolCode,
+                    t.tool_id onlyCode,
+                    p.chinese_name chineseName,
+                    p.accuracy_class accuracyClass,
+                    p.tool_model toolModel,
+                    1 quantity,
+                    t.warehouse_id warehouseId,
+                    ISNULL( q.warehouse_id, '' ) + '/' + ISNULL( q.warehouse_name, '' ) warehouseName,
+                    t.position_code positionCode,
+                    t2.item_text applicationTypeName
+                FROM
+                    tms_tool_ledger_detail t
+                        LEFT JOIN tms_base_tools p ON t.tool_code = p.id
+                        LEFT JOIN tms_warehouse q ON t.warehouse_id = q.id
+                        LEFT JOIN tms_tools_config_property t1 ON t1.tool_code = p.id
+                        LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'application_type' ) t2 ON t2.item_value = t1.application_type
+                        ${ew.customSqlSegment}
+                    UNION ALL
+                    (
+                    SELECT
+                        t.id,
+                        t.tool_code toolCodeId,
+                        p.tool_code toolCode,
+                        t.tool_id onlyCode,
+                        p.chinese_name chineseName,
+                        p.accuracy_class accuracyClass,
+                        p.tool_model toolModel,
+                        t3.lend_count quantity,
+                        t.warehouse_id warehouseId,
+                        ISNULL( q.warehouse_id, '' ) + '/' + ISNULL( q.warehouse_name, '' ) warehouseName,
+                        t.position_code positionCode,
+                        t2.item_text applicationTypeName
+                    FROM
+                        tms_tool_ledger_detail t
+                            LEFT JOIN tms_tool_ledger t3 ON t3.tool_id = t.tool_code
+                            LEFT JOIN tms_base_tools p ON t.tool_code = p.id
+                            LEFT JOIN tms_warehouse q ON t.warehouse_id = q.id
+                            LEFT JOIN tms_tools_config_property t1 ON t1.tool_code = p.id
+                            LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'application_type' ) t2 ON t2.item_value = t1.application_type
+                            WHERE
+                        p.accuracy_class != 1
+			AND t3.lend_count != 0
+                )
+            ) temp
+    </select>
+
+    <select id="querySharpenTool"  resultType="map" parameterType="String">
+        SELECT
+            temp.id,
+            temp.toolCodeId,
+            temp.toolCode,
+            temp.onlyCode,
+            temp.chineseName,
+            temp.accuracyClass,
+            temp.toolModel,
+            temp.quantity,
+            temp.warehouseId,
+            temp.warehouseName,
+            temp.positionCode,
+            temp.applicationTypeName
+        FROM
+            (
+                SELECT
+                    t.id,
+                    t.tool_code toolCodeId,
+                    p.tool_code toolCode,
+                    t.tool_id onlyCode,
+                    p.chinese_name chineseName,
+                    p.accuracy_class accuracyClass,
+                    p.tool_model toolModel,
+                    1 quantity,
+                    t.warehouse_id warehouseId,
+                    ISNULL( q.warehouse_id, '' ) + '/' + ISNULL( q.warehouse_name, '' ) warehouseName,
+                    t.position_code positionCode,
+                    t2.item_text applicationTypeName
+                FROM
+                    tms_tool_ledger_detail t
+                        LEFT JOIN tms_base_tools p ON t.tool_code = p.id
+                        LEFT JOIN tms_warehouse q ON t.warehouse_id = q.id
+                        LEFT JOIN tms_tools_config_property t1 ON t1.tool_code = p.id
+                        LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'application_type' ) t2 ON t2.item_value = t1.application_type
+                    ${ew.customSqlSegment}
+                UNION ALL
+                (
+                SELECT
+                    t.id,
+                    t.tool_code toolCodeId,
+                    p.tool_code toolCode,
+                    t.tool_id onlyCode,
+                    p.chinese_name chineseName,
+                    p.accuracy_class accuracyClass,
+                    p.tool_model toolModel,
+                    t3.sharpening_count quantity,
+                    t.warehouse_id warehouseId,
+                    ISNULL( q.warehouse_id, '' ) + '/' + ISNULL( q.warehouse_name, '' ) warehouseName,
+                    t.position_code positionCode,
+                    t2.item_text applicationTypeName
+                FROM
+                    tms_tool_ledger_detail t
+                    LEFT JOIN tms_tool_ledger t3 ON t3.tool_id = t.tool_code
+                    LEFT JOIN tms_base_tools p ON t.tool_code = p.id
+                    LEFT JOIN tms_warehouse q ON t.warehouse_id = q.id
+                    LEFT JOIN tms_tools_config_property t1 ON t1.tool_code = p.id
+                    LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'application_type' ) t2 ON t2.item_value = t1.application_type
+                WHERE
+                    p.accuracy_class != 1
+                  AND t3.sharpening_count != 0
+                    )
+            ) temp
+    </select>
+    <select id="queryToolLedgerDetailList"  resultType="map" parameterType="String">
+        SELECT
+            t1.id,
+            t1.tool_code toolCodeId,
+            t2.tool_code toolCode,
+            t1.tool_id onlyCode,
+            t2.chinese_name chineseName,
+            t2.tool_model toolModel,
+            t1.quantity,
+            t1.warehouse_id warehouseId,
+            ISNULL(t3.warehouse_id, '') + '/' + ISNULL(t3.warehouse_name, '') warehouseName,
+            t1.position_code positionCode,
+            t5.item_text applicationType
+        FROM tms_tool_ledger_detail t1
+                 LEFT JOIN tms_base_tools t2 on t1.tool_code = t2.id
+                 LEFT JOIN tms_warehouse t3 on t1.warehouse_id = t3.id
+                 left join tms_tools_config_property t4 on t4.tool_code = t2.id
+                 left join (select * from v_sys_dict where dict_code ='application_type') t5 on t5.item_value = t4.application_type
+            ${ew.customSqlSegment}
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3