From b6576a4db959d2551e343a8bb0045aa67387aacc Mon Sep 17 00:00:00 2001 From: lyfO_o <764716047@qq.com> Date: 星期一, 28 二月 2022 13:12:44 +0800 Subject: [PATCH] 库房状态管理 --- src/main/java/com/nanometer/smartlab/dao/SysWarehouseStatusDao.xml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/nanometer/smartlab/dao/SysWarehouseStatusDao.xml b/src/main/java/com/nanometer/smartlab/dao/SysWarehouseStatusDao.xml index 099ff6c..e851ad8 100644 --- a/src/main/java/com/nanometer/smartlab/dao/SysWarehouseStatusDao.xml +++ b/src/main/java/com/nanometer/smartlab/dao/SysWarehouseStatusDao.xml @@ -2,6 +2,17 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.nanometer.smartlab.dao.SysWarehouseStatusDao"> <resultMap id="BaseMap" type="com.nanometer.smartlab.entity.SysWarehouseStatus"> + <id property="id" column="id"/> + <result property="name" column="name" /> + <result property="type" column="type"/> + <result property="temperature" column="temperature"/> + <result property="humidity" column="humidity"/> + <result property="creator" column="creator"/> + <result property="createTime" column="create_time"/> + <result property="validFlag" column="valid_flag"/> + <result property="warehouseId" column="warehouse_id"/> + <result property="warning" column="warning"/> + <result property="selectDate" column="select_date"/> </resultMap> <insert id="insertOne" parameterType="com.nanometer.smartlab.entity.SysWarehouseStatus"> @@ -10,5 +21,44 @@ values (#{type},#{name},#{temperature},#{humidity},#{creator},#{createTime},1,#{warehouseId},#{selectDate},#{warning}) </insert> + <select id="selectCount" resultType="java.lang.Integer"> + select count(0) + from sys_warehouse_status + <where> + <if test="params.name != null and params.name != ''"> + name = #{params.name} + </if> + <if test="params.startTime != null and params.startTime != ''"> + and select_date >= #{params.startTime} + </if> + <if test="params.endTime != null and params.endTime != ''"> + and select_date <= #{params.endTime} + </if> + </where> + </select> + + <select id="selectList" resultMap="BaseMap"> + select * + from sys_warehouse_status + <where> + <if test="params.name != null and params.name != ''"> + and name = #{params.name} + </if> + <if test="params.startTime != null and params.startTime != ''"> + and select_date >= #{params.startTime} + </if> + <if test="params.endTime != null and params.endTime != ''"> + and select_date <= #{params.endTime} + </if> + </where> + <if test="params.first != null and params.pageSize != null"> + limit #{params.first},#{params.pageSize} + </if> + </select> + <select id="selectById" resultType="com.nanometer.smartlab.entity.SysWarehouseStatus"> + select * + from sys_warehouse_status + where id = #{id} + </select> </mapper> -- Gitblit v1.9.2