From 8b1d6e1b442c1909bd747805bd1845b40caabe0c Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: 星期四, 06 三月 2025 09:03:59 +0800
Subject: [PATCH] data

---
 hazmat-system/src/main/resources/mapper/system/HzWarehouseMapper.xml |   79 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 79 insertions(+), 0 deletions(-)

diff --git a/hazmat-system/src/main/resources/mapper/system/HzWarehouseMapper.xml b/hazmat-system/src/main/resources/mapper/system/HzWarehouseMapper.xml
index c22f98e..3ce1a83 100644
--- a/hazmat-system/src/main/resources/mapper/system/HzWarehouseMapper.xml
+++ b/hazmat-system/src/main/resources/mapper/system/HzWarehouseMapper.xml
@@ -22,9 +22,46 @@
         from hz_warehouse a
         left join sys_company b on b.id=a.company_id
     </sql>
+    <insert id="insertCupboard">
+        insert into hz_warehouse_cupboard
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="warehouseId != null">warehouse_id,</if>
+            <if test="cupboardName != null and cupboardName != ''">cupboard_name,</if>
+            <if test="mess != null and mess != ''">mess,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null and updateBy != ''">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="delFlag != null">del_flag,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="warehouseId != null">#{warehouseId},</if>
+            <if test="cupboardName != null and cupboardName != ''">#{cupboardName},</if>
+            <if test="mess != null and mess != ''">#{mess},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+        </trim>
+    </insert>
     <update id="deleteWarehouseById" parameterType="java.lang.Long">
         update hz_warehouse set del_flag=1 where id=#{warehouseId}
     </update>
+    <update id="updateCupboard">
+        update hz_warehouse_cupboard
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="cupboardName != null">cupboard_name = #{cupboardName},</if>
+            <if test="mess != null and mess != ''">mess = #{mess},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+        </trim>
+        where id = #{id}
+    </update>
+    <delete id="deleteByCupboardId">
+        delete from hz_warehouse_cupboard where id = #{cupboardId}
+    </delete>
 
     <select id="checkNameUnique" resultType="com.gkhy.hazmat.system.domain.HzWarehouse">
         select id,name from hz_warehouse where name=#{name} and company_id=#{companyId} and del_flag=0 limit 1
@@ -51,4 +88,46 @@
             #{warehouse}
         </foreach>
     </select>
+
+
+    <select id="selectByCupboardIds" resultType="com.gkhy.hazmat.system.domain.HzWarehouseCupboard">
+        select id,cupboard_name from hz_warehouse_cupboard where del_flag=0 and  id in
+        <foreach collection="ids" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </select>
+    <select id="selectByWarehouseIdAndCupboardName" resultType="com.gkhy.hazmat.system.domain.HzWarehouseCupboard">
+        SELECT
+            id,
+            warehouse_id,
+            cupboard_name,
+            mess,
+            create_by,
+            create_time,
+            update_by,
+            update_time,
+            del_flag
+        FROM
+            hz_warehouse_cupboard
+        WHERE
+            warehouse_id = #{id} and cupboard_name =#{cupboardName}
+          AND del_flag = 0
+    </select>
+    <select id="selectByWarehouseId" resultType="com.gkhy.hazmat.system.domain.HzWarehouseCupboard">
+        SELECT
+            id,
+            warehouse_id,
+            cupboard_name,
+            mess,
+            create_by,
+            create_time,
+            update_by,
+            update_time,
+            del_flag
+        FROM
+            hz_warehouse_cupboard
+        WHERE
+            warehouse_id = #{id}
+          AND del_flag = 0
+    </select>
 </mapper>

--
Gitblit v1.9.2