|
@@ -199,71 +199,83 @@
|
|
limit 1
|
|
limit 1
|
|
]]>
|
|
]]>
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
<select id="getDayCheckedVistorNumByDeviceNoList" resultType="Integer">
|
|
<select id="getDayCheckedVistorNumByDeviceNoList" resultType="Integer">
|
|
- select count(*) from base_person_device_log where person_id = 0
|
|
|
|
- and record_time >=#{startTime}
|
|
|
|
- and record_time <= #{endTime}
|
|
|
|
-
|
|
|
|
- <foreach collection="list" index="index" item="item" open="and device_no in(" separator="," close=")"> #{item}
|
|
|
|
|
|
+ <![CDATA[
|
|
|
|
+ select count(*) from base_person_device_log where person_id = 0
|
|
|
|
+ and record_time >=#{startTime}
|
|
|
|
+ and record_time <= #{endTime}
|
|
|
|
+ ]]>
|
|
|
|
+ <foreach collection="list" index="index" item="item" open="and device_no in(" separator="," close=")">
|
|
|
|
+ #{item}
|
|
</foreach>
|
|
</foreach>
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
<select id="findLastPersonLogByCompanyList" resultMap="PersonDeviceLogMap">
|
|
<select id="findLastPersonLogByCompanyList" resultMap="PersonDeviceLogMap">
|
|
-
|
|
|
|
|
|
+ <![CDATA[
|
|
SELECT * from
|
|
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_
|
|
|
|
- where record_time>=#{startTime}
|
|
|
|
- and record_time <= #{endTime}
|
|
|
|
- and company_id in
|
|
|
|
- <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> #{item.id}
|
|
|
|
|
|
+ (
|
|
|
|
+ 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_
|
|
|
|
+ where m.record_time>=#{startTime}
|
|
|
|
+ and m.record_time <=#{endTime}
|
|
|
|
+ ]]>
|
|
|
|
+ <foreach collection="list" index="index" item="item" open=" and company_id in (" separator="," close=")">
|
|
|
|
+ #{item.id}
|
|
</foreach>
|
|
</foreach>
|
|
- ORDER BY record_time DESC) a
|
|
|
|
- where person_id != 0 GROUP BY a.person_id ORDER BY record_time desc
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ <![CDATA[
|
|
|
|
+ ) a
|
|
|
|
+ where person_id <> 0 and temperature_>0 GROUP BY a.person_id ORDER BY record_time desc
|
|
|
|
+ ]]>
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
<select id="findVisitorLogByDeviceNoList" resultMap="PersonDeviceLogMap">
|
|
<select id="findVisitorLogByDeviceNoList" resultMap="PersonDeviceLogMap">
|
|
- select * from base_person_device_log
|
|
|
|
- where person_id = 0
|
|
|
|
- and record_time>=#{startTime}
|
|
|
|
- and record_time <= #{endTime}
|
|
|
|
-
|
|
|
|
|
|
+ <![CDATA[
|
|
|
|
+ select * from base_person_device_log
|
|
|
|
+ where person_id = 0
|
|
|
|
+ and record_time >= #{startTime}
|
|
|
|
+ and record_time <= #{endTime}
|
|
|
|
+ and temperature_>0
|
|
|
|
+ ]]>
|
|
<foreach collection="list" index="index" item="item" open="and device_no in(" separator="," close=")"> #{item}
|
|
<foreach collection="list" index="index" item="item" open="and device_no in(" separator="," close=")"> #{item}
|
|
</foreach>
|
|
</foreach>
|
|
ORDER BY record_time DESC
|
|
ORDER BY record_time DESC
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
<select id="findLastTeacherLogByCompanyList" resultMap="PersonDeviceLogMap">
|
|
<select id="findLastTeacherLogByCompanyList" resultMap="PersonDeviceLogMap">
|
|
|
|
+ <![CDATA[
|
|
SELECT * from
|
|
SELECT * from
|
|
- (SELECT m.*,n.company_id as company_id,n.popedom_ as popedom_
|
|
|
|
- from base_person_device_log m LEFT JOIN base_person_info n
|
|
|
|
- ON m.person_id = n.id_
|
|
|
|
- where record_time>=#{startTime}
|
|
|
|
- and record_time <= #{endTime}
|
|
|
|
- and popedom_ like '%2%'
|
|
|
|
-
|
|
|
|
- <foreach collection="list" index="index" item="item" open="and company_id in(" separator="," close=")"> #{item.id}
|
|
|
|
- </foreach>
|
|
|
|
- ORDER BY record_time DESC) a
|
|
|
|
- where person_id != 0 GROUP BY a.person_id ORDER BY record_time desc
|
|
|
|
|
|
+ (
|
|
|
|
+ SELECT m.*,n.company_id as company_id,n.popedom_ as popedom_
|
|
|
|
+ from base_person_device_log m LEFT JOIN base_person_info n
|
|
|
|
+ ON m.person_id = n.id_
|
|
|
|
+ where m.record_time>=#{startTime}
|
|
|
|
+ and m.record_time <= #{endTime}
|
|
|
|
+ and m.popedom_ like '%2%'
|
|
|
|
+ and m.temperature_>0
|
|
|
|
+ ]]>
|
|
|
|
+ <foreach collection="list" index="index" item="item" open="and company_id in(" separator="," close=")">
|
|
|
|
+ #{item.id}
|
|
|
|
+ </foreach>
|
|
|
|
+ ) a
|
|
|
|
+ <![CDATA[
|
|
|
|
+ where person_id<>0 and temperature_>0 GROUP BY a.person_id ORDER BY record_time desc
|
|
|
|
+ ]]>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="findLastStudentLogByCompanyList" resultMap="PersonDeviceLogMap">
|
|
<select id="findLastStudentLogByCompanyList" resultMap="PersonDeviceLogMap">
|
|
|
|
+ <![CDATA[
|
|
SELECT * from
|
|
SELECT * from
|
|
- (SELECT m.*,n.company_id as company_id,n.popedom_ as popedom_
|
|
|
|
- from base_person_device_log m LEFT JOIN base_person_info n
|
|
|
|
- ON m.person_id = n.id_
|
|
|
|
- where record_time>=#{startTime}
|
|
|
|
- and record_time <= #{endTime}
|
|
|
|
- and popedom_ = '1'
|
|
|
|
-
|
|
|
|
|
|
+ (
|
|
|
|
+ SELECT m.*,n.company_id as company_id,n.popedom_ as popedom_
|
|
|
|
+ from base_person_device_log m LEFT JOIN base_person_info n
|
|
|
|
+ ON m.person_id = n.id_
|
|
|
|
+ where record_time>=#{startTime}
|
|
|
|
+ and record_time <= #{endTime}
|
|
|
|
+ and popedom_ = '1'
|
|
|
|
+ ]]>
|
|
<foreach collection="list" index="index" item="item" open="and company_id in(" separator="," close=")"> #{item.id}
|
|
<foreach collection="list" index="index" item="item" open="and company_id in(" separator="," close=")"> #{item.id}
|
|
</foreach>
|
|
</foreach>
|
|
- ORDER BY record_time DESC) a
|
|
|
|
- where person_id != 0 GROUP BY a.person_id ORDER BY record_time desc
|
|
|
|
|
|
+ <![CDATA[
|
|
|
|
+ ) a
|
|
|
|
+ where person_id <> 0 and temperature_>0 GROUP BY a.person_id ORDER BY record_time desc
|
|
|
|
+ ]]>
|
|
</select>
|
|
</select>
|
|
</mapper>
|
|
</mapper>
|