Commit d8b8867f by levphon

车辆档案调频数据优化

1 parent fdca5c4f
......@@ -88,17 +88,20 @@
<select id="selectByVdIds" resultType="cn.com.glsx.admin.modules.model.DeviceFreqModel">
select a.id, a.sn, a.vehicle_id vehicleId, a.status freqStatus, a.created_date createTime, b.vdId
from t_device_freq a,
(select tdf.vehicle_id, tdf.sn, tvd.id vdId, max(tdf.id) id
from t_device_freq tdf,
t_vehicle_device tvd
where tdf.del_flag = 0
and tvd.del_flag = 0
and tdf.vehicle_id = tvd.vehicle_id
and tdf.sn = tvd.sn
and tvd.id in (37470, 54049, 68436)
group by tdf.vehicle_id, tdf.sn, tvd.id) b
(select tdf.vehicle_id, tdf.sn, tvd.id vdId, max(tdf.id) id
from t_device_freq tdf,
t_vehicle_device tvd
where tdf.del_flag = 0
and tvd.del_flag = 0
and tdf.vehicle_id = tvd.vehicle_id
and tdf.sn = tvd.sn
and tvd.id in
<foreach collection="vdIds" separator="," open="(" close=")" item="item">
#{item}
</foreach>
group by tdf.vehicle_id, tdf.sn, tvd.id) b
where a.id = b.id
and a.vehicle_id = b.vehicle_id
and a.sn = b.sn
and a.vehicle_id = b.vehicle_id
and a.sn = b.sn
</select>
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!