From 47a751cb301d05276ae5d75145d57b2d090fe4e1 Mon Sep 17 00:00:00 2001
From: kongzy <kongzy>
Date: Mon, 01 Jul 2024 10:58:35 +0800
Subject: [PATCH] change
---
src/main/java/com/nanometer/smartlab/dao/SysWarehouseDao.xml | 18 +++++-------------
1 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/src/main/java/com/nanometer/smartlab/dao/SysWarehouseDao.xml b/src/main/java/com/nanometer/smartlab/dao/SysWarehouseDao.xml
index 7cab815..ef55afc 100644
--- a/src/main/java/com/nanometer/smartlab/dao/SysWarehouseDao.xml
+++ b/src/main/java/com/nanometer/smartlab/dao/SysWarehouseDao.xml
@@ -55,7 +55,7 @@
</if>
</sql>
- <select id="getSysWarehouse" parameterType="java.lang.String" resultMap="SysWarehouse" >
+ <select id="getSysWarehouse" resultMap="SysWarehouse" >
select * from sys_warehouse
where id = #{id} and valid_flag = 1
</select>
@@ -82,26 +82,18 @@
order by name asc
</select>
- <insert id="insertSysWarehouse" parameterType="com.nanometer.smartlab.entity.SysWarehouse">
- insert into sys_warehouse(id, type, name, info_code, bar_code, location1, location2, valid_flag, create_time, update_time,department,temperature_max,temperature_min,humidity_max,humidity_min)
- values (#{id}, #{type}, #{name}, #{infoCode}, #{barCode}, #{location1}, #{location2}, 1, now(), now(),#{department},#{temperatureMax},#{temperatureMin},#{humidityMax},#{humidityMin})
+ <insert id="insertSysWarehouse" parameterType="com.nanometer.smartlab.entity.SysWarehouse" useGeneratedKeys = "true" keyProperty = "id">
+ insert into sys_warehouse( type, name, info_code, bar_code, location1, location2, valid_flag, create_time, update_time,department,temperature_max,temperature_min,humidity_max,humidity_min)
+ values ( #{type}, #{name}, #{infoCode}, #{barCode}, #{location1}, #{location2}, 1, now(), now(),#{department},#{temperatureMax},#{temperatureMin},#{humidityMax},#{humidityMin})
</insert>
<update id="updateSysWarehouse" parameterType="com.nanometer.smartlab.entity.SysWarehouse">
update sys_warehouse set type=#{type}, name=#{name}, info_code=#{infoCode}, bar_code=#{barCode}, location1=#{location1}, location2=#{location2},
update_time=now(),department=#{department}
- <if test="temperatureMax != null and temperatureMax != ''">
,temperature_max = #{temperatureMax}
- </if>
- <if test="temperatureMin != null and temperatureMin != ''">
,temperature_min = #{temperatureMin}
- </if>
- <if test="humidityMax != null and humidityMax != ''">
,humidity_max = #{humidityMax}
- </if>
- <if test="humidityMin != null and humidityMin != ''">
,humidity_min = #{humidityMin}
- </if>
where id=#{id}
</update>
@@ -113,7 +105,7 @@
</foreach>
</update>
- <select id="getSysWarehouseByBarCode" parameterType="java.lang.String" resultMap="SysWarehouse" >
+ <select id="getSysWarehouseByBarCode" resultMap="SysWarehouse" >
select * from sys_warehouse
where bar_code = #{barCode}
</select>
--
Gitblit v1.9.2