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