Commit 6355212d authored by jiaorz's avatar jiaorz

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

parent a776d698
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
v.receive_time, v.receive_time,
v.update_time, v.update_time,
v.model_id, v.model_id,
MAX(v2.update_time),
v.mileage_last_update as mileage v.mileage_last_update as mileage
<if test=" yearMonthAndParam != null "> <if test=" yearMonthAndParam != null ">
,vbi.booked_date ,vbi.booked_date
...@@ -85,7 +84,7 @@ ...@@ -85,7 +84,7 @@
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_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1)
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
where where
v.is_del=0 v.is_del=0
...@@ -119,9 +118,9 @@ ...@@ -119,9 +118,9 @@
<if test="vin !=null and vin != ''"> <if test="vin !=null and vin != ''">
and v.vin = #{vin} and v.vin = #{vin}
</if> </if>
<!-- <if test="subordinateBranch !=null">--> <!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}--> <!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- </if>--> <!-- </if>-->
<if test="code !=null"> <if test="code !=null">
and v.code = #{code} and v.code = #{code}
</if> </if>
...@@ -161,18 +160,16 @@ ...@@ -161,18 +160,16 @@
and ( v.park_branch_company_id = #{subordinateBranch}) and ( v.park_branch_company_id = #{subordinateBranch})
</if> </if>
<if test=" addrProvince !=null or addrCity !=null or zoneId !=null "> <if test=" addrProvince !=null or addrCity !=null or zoneId !=null ">
<if test="addrProvince !=null"> <if test="addrProvince !=null">
and bc.addr_province=#{addrProvince} and bc.addr_province=#{addrProvince}
</if> </if>
<if test="addrCity !=null"> <if test="addrCity !=null">
and bc.addr_city=#{addrCity} and bc.addr_city=#{addrCity}
</if> </if>
<if test="zoneId !=null"> <if test="zoneId !=null">
and bc.zone_id=#{zoneId} and bc.zone_id=#{zoneId}
</if> </if>
</if> </if>
GROUP BY v.id
order by v.code,v2.update_time DESC
) r ORDER BY r.parkBranchCompanyName ) r ORDER BY r.parkBranchCompanyName
</select> </select>
...@@ -211,7 +208,6 @@ ...@@ -211,7 +208,6 @@
v.receive_time, v.receive_time,
v.update_time, v.update_time,
v.model_id, v.model_id,
MAX(v2.update_time),
v.mileage_last_update as mileage v.mileage_last_update as mileage
<if test=" yearMonthAndParam !=null "> <if test=" yearMonthAndParam !=null ">
,vbi.booked_date ,vbi.booked_date
...@@ -226,32 +222,32 @@ ...@@ -226,32 +222,32 @@
-- 目的地分公司 -- 目的地分公司
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_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1)
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_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">
and ( v.park_branch_company_id in ( and ( v.park_branch_company_id in (
<trim suffixOverrides=","> <trim suffixOverrides=",">
<foreach collection="companyList" item="companyId"> <foreach collection="companyList" item="companyId">
#{companyId}, #{companyId},
</foreach> </foreach>
</trim> </trim>
) )
<!--or v.expect_destination_branch_company_id in ( <!--or v.expect_destination_branch_company_id in (
<trim suffixOverrides=","> <trim suffixOverrides=",">
<foreach collection="companyList" item="companyId"> <foreach collection="companyList" item="companyId">
#{companyId}, #{companyId},
</foreach> </foreach>
</trim> </trim>
)--> )-->
<!-- or v.subordinate_branch in (--> <!-- or v.subordinate_branch in (-->
<!-- <trim suffixOverrides=",">--> <!-- <trim suffixOverrides=",">-->
<!-- <foreach collection="companyList" item="companyId">--> <!-- <foreach collection="companyList" item="companyId">-->
<!-- #{companyId},--> <!-- #{companyId},-->
<!-- </foreach>--> <!-- </foreach>-->
<!-- </trim>--> <!-- </trim>-->
) )
</if> </if>
<if test="mRangeDateEnd !=null"> <if test="mRangeDateEnd !=null">
...@@ -284,9 +280,9 @@ ...@@ -284,9 +280,9 @@
<if test="vin !=null and vin != ''"> <if test="vin !=null and vin != ''">
and v.vin = #{vin} and v.vin = #{vin}
</if> </if>
<!-- <if test="subordinateBranch !=null">--> <!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}--> <!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- </if>--> <!-- </if>-->
<if test="code !=null"> <if test="code !=null">
and v.code = #{code} and v.code = #{code}
</if> </if>
...@@ -336,8 +332,6 @@ ...@@ -336,8 +332,6 @@
and bc.zone_id=#{zoneId} and bc.zone_id=#{zoneId}
</if> </if>
</if> </if>
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