Commit 0f53c623 authored by jiaorz's avatar jiaorz

添加根据预定记录ID获取出行记录接口

parent 06ff2932
......@@ -71,7 +71,8 @@
v.receive_time,
v.update_time,
v.model_id,
v.mileage_last_update as mileage
v.mileage_last_update as mileage,
MAX(v2.update_time)
<if test=" yearMonthAndParam != null ">
,vbi.booked_date
</if>
......@@ -117,7 +118,7 @@
and v.insurance_company = #{insuranceCompany}
</if>
<if test="belongToName !=null">
and v.belong_to_name = #{belongToName}
and v.belong_to_name = like concat('%',#{belongToName},'%')
</if>
<if test="vin !=null and vin != ''">
and v.vin = #{vin}
......@@ -174,7 +175,8 @@
and bc.zone_id=#{zoneId}
</if>
</if>
order by v.code
GROUP BY v.id
order by v.code,v2.update_time DESC
) r ORDER BY r.parkBranchCompanyName
</select>
......@@ -213,7 +215,8 @@
v.receive_time,
v.update_time,
v.model_id,
v.mileage_last_update as mileage
v.mileage_last_update as mileage,
MAX(v2.update_time)
<if test=" yearMonthAndParam !=null ">
,vbi.booked_date
</if>
......@@ -227,7 +230,9 @@
-- 目的地分公司
LEFT JOIN branch_company bc1 ON v.expect_destination_branch_company_id = bc1.id
-- 所属分公司
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id,
LEFT JOIN vehicle_book_record v2 on v2.vehicle_id = v.id,
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
where
v.is_del=0
<if test="companyList != null">
......@@ -278,7 +283,7 @@
and v.insurance_company = #{insuranceCompany}
</if>
<if test="belongToName !=null">
and v.belong_to_name = #{belongToName}
and v.belong_to_name = like concat('%',#{belongToName},'%')
</if>
<if test="vin !=null and vin != ''">
and v.vin = #{vin}
......@@ -289,9 +294,15 @@
<if test="code !=null">
and v.code = #{code}
</if>
<if test="status !=null">
<if test="status !=null and status != 6 and status != 7">
and v.status = #{status}
</if>
<if test="status !=null and status == 6">
and v3.id is not NULL and v2.book_type = 3 and v3.state = 0
</if>
<if test="status !=null and status == 7">
and v3.id is not NULL and v2.book_type = 6 and v3.state = 0
</if>
<if test="numberPlate !=null and numberPlate != ''">
and v.number_plate like concat('%',#{numberPlate},'%')
</if>
......@@ -329,7 +340,8 @@
and bc.zone_id=#{zoneId}
</if>
</if>
order by v.code
GROUP BY v.id
order by v.code,v2.update_time DESC
) r ORDER BY r.parkBranchCompanyName
</select>
......
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