|
@@ -226,7 +226,9 @@
|
|
|
</select>
|
|
|
<select id="findAllPersonLogByCompanyIdAndDeviceNo" resultMap="PersonDeviceLogMap">
|
|
|
<![CDATA[
|
|
|
- SELECT m.*
|
|
|
+ select * from base_person_device_log
|
|
|
+ where rownum_ in (
|
|
|
+ SELECT max(m.rownum_)
|
|
|
from base_person_device_log m inner join base_person_info n ON m.person_id = n.id_
|
|
|
where m.record_time>=#{startTime}
|
|
|
and m.record_time <=#{endTime}
|
|
@@ -235,7 +237,8 @@
|
|
|
#{item.id}
|
|
|
</foreach>
|
|
|
<![CDATA[
|
|
|
- and m.temperature_>0 GROUP BY m.person_id
|
|
|
+ and m.temperature_>0 GROUP BY m.person_id
|
|
|
+ )
|
|
|
]]>
|
|
|
union all
|
|
|
<![CDATA[
|
|
@@ -252,21 +255,21 @@
|
|
|
</select>
|
|
|
<select id="findLastPersonLogByCompanyList" resultMap="PersonDeviceLogMap">
|
|
|
<![CDATA[
|
|
|
- SELECT * from
|
|
|
- (
|
|
|
- SELECT m.*,n.company_id as company_id
|
|
|
- from base_person_device_log m LEFT JOIN base_person_info n
|
|
|
- ON m.person_id = n.id_
|
|
|
+ select * from base_person_device_log
|
|
|
+ where rownum_ in (
|
|
|
+ SELECT max(m.rownum_)
|
|
|
+ from base_person_device_log m inner join base_person_info n ON m.person_id = n.id_
|
|
|
where m.record_time>=#{startTime}
|
|
|
and m.record_time <=#{endTime}
|
|
|
]]>
|
|
|
- <foreach collection="list" index="index" item="item" open=" and company_id in (" separator="," close=")">
|
|
|
+ <foreach collection="companyList" index="index" item="item" open=" and n.company_id in (" separator="," close=")">
|
|
|
#{item.id}
|
|
|
</foreach>
|
|
|
<![CDATA[
|
|
|
- ) a
|
|
|
- where person_id <> 0 and temperature_>0 GROUP BY a.person_id ORDER BY record_time desc
|
|
|
+ and m.temperature_>0 GROUP BY m.person_id
|
|
|
+ )
|
|
|
]]>
|
|
|
+ order by record_time desc
|
|
|
</select>
|
|
|
<select id="findVisitorLogByDeviceNoList" resultMap="PersonDeviceLogMap">
|
|
|
<![CDATA[
|
|
@@ -278,7 +281,7 @@
|
|
|
]]>
|
|
|
<foreach collection="list" index="index" item="item" open="and device_no in(" separator="," close=")"> #{item}
|
|
|
</foreach>
|
|
|
- ORDER BY record_time DESC
|
|
|
+ ORDER BY record_time desc
|
|
|
</select>
|
|
|
<select id="findLastTeacherLogByCompanyList" resultMap="PersonDeviceLogMap">
|
|
|
<![CDATA[
|