From bcd4c6fc21eef7abf7e28661bd4f9e1f5cdd2a61 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期一, 09 十二月 2024 16:37:29 +0800
Subject: [PATCH] 补片新增修改会出现重复编号的问题

---
 north-glass-erp/src/main/resources/mapper/mm/MaterialStore.xml |   88 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 88 insertions(+), 0 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/mm/MaterialStore.xml b/north-glass-erp/src/main/resources/mapper/mm/MaterialStore.xml
new file mode 100644
index 0000000..42b8df8
--- /dev/null
+++ b/north-glass-erp/src/main/resources/mapper/mm/MaterialStore.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.example.erp.mapper.mm.MaterialStoreMapper">
+
+    <select id="getSelectMaterialStore">
+        select
+        *
+        from
+        mm.material_store m
+        <where>
+            <if test="materialStore.id != null and materialStore.id != ''">
+                and m.id regexp #{materialStore.id}
+            </if>
+            <if test="materialStore.type != null and materialStore.type != ''">
+                and m.type regexp #{materialStore.type}
+            </if>
+        </where>
+        order by m.id desc
+        limit #{offset},#{pageSize};
+    </select>
+
+    <select id="getSelectMaterialStores">
+        select
+        *
+        from
+        mm.material_store m
+        <where>
+            <if test="materialStore.id != null and materialStore.id != ''">
+                and m.id regexp #{materialStore.id}
+            </if>
+            <if test="materialStore.type != null and materialStore.type != ''">
+                and m.type regexp #{materialStore.type}
+            </if>
+        </where>
+        order by m.id desc
+    </select>
+
+    <select id="getSelectMaterialStoreById">
+        select * from mm.material_store m where id=#{id}
+    </select>
+
+    <select id="getSelectMaterialStorePageTotal">
+        select
+        CEILING(count(id)/#{pageSize}) as 'pageTotal',
+        count(id) as 'total'
+        from
+        mm.material_store m
+        <where>
+            <if test="materialStore.id != null and materialStore.id != ''">
+                and m.id regexp #{materialStore.id}
+            </if>
+            <if test="materialStore.type != null and materialStore.type != ''">
+                and m.type regexp #{materialStore.type}
+            </if>
+        </where>
+        limit #{offset},#{pageSize};
+    </select>
+
+    <insert id="insertMaterialStore"  useGeneratedKeys="true"  >
+        insert into mm.material_store (type,json,create_time
+        )
+        values (
+                   #{type},#{json},now()
+               )
+    </insert>
+
+    <update id="updateMaterialStore" >
+        update mm.material_store set json=#{json} where id=#{id}
+    </update>
+
+    <delete id="deleteMaterialStore" >
+        delete from mm.material_store where id=#{id}
+    </delete>
+
+    <select id="selectMaterialStore" >
+        select count(*) from mm.material_inventory where material_code=#{id}
+    </select>
+
+    <select id="selectMaterialStoreJson" >
+        select count(*) from mm.material_store where json=#{json}
+    </select>
+
+
+
+
+</mapper>
\ No newline at end of file

--
Gitblit v1.8.0