Commit 953d5a9c authored by 周健威's avatar 周健威

修改车辆相关

parent e262d26f
......@@ -59,6 +59,9 @@ public class UsableVeicleDTO extends PageParam {
@ApiModelProperty(hidden = true)
Boolean yearNo4Where;
@ApiModelProperty(hidden = true)
Integer withoutRecordWhere;
/**
* 是否根据预订记录(相交叉)查询
* 原(大于预约结束时间,小于预约开始时间的预约记录)
......
......@@ -132,7 +132,8 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
dto.setCatas(vehiclePlatCataBiz.groupCatasByParent(dto.getCatasStr()));
}
//设置显示是否有车(通过把时间与位比较从where移动到select)
dto.setYearNo4Where(Boolean.TRUE);
//dto.setYearNo4Where(Boolean.TRUE);
//dto.setWithoutRecordWhere(SYS_TRUE);
//匹配相交叉的预约记录
dto.setRecordIntersection(Boolean.TRUE);
PageDataVO<UsableVehicleModelVO> uvmvpdvs = vehicleBiz.searchUsableModel(dto);
......
......@@ -915,8 +915,13 @@
ifnull(vbi.bit_str = #{yearMonthAndParamBitStr}, false)
<!-- 租车列表 不过滤前后预约记录不符的车辆 但是合并标示车型是否有车 即 hasVehicle-->
<if test="withoutRecordWhere != null and withoutRecordWhere = 1 and startCompanyId != null and endCompanyId != null ">
and (abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId})
and (abr.to_return_company is null or abr.to_return_company = #{endCompanyId})
<!-- and (abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId})-->
<!-- and (abr.to_return_company is null or abr.to_return_company = #{endCompanyId})-->
and (
(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>
)
) as hasVehicle
......@@ -952,32 +957,32 @@
</if>
)
<!-- union 所有下架车型 -->
<!-- -->
<!-- <if test="startCompanyId != null or parkBranchCompanyId != null ">-->
<!-- union-->
<!-- (select vm.id as model_id, bc.id as company_id-->
<!-- <if test=" catas != null ">-->
<!-- ,null as catas-->
<!-- </if>-->
<!-- <if test=" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true">-->
<!-- ,0 as hasVehicle-->
<!-- </if>-->
<!-- <if test="lon != null and lat != null">-->
<!-- &lt;!&ndash; 处理距离 &ndash;&gt;-->
<!-- ,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance-->
<!-- </if>-->
<!-- from vehicle_model vm-->
<!-- left join branch_company bc on-->
<!-- <choose>-->
<!-- <when test="startCompanyId != null">-->
<!-- bc.id = #{startCompanyId}-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- bc.id = #{parkBranchCompanyId}-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- where vm.isdel = 0 and vm.status = 0 and vm.app_show = 1)-->
<!-- </if>-->
<if test="startCompanyId != null or parkBranchCompanyId != null ">
union
(select vm.id as model_id, bc.id as company_id
<if test=" catas != null ">
,null as catas
</if>
<if test=" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true">
,0 as hasVehicle
</if>
<if test="lon != null and lat != null">
<!-- 处理距离 -->
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
</if>
from vehicle_model vm
left join branch_company bc on
<choose>
<when test="startCompanyId != null">
bc.id = #{startCompanyId}
</when>
<otherwise>
bc.id = #{parkBranchCompanyId}
</otherwise>
</choose>
where vm.isdel = 0 and vm.status = 1 and vm.app_show = 1)
</if>
<if test="lon != null and lat != null">
order by
<if test=" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true">
......
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