From eb3440d7c0c7baef5e6fc888fd0076b1787643d9 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 07 Apr 2021 16:14:18 +0800
Subject: [PATCH] 预警时间分布接口新增

---
 blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/animalheat/mapper/AnimalHeatMapper.xml |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 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 5fea101..869e1af 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
@@ -42,7 +42,13 @@
         <if test="animalHeatVo.type==2">
             and date_format(create_time,'%Y%m') = date_format(now(),'%Y%m')
         </if>
-        ORDER BY create_time asc
+        <if test="animalHeatVo.status!=null">
+            and status=#{animalHeatVo.status}
+        </if>
+        <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>
+        ORDER BY create_time desc
     </select>
 
     <!--查询本周每天的体温数据(按礼拜一开始计算)-->
@@ -110,5 +116,22 @@
 	    ) b
 		 on
 		 a.click_date = b.datetime
+		 order by a.click_date asc
+    </select>
+
+    <!--查询当前时间段体温异常总次数-->
+    <select id="selAnimalTimeCount" resultType="java.lang.Integer">
+        select count(*) from blade_animal_heat
+        where status=1
+        <if test="conditionVo.startTime!=null and conditionVo.startTime!='' and conditionVo.endTime!=null and conditionVo.endTime!=''">
+            and create_time between #{conditionVo.startTime} and #{conditionVo.endTime}
+        </if>
+    </select>
+
+    <!--查询当前时间段区间时间体温异常次数-->
+    <select id="selAnimalTimeData" resultType="org.springblade.jfpt.animalheat.entity.BladeAnimalHeat">
+        select status,create_time from blade_animal_heat
+            where status=1
+        and create_time between #{conditionVo.startTime} and #{conditionVo.endTime}
     </select>
 </mapper>

--
Gitblit v1.9.3