Commit dd717099 authored by 周健威's avatar 周健威

修改车辆查询重复车型问题

parent 84cda7f8
......@@ -1019,6 +1019,12 @@
<select id="searchUsableModel" parameterType="java.util.Map"
resultMap="searchUsableModelMap">
<if test="startCompanyId != null or parkBranchCompanyId != null ">
select model_id, company_id
<if test="lon != null and lat != null">, distance</if>
<if test=" yearMonthAndParam !=null ">, max(hasVehicle) as hasVehicle</if>
from (
</if>
(select distinct vm.id as model_id, bc.id as company_id
<!-- , group_concat(v.id) as vehicle_ids -->
<if test=" catas != null ">
......@@ -1029,8 +1035,9 @@
,
<if test="yearNo4Where != null and yearNo4Where == true">
(max(
ifnull(vbi.bit_str = #{yearMonthAndParamBitStr}, false)
<!-- 租车列表 不过滤前后预约记录不符的车辆 但是合并标示车型是否有车 即 hasVehicle-->
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})-->
......@@ -1105,6 +1112,9 @@
</otherwise>
</choose>
where vm.isdel = 0 and vm.status = 1 and vm.app_show = 1)
) as total_table
group by model_id, company_id
<if test="lon != null and lat != null">, distance</if>
</if>
<if test="lon != null and lat != null">
order by
......
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