| | |
| | | <result property="validFlag" column="valid_flag" typeHandler="com.nanometer.smartlab.entity.handler.ValidFlagHandler"></result> |
| | | <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"> |
| | |
| | | where su.valid_flag = 1 |
| | | <include refid="queryWhereSql"/> |
| | | </select> |
| | | |
| | | |
| | | <select id="getAllSysWarehouseList" resultMap="SysWarehouse"> |
| | | select * from sys_warehouse |
| | | where valid_flag = 1 |
| | |
| | | </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) |
| | | values (#{id}, #{type}, #{name}, #{infoCode}, #{barCode}, #{location1}, #{location2}, 1, now(), now()) |
| | | 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> |
| | | |
| | | <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() |
| | | update_time=now(),department=#{department} |
| | | ,temperature_max = #{temperatureMax} |
| | | ,temperature_min = #{temperatureMin} |
| | | ,humidity_max = #{humidityMax} |
| | | ,humidity_min = #{humidityMin} |
| | | where id=#{id} |
| | | </update> |
| | | |
| | |
| | | select * from sys_warehouse |
| | | where bar_code = #{barCode} |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <select id="selectWarehouse" resultMap="SysWarehouseDto"> |
| | | SELECT |
| | | sw.id, |
| | |
| | | where sw.valid_flag = 1 |
| | | AND swc.valid_flag = 1 |
| | | </select> |
| | | <select id="selectAllWarehouse" resultType="java.util.Map"> |
| | | select |
| | | sw.id, |
| | | sw.type, |
| | | bm.meta_value typeName, |
| | | sw.name, |
| | | sw.info_code infoCode, |
| | | sw.bar_code barCode, |
| | | sw.location1, |
| | | sw.location2, |
| | | date_format(sw.create_time,'%Y-%m-%d %H:%i:%S') createTime, |
| | | sw.department |
| | | from sys_warehouse as sw |
| | | left join base_meta bm on bm.id = sw.type |
| | | where sw.valid_flag = 1 |
| | | </select> |
| | | </mapper> |