Commit 5b975aa9 authored by hezhen's avatar hezhen

修改车辆管理

parent 1733c17d
......@@ -24,4 +24,6 @@ public class VehicleDepartureLogVo {
Integer state;
String numberPlate;
String departureDay;
String departureName;
String arrivalName;
}
......@@ -22,10 +22,12 @@
CONCAT(IFNULL(floor((unix_timestamp(vehicle_departure_log.arrival_time) - unix_timestamp(vehicle_departure_log.departure_time)) / 86400),0),'天',
IFNULL(floor(IF((unix_timestamp(vehicle_departure_log.arrival_time) - unix_timestamp(vehicle_departure_log.departure_time))>86400,(unix_timestamp(vehicle_departure_log.arrival_time)
- unix_timestamp(vehicle_departure_log.departure_time)) MOD 86400/3600,(unix_timestamp(vehicle_departure_log.arrival_time) - unix_timestamp(vehicle_departure_log.departure_time))/3600)),0),'小时')
as departureDay,
as departureDay,bc.name as departureName,bc1.name as arrivalName,
IF((IFNULL(vehicle_departure_log.mileage_end,0)-IFNULL(vehicle_departure_log.mileage_start,0))>0,IFNULL(vehicle_departure_log.mileage_end,0)-IFNULL(vehicle_departure_log.mileage_start,0),0) as mileage
from vehicle_departure_log
left join vehicle on vehicle_departure_log.vehicle_id = vehicle.id
LEFT JOIN branch_company bc ON vehicle_departure_log.departure_branch_company_id = bc.id
LEFT JOIN branch_company bc1 ON vehicle_departure_log.arrival_branch_company_id = bc1.id
<trim prefix="where">
1=1
<if test="numberPlate != null and numberPlate != ''">
......@@ -53,10 +55,12 @@
CONCAT(IFNULL(floor((unix_timestamp(vehicle_departure_log.arrival_time) - unix_timestamp(vehicle_departure_log.departure_time)) / 86400),0),'天',
IFNULL(floor(IF((unix_timestamp(vehicle_departure_log.arrival_time) - unix_timestamp(vehicle_departure_log.departure_time))>86400,(unix_timestamp(vehicle_departure_log.arrival_time)
- unix_timestamp(vehicle_departure_log.departure_time)) MOD 86400/3600,(unix_timestamp(vehicle_departure_log.arrival_time) - unix_timestamp(vehicle_departure_log.departure_time))/3600)),0),'小时')
as departureDay,
as departureDay,bc.name as departureName,bc1.name as arrivalName,
IF((IFNULL(vehicle_departure_log.mileage_end,0)-IFNULL(vehicle_departure_log.mileage_start,0))>0,IFNULL(vehicle_departure_log.mileage_end,0)-IFNULL(vehicle_departure_log.mileage_start,0),0) as mileage
from vehicle_departure_log
left join vehicle on vehicle_departure_log.vehicle_id = vehicle.id
LEFT JOIN branch_company bc ON vehicle_departure_log.departure_branch_company_id = bc.id
LEFT JOIN branch_company bc1 ON vehicle_departure_log.arrival_branch_company_id = bc1.id
<trim prefix="where" suffixOverrides="and">
<if test="numberPlate != null and numberPlate != ''">
vehicle.number_plate = #{numberPlate} and
......
......@@ -17,7 +17,7 @@
v.`status`,
v.number_plate,
v.brand,
v.subordinate_branch,
IFNULL(v.park_branch_company_id,v.expect_destination_branch_company_id) AS subordinate_branch,
IFNULL(bc.name,bc1.name) AS subBranchName,
v.use_type,
v.remark,
......@@ -81,7 +81,7 @@
and v.status = #{status}
</if>
<if test="numberPlate !=null and numberPlate != ''">
and v.number_plate = #{numberPlate}
and v.number_plate like concat('%',#{numberPlate},'%')
</if>
<if test="brand !=null">
and v.brand = #{brand}
......@@ -126,7 +126,7 @@
v.`status`,
v.number_plate,
v.brand,
v.subordinate_branch,
IFNULL(v.park_branch_company_id,v.expect_destination_branch_company_id) AS subordinate_branch,
IFNULL(bc.name,bc1.name) AS subBranchName,
v.use_type,
v.remark,
......@@ -206,7 +206,7 @@
and v.status = #{status}
</if>
<if test="numberPlate !=null and numberPlate != ''">
and v.number_plate = #{numberPlate}
and v.number_plate like concat('%',#{numberPlate},'%')
</if>
<if test="brand !=null">
and v.brand = #{brand}
......
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