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, 13 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/nanometer/smartlab/dao/SysWarehouseDao.xml b/src/main/java/com/nanometer/smartlab/dao/SysWarehouseDao.xml
index 8595882..ef55afc 100644
--- a/src/main/java/com/nanometer/smartlab/dao/SysWarehouseDao.xml
+++ b/src/main/java/com/nanometer/smartlab/dao/SysWarehouseDao.xml
@@ -13,6 +13,10 @@
<result property="createTime" column="create_time"></result>
<result property="updateTime" column="update_time"></result>
<result property="department" column="department"></result>
+ <result property="temperatureMax" column="temperature_max"></result>
+ <result property="temperatureMin" column="temperature_min"></result>
+ <result property="humidityMax" column="humidity_max"></result>
+ <result property="humidityMin" column="humidity_min"></result>
</resultMap>
<resultMap id="SysWarehouseDto" type="com.nanometer.smartlab.entity.dto.SysWarehouseDto">
@@ -51,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>
@@ -78,14 +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)
- values (#{id}, #{type}, #{name}, #{infoCode}, #{barCode}, #{location1}, #{location2}, 1, now(), now(),#{department})
+ <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}
+ ,temperature_max = #{temperatureMax}
+ ,temperature_min = #{temperatureMin}
+ ,humidity_max = #{humidityMax}
+ ,humidity_min = #{humidityMin}
where id=#{id}
</update>
@@ -97,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