Commit 30eba9f8 by 杨林龙

1.7.0 开发区域查车接口

1 parent 4e860656
......@@ -380,5 +380,5 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> {
@DataPerm(permTable = "tv", showSql = true)
@DataPermShare(linkTable = "t_vehicle", showSql = true)
List<RegionalSearchVO> getVehicleInfoListBySns(@Param("snList") List<String> snList);
List<RegionalSearchVO> getVehicleInfoListBySns(@Param("sns") String sns);
}
\ No newline at end of file
......@@ -2539,6 +2539,9 @@ public class VehicleService extends AbstractCommonService {
* @return 车辆基本信息
*/
public List<RegionalSearchVO> getVehicleInfoListBySns(List<String> snList) {
return vehicleMapper.getVehicleInfoListBySns(snList);
StringBuilder builder = new StringBuilder();
snList.forEach(sn -> builder.append("'").append(sn).append("'").append(","));
String sns = builder.substring(0, builder.toString().length() - 1);
return vehicleMapper.getVehicleInfoListBySns(sns);
}
}
......@@ -1435,27 +1435,22 @@
<select id="getVehicleInfoListBySns" resultType="cn.com.glsx.admin.modules.model.vo.RegionalSearchVO">
select tvd.id,
tw.partner_order_no workOrderNo,
tw.`shop_name` AS shopName,
tv.owner_name as ownerName,
tv.vin as vin,
tvd.sn as sn,
td.source as `source`,
td.device_type as deviceType,
tvd.created_date as activeDate
tw.partner_order_no workOrderNo,
tw.`shop_name` AS shopName,
tv.owner_name as ownerName,
tv.vin as vin,
tvd.sn as sn,
td.source as `source`,
td.device_type as deviceType,
tvd.created_date as activeDate
from t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
left join t_device td on td.sn = tvd.sn
left join t_workorder tw on tw.id = tv.workorder_id and tw.del_flag = 0
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
left join t_device td on td.sn = tvd.sn
left join t_workorder tw on tw.id = tv.workorder_id and tw.del_flag = 0
where tv.del_flag = 0
and tvd.bind_status = 1
and tvd.del_flag = 0
<if test="snList != null and snList.size() > 0">
and tvd.sn in
<foreach collection="snList" separator="," open="(" close=")" item="item">
#{item}
</foreach>
</if>
and tvd.bind_status = 1
and tvd.del_flag = 0
and tvd.sn in (${sns})
order by tvd.id desc
</select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!