Commit 0f53c623 authored by jiaorz's avatar jiaorz

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

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