From c3510da29a7974c6af7ff3de1ade3db429d6f848 Mon Sep 17 00:00:00 2001 From: 李宇 <986321569@qq.com> Date: 星期三, 18 八月 2021 14:27:59 +0800 Subject: [PATCH] 申购管理申请履历显示所有历史单据,提交时如有无效试剂耗材报错 --- src/main/java/com/nanometer/smartlab/dao/HazardousWasteMapper.xml | 52 +++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/nanometer/smartlab/dao/HazardousWasteMapper.xml b/src/main/java/com/nanometer/smartlab/dao/HazardousWasteMapper.xml index b6b49f4..b5a4509 100644 --- a/src/main/java/com/nanometer/smartlab/dao/HazardousWasteMapper.xml +++ b/src/main/java/com/nanometer/smartlab/dao/HazardousWasteMapper.xml @@ -226,17 +226,37 @@ updatetime = #{updatetime,jdbcType=TIMESTAMP} where id = #{id,jdbcType=BIGINT} </update> - <select id="setAllWasters" resultMap="BaseResultMap"> + <select id="setAllWasterCount" resultType="com.nanometer.smartlab.entity.HazardousWaste"> + select + sum(acid) as acid,sum(alkali) as alkali, sum(organic) as organic,sum(solid) as solid,sum(medical) as medical + from sys_hazardous_waste + <where> + 1 = 1 + <if test="starttime != null and starttime != ''"> + and create_time >= #{starttime} + </if> + <if test="endtime != null and endtime != ''"> + and create_time <= #{endtime} + </if> + <if test="status != null and status != ''"> + and status = #{status} + </if> + <if test="applyPerson != null and applyPerson != ''"> + and apply_person = #{applyPerson} + </if> + </where> + </select> + <select id="setAllWasters" resultMap="BaseResultMap"> select <include refid="Base_Column_List" /> from sys_hazardous_waste <where> 1 = 1 <if test="starttime != null and starttime != ''"> - and create_time > #{starttime} + and create_time >= #{starttime} </if> <if test="endtime != null and endtime != ''"> - and create_time < #{endtime} + and create_time <= #{endtime} </if> <if test="status != null and status != ''"> and status = #{status} @@ -255,10 +275,10 @@ <where> 1 = 1 <if test="startTime != null and startTime != ''"> - and create_time > #{startTime} + and create_time >= #{startTime} </if> <if test="endTime != null and endTime != ''"> - and create_time < #{endTime} + and create_time <= #{endTime} </if> <if test="status != null and status != ''"> and status = #{status} @@ -289,10 +309,10 @@ <where> 1 = 1 <if test="startTime != null and startTime != ''"> - and create_time > #{startTime} + and create_time >= #{startTime} </if> <if test="endTime != null and endTime != ''"> - and create_time < #{endTime} + and create_time <= #{endTime} </if> <if test="status != null and status != ''"> and status = #{status} @@ -319,10 +339,10 @@ <where> 1 = 1 <if test="startTime != null and startTime != ''"> - and create_time > #{startTime} + and create_time >= #{startTime} </if> <if test="endTime != null and endTime != ''"> - and create_time < #{endTime} + and create_time <= #{endTime} </if> <if test="status != null and status != ''"> and status = #{status} @@ -343,15 +363,16 @@ order by create_time desc </select> <select id="countStatistics" resultType="java.lang.Integer"> + select count(0) from( select count(0) from sys_hazardous_waste <where> 1 = 1 <if test="startTime != null and startTime != ''"> - and create_time > #{startTime} + and create_time >= #{startTime} </if> <if test="endTime != null and endTime != ''"> - and create_time < #{endTime} + and create_time <= #{endTime} </if> <if test="status != null and status != ''"> and status = #{status} @@ -367,6 +388,7 @@ </if> group by project,department,unit </where> + ) shw </select> <select id="selectStatistics" resultType="com.nanometer.smartlab.entity.HazardousWaste"> select @@ -376,10 +398,10 @@ <where> 1 = 1 <if test="startTime != null and startTime != ''"> - and create_time > #{startTime} + and create_time >= #{startTime} </if> <if test="endTime != null and endTime != ''"> - and create_time < #{endTime} + and create_time <= #{endTime} </if> <if test="status != null and status != ''"> and status = #{status} @@ -408,10 +430,10 @@ <where> 1 = 1 <if test="startTime != null and startTime != ''"> - and create_time > #{startTime} + and create_time >= #{startTime} </if> <if test="endTime != null and endTime != ''"> - and create_time < #{endTime} + and create_time <= #{endTime} </if> <if test="status != null and status != ''"> and status = #{status} -- Gitblit v1.9.2