Commit d8d82a14 by 杨林龙

车辆按照设备激活时间排序

1 parent 8caf1475
...@@ -306,12 +306,13 @@ ...@@ -306,12 +306,13 @@
ddf.`status` AS freqStatus ddf.`status` AS freqStatus
from t_vehicle tv from t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
left join t_device td on td.sn = tvd.sn and td.del_flag = 0 left join t_device td on td.sn = tvd.sn
left join (select * from (SELECT * FROM t_device_freq order by created_date desc) temp GROUP BY temp.sn) ddf left join (select * from (SELECT * FROM t_device_freq order by created_date desc) temp GROUP BY temp.sn) ddf
on ddf.vehicle_id = tv.id and ddf.sn = td.sn on ddf.vehicle_id = tv.id and ddf.sn = td.sn
where tv.del_flag = 0 where tv.del_flag = 0
and tvd.bind_status = 1 and tvd.bind_status = 1
and tvd.del_flag = 0 and tvd.del_flag = 0
and td.del_flag = 0
<if test="keywords != null and keywords !=''"> <if test="keywords != null and keywords !=''">
and( and(
tv.owner_name like '%${keywords}%' tv.owner_name like '%${keywords}%'
...@@ -335,7 +336,7 @@ ...@@ -335,7 +336,7 @@
<if test="vehicleUsages != null"> <if test="vehicleUsages != null">
and tv.vehicle_usages = #{vehicleUsages} and tv.vehicle_usages = #{vehicleUsages}
</if> </if>
order by tv.created_date desc,tv.id,tvd.id order by td.activate_time desc,tv.id,tvd.id
</select> </select>
<select id="exportVehicleInfo" parameterType="cn.com.glsx.admin.modules.model.param.VehicleInfoSearch" <select id="exportVehicleInfo" parameterType="cn.com.glsx.admin.modules.model.param.VehicleInfoSearch"
...@@ -353,12 +354,13 @@ ...@@ -353,12 +354,13 @@
ddf.`status` AS freqStatus ddf.`status` AS freqStatus
from t_vehicle tv from t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
left join t_device td on td.sn = tvd.sn and td.del_flag = 0 left join t_device td on td.sn = tvd.sn
left join (select * from (SELECT * FROM t_device_freq order by created_date desc) temp GROUP BY temp.sn) ddf left join (select * from (SELECT * FROM t_device_freq order by created_date desc) temp GROUP BY temp.sn) ddf
on ddf.vehicle_id = tv.id and ddf.sn = td.sn on ddf.vehicle_id = tv.id and ddf.sn = td.sn
where tv.del_flag = 0 where tv.del_flag = 0
and tvd.bind_status = 1 and tvd.bind_status = 1
and tvd.del_flag = 0 and tvd.del_flag = 0
and td.del_flag = 0
<if test="keywords != null and keywords !=''"> <if test="keywords != null and keywords !=''">
and( and(
tv.owner_name like '%${keywords}%' tv.owner_name like '%${keywords}%'
...@@ -382,7 +384,7 @@ ...@@ -382,7 +384,7 @@
<if test="vehicleUsages != null"> <if test="vehicleUsages != null">
and tv.vehicle_usages = #{vehicleUsages} and tv.vehicle_usages = #{vehicleUsages}
</if> </if>
order by tv.created_date desc,tv.id,tvd.id order by td.activate_time desc,tv.id,tvd.id
</select> </select>
<select id="listTestDriveVehicle" resultType="cn.com.glsx.admin.modules.model.TestVehicleDTO"> <select id="listTestDriveVehicle" resultType="cn.com.glsx.admin.modules.model.TestVehicleDTO">
......
...@@ -2154,7 +2154,7 @@ public class VehicleServiceTest { ...@@ -2154,7 +2154,7 @@ public class VehicleServiceTest {
@Test @Test
public void test15(){ public void test15(){
Device device = deviceService.getDeviceBySn("1590000008"); Device device = deviceService.getDeviceBySn("1190000009");
device.setActivateTime(null); device.setActivateTime(null);
device.setActivateStatus(0); device.setActivateStatus(0);
deviceService.updateDevice(device); deviceService.updateDevice(device);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!