From 54c0125835e850b97793601ac45ee62fa1c4b12e Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Fri, 27 Oct 2023 09:36:24 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wb' into qa
---
screen-api/src/main/resources/mapper/HistorySecondCruiserMapper.xml | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/screen-api/src/main/resources/mapper/HistorySecondCruiserMapper.xml b/screen-api/src/main/resources/mapper/HistorySecondCruiserMapper.xml
index 441d95e..d44f659 100644
--- a/screen-api/src/main/resources/mapper/HistorySecondCruiserMapper.xml
+++ b/screen-api/src/main/resources/mapper/HistorySecondCruiserMapper.xml
@@ -38,7 +38,15 @@
WHERE mac = #{mac}
AND `time` <![CDATA[>=]]> #{time1}
AND `time` <![CDATA[<=]]> #{time2}
- AND organization_id = #{orgId}
+ <if test="orgId !=null and orgId != 0">
+ AND organization_id = #{orgId}
+ </if>
+ <if test="orgIds != null and orgIds.size !=0">
+ and organization_id in
+ <foreach collection="orgIds" item="id" index="index" open="(" close=")" separator=",">
+ #{id}
+ </foreach>
+ </if>
order by time
</select>
@@ -50,8 +58,8 @@
AND `time` <![CDATA[<=]]> #{time2}
</select>
- <select id="getDust" resultType="java.lang.Double">
- select JSON_EXTRACT(value,'$.dustld')
+ <select id="getDust" resultType="java.lang.String">
+ select value ->>'$.dustld'
from `history_second_cruiser`
WHERE mac = #{mac}
AND `time` <![CDATA[>=]]> #{start}
@@ -67,4 +75,15 @@
AND `time` <![CDATA[>=]]> #{time1}
AND `time` <![CDATA[<=]]> #{time2}
</select>
+
+
+ <select id="getDusts" resultType="java.util.Map">
+ SELECT
+ value ->>'$.flylat' as flyLat,value ->>'$.flylon' as flyLon,value ->>'$.dustld' as dustld,
+ `time`
+ FROM `history_second_cruiser`
+ WHERE mac = #{mac}
+ AND `time` <![CDATA[>=]]> #{startTime}
+ AND `time` <![CDATA[<=]]> #{endTime}
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0