From 35c4f5d4222bcf4226e6b7f247cc3745cba3ef4d Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Sat, 10 Apr 2021 08:57:46 +0800
Subject: [PATCH] 预警设备接口调整
---
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/animalheat/mapper/AnimalHeatMapper.xml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 58 insertions(+), 0 deletions(-)
diff --git a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/animalheat/mapper/AnimalHeatMapper.xml b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/animalheat/mapper/AnimalHeatMapper.xml
index 869e1af..ff9a139 100644
--- a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/animalheat/mapper/AnimalHeatMapper.xml
+++ b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/animalheat/mapper/AnimalHeatMapper.xml
@@ -48,6 +48,44 @@
<if test="animalHeatVo.begTime!=null and animalHeatVo.begTime!='' and animalHeatVo.endTime!=null and animalHeatVo.endTime!='' ">
and date(create_time) between #{animalHeatVo.begTime} and #{animalHeatVo.endTime}
</if>
+ <if test="animalHeatVo.timeDesc!=null and animalHeatVo.timeDesc!=''">
+ <if test="animalHeatVo.timeDesc=='0-2'">
+ and hour(create_time)>=0 and hour(create_time) <2
+ </if>
+ <if test="animalHeatVo.timeDesc=='2-4'">
+ and hour(create_time)>=2 and hour(create_time) <4
+ </if>
+ <if test="animalHeatVo.timeDesc=='4-6'">
+ and hour(create_time)>=4 and hour(create_time) <6
+ </if>
+ <if test="animalHeatVo.timeDesc=='6-8'">
+ and hour(create_time)>=6 and hour(create_time) <8
+ </if>
+ <if test="animalHeatVo.timeDesc=='8-10'">
+ and hour(create_time)>=8 and hour(create_time) <10
+ </if>
+ <if test="animalHeatVo.timeDesc=='10-12'">
+ and hour(create_time)>=10 and hour(create_time) <12
+ </if>
+ <if test="animalHeatVo.timeDesc=='12-14'">
+ and hour(create_time)>=12 and hour(create_time) <14
+ </if>
+ <if test="animalHeatVo.timeDesc=='14-16'">
+ and hour(create_time)>=14 and hour(create_time) <16
+ </if>
+ <if test="animalHeatVo.timeDesc=='16-18'">
+ and hour(create_time)>=16 and hour(create_time) <18
+ </if>
+ <if test="animalHeatVo.timeDesc=='18-20'">
+ and hour(create_time)>=18 and hour(create_time) <20
+ </if>
+ <if test="animalHeatVo.timeDesc=='20-22'">
+ and hour(create_time)>=20 and hour(create_time) <22
+ </if>
+ <if test="animalHeatVo.timeDesc=='22-24'">
+ and hour(create_time)>=22 and hour(create_time) <24
+ </if>
+ </if>
ORDER BY create_time desc
</select>
@@ -134,4 +172,24 @@
where status=1
and create_time between #{conditionVo.startTime} and #{conditionVo.endTime}
</select>
+
+ <!--统计时间段内体温异常人数数量数据-->
+ <select id="selectAnimalTimeData" resultType="java.lang.Integer">
+ select ifnull(count,0) count from
+ (
+ SELECT @date := DATE_ADD( @date, INTERVAL + 1 DAY ) days FROM
+ (
+ SELECT @date := DATE_ADD( #{conditionVo.startTime}, INTERVAL - 1 DAY ) FROM sys_date
+ ) time
+ WHERE to_days( @date ) < to_days( #{conditionVo.endTime} )
+ ) a
+ left join
+ (
+ select DATE_FORMAT(create_time,'%Y-%m-%d') as datetime, count(*) as count from blade_animal_heat
+ where status=1
+ group by DATE_FORMAT(create_time,'%Y-%m-%d')
+ ) b
+ on
+ a.days = b.datetime
+ </select>
</mapper>
--
Gitblit v1.9.3