Commit 81005ecd authored by 周健威's avatar 周健威

修改车辆查询

parent fbf7b1af
...@@ -38,6 +38,7 @@ import java.time.Instant; ...@@ -38,6 +38,7 @@ import java.time.Instant;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneOffset; import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Comparator;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
...@@ -131,8 +132,6 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements ...@@ -131,8 +132,6 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
if (StringUtils.isNotBlank(dto.getCatasStr())) { if (StringUtils.isNotBlank(dto.getCatasStr())) {
dto.setCatas(vehiclePlatCataBiz.groupCatasByParent(dto.getCatasStr())); dto.setCatas(vehiclePlatCataBiz.groupCatasByParent(dto.getCatasStr()));
} }
// dto.setLat(null);
// dto.setLon(null);
//设置显示是否有车(通过把时间与位比较从where移动到select) //设置显示是否有车(通过把时间与位比较从where移动到select)
//dto.setYearNo4Where(Boolean.TRUE); //dto.setYearNo4Where(Boolean.TRUE);
//dto.setWithoutRecordWhere(SYS_TRUE); //dto.setWithoutRecordWhere(SYS_TRUE);
...@@ -192,7 +191,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements ...@@ -192,7 +191,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
} }
}); });
//车型排序 //车型排序
//uvmvpdvs //uvmvpdvs.getData().parallelStream().sorted(Comparator.comparing(UsableVehicleModelVO::getHasVehicle).reversed());
} }
return ObjectRestResponse.succ(uvmvpdvs); return ObjectRestResponse.succ(uvmvpdvs);
} }
......
...@@ -910,21 +910,29 @@ ...@@ -910,21 +910,29 @@
,GROUP_CONCAT(vc.cata_id) as catas ,GROUP_CONCAT(vc.cata_id) as catas
</if> </if>
<!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 --> <!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 -->
<if test=" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"> <if test=" yearMonthAndParam !=null ">
,(max( ,
ifnull(vbi.bit_str = #{yearMonthAndParamBitStr}, false) <if test="yearNo4Where != null and yearNo4Where == true">
<!-- 租车列表 不过滤前后预约记录不符的车辆 但是合并标示车型是否有车 即 hasVehicle--> (max(
<if test="withoutRecordWhere != null and withoutRecordWhere = 1 and startCompanyId != null and endCompanyId != null "> ifnull(vbi.bit_str = #{yearMonthAndParamBitStr}, false)
<!-- and (abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId})--> <!-- 租车列表 不过滤前后预约记录不符的车辆 但是合并标示车型是否有车 即 hasVehicle-->
<!-- and (abr.to_return_company is null or abr.to_return_company = #{endCompanyId})--> <if test="withoutRecordWhere != null and withoutRecordWhere = 1 and startCompanyId != null and endCompanyId != null ">
and ( <!-- and (abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId})-->
(IFNULL(abr.to_lift_company, v.park_branch_company_id) = #{startCompanyId}) <!-- and (abr.to_return_company is null or abr.to_return_company = #{endCompanyId})-->
and and (
(abr.to_return_company is null or abr.to_return_company = #{endCompanyId}) (IFNULL(abr.to_lift_company, v.park_branch_company_id) = #{startCompanyId})
and
(abr.to_return_company is null or abr.to_return_company = #{endCompanyId})
)
</if>
) )
</if>
) )
) as hasVehicle </if>
<if test="yearNo4Where != null and yearNo4Where == true">
(if(count(*) > 1, 1 , 0))
</if>
as hasVehicle
</if> </if>
<if test="lon != null and lat != null"> <if test="lon != null and lat != null">
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance ,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment