Commit 8d458574 authored by jiaorz's avatar jiaorz

Merge branch 'master-background-manager' into dev

parents 86beb7c1 6355212d
......@@ -493,6 +493,15 @@
<if test="status != null and status != 0 and status != -1 and status != -2 and status != 3 and status != 5 and status != 7">
and v1.status = #{status}
</if>
<if test="status != null and status == 3 ">
and v4.id is null and v1.status = 2
</if>
<if test="status != null and status == 5 ">
and v4.id is not null and v1.status = 2 and v4.state = 0
</if>
<if test="status != null and status == 7 ">
and v4.id is not null and v1.status = 2 and v4.state = 1
</if>
<if test="status != null and status == 0 ">
and v4.state = 0
</if>
......
......@@ -44,8 +44,6 @@
v.`status`,
v.number_plate,
v.brand,
-- IFNULL(v.park_branch_company_id,v.expect_destination_branch_company_id) AS subordinate_branch,
-- IFNULL(bc.name,bc1.name) AS subBranchName,
v.park_branch_company_id,
bc.name as parkBranchCompanyName,
v.expect_destination_branch_company_id,
......@@ -80,15 +78,13 @@
left join
vehicle_book_info vbi on v.`id` = vbi.vehicle
</if>
-- LEFT JOIN branch_company bc ON v.park_branch_company_id = bc.id
-- LEFT JOIN branch_company bc1 ON v.expect_destination_branch_company_id = bc1.id
-- 停车分公司
LEFT JOIN branch_company bc ON v.park_branch_company_id = bc.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 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
where
v.is_del=0
......@@ -116,15 +112,15 @@
<if test="insuranceCompany !=null">
and v.insurance_company = #{insuranceCompany}
</if>
<if test="belongToName !=null">
and v.belong_to_name = #{belongToName}
<if test="belongToName !=null and belongToName != ''">
and v.belong_to_name = like concat('%',#{belongToName},'%')
</if>
<if test="vin !=null and vin != ''">
and v.vin = #{vin}
</if>
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- </if>-->
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- </if>-->
<if test="code !=null">
and v.code = #{code}
</if>
......@@ -174,7 +170,6 @@
and bc.zone_id=#{zoneId}
</if>
</if>
order by v.code
) r ORDER BY r.parkBranchCompanyName
</select>
......@@ -228,6 +223,8 @@
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 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
where
v.is_del=0
<if test="companyList != null">
......@@ -277,21 +274,27 @@
<if test="insuranceCompany !=null">
and v.insurance_company = #{insuranceCompany}
</if>
<if test="belongToName !=null">
and v.belong_to_name = #{belongToName}
<if test="belongToName !=null and belongToName != ''">
and v.belong_to_name = like concat('%',#{belongToName},'%')
</if>
<if test="vin !=null and vin != ''">
and v.vin = #{vin}
</if>
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- </if>-->
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- </if>-->
<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 +332,6 @@
and bc.zone_id=#{zoneId}
</if>
</if>
order by v.code
) 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