Commit 55bf12e8 by 杨林龙

优化围栏报警条数查询

1 parent 4d8b953f
......@@ -39,8 +39,17 @@
</sql>
<select id="getFenceAlarmCount" resultType="java.lang.Integer">
select count(1) from t_alarm_electric_fence taef
where taef.del_flag = 0
select
count(1)
from t_alarm_electric_fence taef
left join t_vehicle_device tvd on tvd.id = taef.vd_id
left join t_device td on td.sn = tvd.sn
left join t_vehicle tv on tv.id = tvd.vehicle_id
left join t_electric_fence tef on tef.id = taef.fence_id
where tv.del_flag = 0
and taef.del_flag = 0
and tvd.del_flag = 0
and tef.del_flag = 0
<if test="sns != null and sns.size() > 0">
and taef.sn IN
<foreach collection="sns" separator="," open="(" close=")" item="item">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!