Commit 58369941 authored by hanfeng's avatar hanfeng

Merge remote-tracking branch 'origin/base-modify' into base-modify

# Conflicts:
#	xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
parents f84a1001 046f4856
...@@ -33,6 +33,15 @@ public class VehicleBookRecordQueryVo extends PageParam { ...@@ -33,6 +33,15 @@ public class VehicleBookRecordQueryVo extends PageParam {
*/ */
private String selectedMonth; private String selectedMonth;
/**
* 查询预定开始月份 yyyy-MM
*/
private String bookStartDate;
/**
* 查询预定结束月份 yyyy-MM
*/
private String bookEndDate;
/** /**
* 申请状态 * 申请状态
*/ */
......
...@@ -84,17 +84,20 @@ public class VehicleActiveService { ...@@ -84,17 +84,20 @@ public class VehicleActiveService {
if (MileageLift == null || MileageLift1 >= MileageLift) { if (MileageLift == null || MileageLift1 >= MileageLift) {
// 写入车辆公里数,预计目的地 // 写入车辆公里数,预计目的地
vehicle.setMileageLastUpdate(MileageLift1); vehicle.setMileageLastUpdate(MileageLift1);
vehicleMapper.updateByPrimaryKeySelective(vehicle);
// 修改车辆状态,确认是空闲状态 // 修改车辆状态,确认是空闲状态
int result = vehicleMapper.updateStatusByIdAndStatus(departureVo.getVehicleId(), VehicleStatus.DEPARTURE.getCode(), int result = vehicleMapper.updateStatusByIdAndStatus(departureVo.getVehicleId(), VehicleStatus.DEPARTURE.getCode(),
VehicleStatus.NORMAL.getCode()); VehicleStatus.NORMAL.getCode());
//修改预约记录状态 //修改预约记录状态
VehicleBookRecord vehicleBookRecord = null; VehicleBookRecord vehicleBookRecord = null;
if (departureVo.getBookRecordId() != null) { if (departureVo.getBookRecordId() != null) {
vehicleBookRecord = vehicleBookRecordBiz.selectById(departureVo.getBookRecordId()); vehicleBookRecord = vehicleBookRecordBiz.selectById(departureVo.getBookRecordId());
updateBookRecordStatus(vehicleBookRecord, 1); updateBookRecordStatus(vehicleBookRecord, 1);
} }
if (vehicleBookRecord != null) {
vehicle.setParkBranchCompanyId(vehicleBookRecord.getRetCompany());
}
vehicleMapper.updateByPrimaryKeySelective(vehicle);
VehicleDepartureLogVo vehicleDepartureLogVo = vehicleDepartureLogMapper.selectByBookRecordId(departureVo.getBookRecordId()); VehicleDepartureLogVo vehicleDepartureLogVo = vehicleDepartureLogMapper.selectByBookRecordId(departureVo.getBookRecordId());
if (vehicleDepartureLogVo != null) { if (vehicleDepartureLogVo != null) {
BeanUtil.copyProperties(departureVo, vehicleDepartureLogVo, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true)); BeanUtil.copyProperties(departureVo, vehicleDepartureLogVo, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
...@@ -208,9 +211,6 @@ public class VehicleActiveService { ...@@ -208,9 +211,6 @@ public class VehicleActiveService {
} }
// 写入车辆公里数,还车分公司id // 写入车辆公里数,还车分公司id
vehicle.setMileageLastUpdate(MileageRest1); vehicle.setMileageLastUpdate(MileageRest1);
if (vehicleBookRecord != null) {
vehicle.setParkBranchCompanyId(vehicleBookRecord.getRetCompany());
}
vehicleMapper.updateByPrimaryKeySelective(vehicle); vehicleMapper.updateByPrimaryKeySelective(vehicle);
// 出车记录 // 出车记录
VehicleDepartureLogVo departureLogVo = vehicleDepartureLogMapper.selectByBookRecordId(arrivalVo.getBookRecordId()); VehicleDepartureLogVo departureLogVo = vehicleDepartureLogMapper.selectByBookRecordId(arrivalVo.getBookRecordId());
......
...@@ -471,6 +471,12 @@ ...@@ -471,6 +471,12 @@
and (v1.book_start_date like CONCAT(#{selectedMonth}, "%") or v1.book_end_date like and (v1.book_start_date like CONCAT(#{selectedMonth}, "%") or v1.book_end_date like
CONCAT(#{selectedMonth}, "%")) CONCAT(#{selectedMonth}, "%"))
</if> </if>
<if test="bookStartDate != null">
and v1.book_start_date like CONCAT(#{bookStartDate}, "%")
</if>
<if test="bookEndDate != null">
and v1.book_end_date like CONCAT(#{bookEndDate}, "%")
</if>
<if test="numberPlate != null"> <if test="numberPlate != null">
and v3.number_plate like concat('%', #{numberPlate}, '%') and v3.number_plate like concat('%', #{numberPlate}, '%')
</if> </if>
...@@ -480,6 +486,9 @@ ...@@ -480,6 +486,9 @@
<if test="keywords != null and keywords != ''"> <if test="keywords != null and keywords != ''">
and (v3.number_plate like concat('%', #{keywords}, '%') or v3.code like concat('%', #{keywords}, '%')) and (v3.number_plate like concat('%', #{keywords}, '%') or v3.code like concat('%', #{keywords}, '%'))
</if> </if>
<if test="zoneId != null">
and bc3.zone_id = #{zoneId}
</if>
<if test="companyIds != null and companyIds.size > 0"> <if test="companyIds != null and companyIds.size > 0">
and (v1.lift_company in and (v1.lift_company in
<foreach collection="companyIds" item="id" open="(" separator="," close=")"> <foreach collection="companyIds" item="id" open="(" separator="," close=")">
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
SELECT r.* FROM ( SELECT r.* FROM (
select DISTINCT v.`id`, select DISTINCT v.`id`,
v.`code`, v.`code`,
(CASE WHEN #{status} != 0 THEN #{status} (CASE WHEN #{status} is not null THEN #{status}
ELSE v.status END) status , ELSE v.status END) status ,
v.number_plate, v.number_plate,
v.brand, v.brand,
...@@ -71,7 +71,6 @@ ...@@ -71,7 +71,6 @@
v.update_time, v.update_time,
v.model_id, v.model_id,
v.mileage_last_update as mileage, v.mileage_last_update as mileage,
c.val as useTypeName,
vm.name as vehicleType vm.name as vehicleType
<if test=" yearMonthAndParam != null "> <if test=" yearMonthAndParam != null ">
,vbi.booked_date ,vbi.booked_date
...@@ -90,7 +89,6 @@ ...@@ -90,7 +89,6 @@
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_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
LEFT JOIN vehicle_model vm ON v.model_id = vm.id LEFT JOIN vehicle_model vm ON v.model_id = vm.id
LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code
where where
v.is_del=0 v.is_del=0
<if test="mRangeDateEnd !=null"> <if test="mRangeDateEnd !=null">
...@@ -184,7 +182,7 @@ ...@@ -184,7 +182,7 @@
SELECT r.* FROM ( SELECT r.* FROM (
select DISTINCT v.`id`, select DISTINCT v.`id`,
v.`code`, v.`code`,
(CASE WHEN #{status} != 0 THEN #{status} (CASE WHEN #{status} is not null THEN #{status}
ELSE v.status END) status , ELSE v.status END) status ,
v.number_plate, v.number_plate,
v.brand, v.brand,
...@@ -216,7 +214,6 @@ ...@@ -216,7 +214,6 @@
v.update_time, v.update_time,
v.model_id, v.model_id,
v.mileage_last_update as mileage, v.mileage_last_update as mileage,
c.val as useTypeName,
vm.name as vehicleType vm.name as vehicleType
<if test=" yearMonthAndParam !=null "> <if test=" yearMonthAndParam !=null ">
,vbi.booked_date ,vbi.booked_date
...@@ -235,7 +232,6 @@ ...@@ -235,7 +232,6 @@
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_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
LEFT JOIN vehicle_model vm ON v.model_id = vm.id LEFT JOIN vehicle_model vm ON v.model_id = vm.id
LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code
where where
v.is_del=0 v.is_del=0
<if test="companyList != null"> <if test="companyList != null">
......
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