|
@@ -221,16 +221,18 @@
|
|
|
LEFT JOIN base_person_info b on a.person_id=b.id_
|
|
|
LEFT JOIN base_company_info c on b.company_id=c.id_
|
|
|
where a.del_flag=false
|
|
|
- and c.code_ like #{companyCode}
|
|
|
and a.temperature_ >= #{temperature}
|
|
|
and a.record_time >= #{startDate}
|
|
|
and a.record_time < #{endDate}
|
|
|
]]>
|
|
|
+ and (
|
|
|
+ c.code_ like #{companyCode}
|
|
|
<if test="personId!=null">
|
|
|
- and c.id_ in (
|
|
|
+ or c.id_ in (
|
|
|
select d.id_ from base_person_company d where d.person_id = #{personId}
|
|
|
)
|
|
|
</if>
|
|
|
+ )
|
|
|
GROUP BY c.id_,date_format(a.record_time,'%Y-%m-%d')
|
|
|
</select>
|
|
|
<select id="lastPersonLog" resultMap="PersonDeviceFilterLogMap">
|
|
@@ -252,15 +254,17 @@
|
|
|
LEFT JOIN base_person_info b on a.person_id=b.id_
|
|
|
LEFT JOIN base_company_info c on b.company_id=c.id_
|
|
|
where a.del_flag=false
|
|
|
- and c.code_ like #{companyCode}
|
|
|
and record_time >= #{startDate}
|
|
|
and record_time <= #{endDate}
|
|
|
]]>
|
|
|
+ and (
|
|
|
+ c.code_ like #{companyCode}
|
|
|
<if test="personId!=null">
|
|
|
- and c.id_ in (
|
|
|
+ or c.id_ in (
|
|
|
select d.id_ from base_person_company d where d.person_id = #{personId}
|
|
|
)
|
|
|
</if>
|
|
|
+ )
|
|
|
<if test="status==-1">
|
|
|
<![CDATA[
|
|
|
and a.temperature_>=37
|
|
@@ -287,8 +291,7 @@
|
|
|
<select id="countUndetectedByCompanyCode" resultType="long">
|
|
|
<![CDATA[
|
|
|
select count(*) from base_person_info a,base_company_info b
|
|
|
- where b.code_ like #{companyCode}
|
|
|
- and a.company_id = b.id_
|
|
|
+ where a.company_id = b.id_
|
|
|
and b.del_flag=0
|
|
|
and a.del_flag=0
|
|
|
and a.id_ not in (
|
|
@@ -297,10 +300,13 @@
|
|
|
and record_time <= #{endTime}
|
|
|
)
|
|
|
]]>
|
|
|
+ and (
|
|
|
+ b.code_ like #{companyCode}
|
|
|
<if test="personId!=null">
|
|
|
- and b.id_ in (
|
|
|
+ or b.id_ in (
|
|
|
select d.id_ from base_person_company d where d.person_id = #{personId}
|
|
|
)
|
|
|
</if>
|
|
|
+ )
|
|
|
</select>
|
|
|
</mapper>
|