Commit 7c4fcab7 authored by libin's avatar libin

对比master分支修复

parent 54535445
...@@ -5,12 +5,8 @@ public class DictionaryKey { ...@@ -5,12 +5,8 @@ public class DictionaryKey {
/** /**
* 订单类型 * 订单类型
*/ */
public static final String APP_ORDER = "APP_ORDER"; public static final String APP_ORDER ="APP_ORDER";
/**
* 用途类型
*/
public static final String VEHICE_ORDER = "VEHICE_ORDER";
/** /**
* 违约类型 * 违约类型
...@@ -25,41 +21,36 @@ public class DictionaryKey { ...@@ -25,41 +21,36 @@ public class DictionaryKey {
/** /**
* IM类型 * IM类型
*/ */
public static final String IM_TYPE = "IM_TYPE"; public static final String IM_TYPE ="IM_TYPE";
/** /**
* IM限制条数 * IM限制条数
*/ */
public static final String MSG_LIMIT_NUMBER = "MSG_LIMIT_NUMBER"; public static final String MSG_LIMIT_NUMBER ="MSG_LIMIT_NUMBER";
/** /**
* 支付 * 支付
*/ */
public static final String UNIVERSAL_PAY = "UNIVERSAL_PAY"; public static final String UNIVERSAL_PAY ="UNIVERSAL_PAY";
/** /**
* 租车,旅游(省内、省外)退款 * 租车,旅游(省内、省外)退款
*/ */
public static final String RENT_REFUND = "RENT_REFUND"; public static final String RENT_REFUND ="RENT_REFUND";
public static final String TOUR_REFUND = "TOUR_REFUND"; public static final String TOUR_REFUND ="TOUR_REFUND";
public static final String TOUR_IN_REFUND = "TOUR_IN_REFUND"; public static final String TOUR_IN_REFUND ="TOUR_IN_REFUND";
/** /**
* 租车:公司司机租金、免赔费用、违章预备金 * 租车:公司司机租金、免赔费用、违章预备金
*/ */
public static final String DRIVER_PRICE = "DRIVER_PRICE"; public static final String DRIVER_PRICE ="DRIVER_PRICE";
public static final String DAMAGE_SAFE = "DAMAGE_SAFE"; public static final String DAMAGE_SAFE ="DAMAGE_SAFE";
public static final String ILLEGAL_RESERVE = "ILLEGAL_RESERVE"; public static final String ILLEGAL_RESERVE = "ILLEGAL_RESERVE";
public static final String RENT_TIME_BUFFER = "RENT_TIME_BUFFER"; public static final String RENT_TIME_BUFFER = "RENT_TIME_BUFFER";
/** /**
* 旅游:保险费用 * 旅游:保险费用
*/ */
public static final String INSURE_PRICE = "INSURE_PRICE"; public static final String INSURE_PRICE ="INSURE_PRICE";
/**
* 租车类型Code
*/
public static final String RESERVE="RESERVE";
/** /**
* 自动取消订单时间:租车、旅游 * 自动取消订单时间:租车、旅游
......
...@@ -108,7 +108,7 @@ public class DictionaryBiz extends BaseBiz<DictionaryMapper, Dictionary> { ...@@ -108,7 +108,7 @@ public class DictionaryBiz extends BaseBiz<DictionaryMapper, Dictionary> {
List<Dictionary> dictionaries = selectListAll(); List<Dictionary> dictionaries = selectListAll();
Map<String, Dictionary> dictionaryMap = dictionaries.parallelStream().collect(Collectors.toMap(dic -> dic.getType()+ "_"+ dic.getCode() Map<String, Dictionary> dictionaryMap = dictionaries.parallelStream().collect(Collectors.toMap(dic -> dic.getType()+ "_"+ dic.getCode()
, Function.identity(), (oldValue, newValue) -> newValue)); , Function.identity(), (oldValue, newValue) -> newValue));
dictionaryMap.forEach((k,v) ->{ dictionaryMap.forEach((k,v) -> {
v.setChildrens(buildTree(v.getId())); v.setChildrens(buildTree(v.getId()));
}); });
return dictionaryMap; return dictionaryMap;
......
package com.xxfc.platform.universal.service; package com.xxfc.platform.universal.service;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.SystemConfig; import com.github.wxiaoqi.security.common.util.process.SystemConfig;
import com.xxfc.platform.universal.constant.RedisKey; import com.xxfc.platform.universal.constant.RedisKey;
import com.xxfc.platform.universal.utils.ImgBase64Util; import com.xxfc.platform.universal.utils.ImgBase64Util;
...@@ -83,7 +84,7 @@ public class UploadService { ...@@ -83,7 +84,7 @@ public class UploadService {
file.mkdirs(); file.mkdirs();
} }
String str="/" + no + ".jpg"; String str="/" + no + ".jpg";
realFileRelPath = realFileRelPath+str; realFileRelPath = realFileRelPath+str;
filePath=filePath +str; filePath=filePath +str;
//将文件写入指定位置 //将文件写入指定位置
......
...@@ -16,7 +16,7 @@ public enum BookType { ...@@ -16,7 +16,7 @@ public enum BookType {
BOOKING(7,"预约中"), BOOKING(7,"预约中"),
DISABLE(8,"禁用"), DISABLE(8,"禁用"),
CUSTOMER_APPLY(9, "客户用车"), CUSTOMER_APPLY(9, "客户用车"),
OTHER(10, "其他"), OTHER(10, "其他"),
DISPATCH(11, "调度") DISPATCH(11, "调度")
; ;
/** /**
......
...@@ -16,14 +16,12 @@ import org.springframework.cloud.openfeign.FeignClient; ...@@ -16,14 +16,12 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.*;
import java.util.Map;
import java.util.Set;
/** /**
* Created by ace on 2017/9/15. * Created by ace on 2017/9/15.
*/ */
@FeignClient(name = "vehicle",contextId = "vh") @FeignClient(name = "vehicle", contextId = "vh")
public interface VehicleFeign { public interface VehicleFeign {
@GetMapping(value = "/vehicleModel/{id}") @GetMapping(value = "/vehicleModel/{id}")
public ObjectRestResponse<VehicleModel> get(@PathVariable(value = "id") int id); public ObjectRestResponse<VehicleModel> get(@PathVariable(value = "id") int id);
...@@ -35,7 +33,7 @@ public interface VehicleFeign { ...@@ -35,7 +33,7 @@ public interface VehicleFeign {
public RestResponse<Vehicle> findById(@RequestParam(value = "id") String id); public RestResponse<Vehicle> findById(@RequestParam(value = "id") String id);
@RequestMapping(value = "/vehicleInfo/getByIds", method = RequestMethod.GET) @RequestMapping(value = "/vehicleInfo/getByIds", method = RequestMethod.GET)
public RestResponse< List<Vehicle>> getByIds(@RequestParam(value = "ids") List<String> id); public RestResponse<List<Vehicle>> getByIds(@RequestParam(value = "ids") List<String> id);
//提车 //提车
@PostMapping("/active/small/departure") @PostMapping("/active/small/departure")
...@@ -55,7 +53,7 @@ public interface VehicleFeign { ...@@ -55,7 +53,7 @@ public interface VehicleFeign {
@RequestMapping(value = "/vehicleInfo/rent/book/vehicle", method = RequestMethod.POST) @RequestMapping(value = "/vehicleInfo/rent/book/vehicle", method = RequestMethod.POST)
public ObjectRestResponse<VehicleBookRecord> rentApplyVehicle(@RequestBody RentVehicleBookDTO rentVehicleBookDTO); public ObjectRestResponse<VehicleBookRecord> rentApplyVehicle(@RequestBody RentVehicleBookDTO rentVehicleBookDTO);
@RequestMapping(value ="/branchCompany/app/unauth/detail/{id}",method = RequestMethod.GET) @RequestMapping(value = "/branchCompany/app/unauth/detail/{id}", method = RequestMethod.GET)
public ObjectRestResponse<CompanyDetail> getCompanyDetail(@PathVariable(value = "id") Integer id); public ObjectRestResponse<CompanyDetail> getCompanyDetail(@PathVariable(value = "id") Integer id);
//租车拒绝预约 //租车拒绝预约
...@@ -72,14 +70,14 @@ public interface VehicleFeign { ...@@ -72,14 +70,14 @@ public interface VehicleFeign {
//获取分公司列表 //获取分公司列表
@GetMapping("/branchCompany/all") @GetMapping("/branchCompany/all")
public List<BranchCompany> companyAll( public List<BranchCompany> companyAll(
@RequestParam(value = "dataAll") Integer dataAll, @RequestParam(value = "dataAll") Integer dataAll,
@RequestParam(value = "dataCompany") String dataCompany, @RequestParam(value = "dataCompany") String dataCompany,
@RequestParam(value = "dataZone") String dataZone); @RequestParam(value = "dataZone") String dataZone);
//获取分公司列表 //获取分公司列表
@GetMapping("/company/base/app/unauth/companyId") @GetMapping("/company/base/app/unauth/companyId")
public BranchCompany companyId(@RequestParam(value = "name") String name); public BranchCompany companyId(@RequestParam(value = "name") String name);
@GetMapping("/branchCompany/entityList") @GetMapping("/branchCompany/entityList")
public ObjectRestResponse<List<BranchCompany>> branchCompanyEntityList(@RequestParam("entity") Map<String, Object> entity); public ObjectRestResponse<List<BranchCompany>> branchCompanyEntityList(@RequestParam("entity") Map<String, Object> entity);
...@@ -89,7 +87,7 @@ public interface VehicleFeign { ...@@ -89,7 +87,7 @@ public interface VehicleFeign {
@RequestMapping(value = "/user/license/company/getOne", method = RequestMethod.GET) @RequestMapping(value = "/user/license/company/getOne", method = RequestMethod.GET)
public RestResponse<VehicleUserLicense> getOne( public RestResponse<VehicleUserLicense> getOne(
@RequestParam(value = "id", defaultValue = "0") Integer id) throws Exception ; @RequestParam(value = "id", defaultValue = "0") Integer id) throws Exception;
@RequestMapping(value = "/user/license/multi", method = RequestMethod.GET) @RequestMapping(value = "/user/license/multi", method = RequestMethod.GET)
public ObjectRestResponse<List<VehicleUserLicense>> multi(@RequestBody QueryMultiDTO dto) throws Exception; public ObjectRestResponse<List<VehicleUserLicense>> multi(@RequestBody QueryMultiDTO dto) throws Exception;
...@@ -99,6 +97,7 @@ public interface VehicleFeign { ...@@ -99,6 +97,7 @@ public interface VehicleFeign {
/** /**
* 获取优质车型接口 * 获取优质车型接口
*
* @param page * @param page
* @param limit * @param limit
* @return 返回 * @return 返回
...@@ -108,13 +107,16 @@ public interface VehicleFeign { ...@@ -108,13 +107,16 @@ public interface VehicleFeign {
/** /**
* 根据一个id获取城市 * 根据一个id获取城市
*
* @param id * @param id
* @return * @return
*/ */
@GetMapping("/sysRegion/getSysRegionById/{id}") @GetMapping("/sysRegion/getSysRegionById/{id}")
RestResponse getSysRegionById(@PathVariable(value = "id") Integer id); RestResponse getSysRegionById(@PathVariable(value = "id") Integer id);
/** /**
* 多个城市code获取城市代码 * 多个城市code获取城市代码
*
* @param idSet * @param idSet
* @return * @return
*/ */
...@@ -123,6 +125,7 @@ public interface VehicleFeign { ...@@ -123,6 +125,7 @@ public interface VehicleFeign {
/** /**
* 获取公司所在的城市 * 获取公司所在的城市
*
* @param zoneList * @param zoneList
* @param companyList * @param companyList
* @return * @return
...@@ -149,8 +152,10 @@ public interface VehicleFeign { ...@@ -149,8 +152,10 @@ public interface VehicleFeign {
//cata //cata
/** /**
* 查询当前车型拥有的标签 * 查询当前车型拥有的标签
*
* @param ids * @param ids
* @return * @return
*/ */
...@@ -162,6 +167,7 @@ public interface VehicleFeign { ...@@ -162,6 +167,7 @@ public interface VehicleFeign {
/** /**
* 根据位置查询 * 根据位置查询
*
* @param branchCompanyFindDTO * @param branchCompanyFindDTO
* @return * @return
*/ */
......
...@@ -271,7 +271,7 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany ...@@ -271,7 +271,7 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
//文件存放路径 //文件存放路径
String filePath = baseUploadPath + realFileRelPath; String filePath = baseUploadPath + realFileRelPath;
//将文件写入指定位置 //将文件写入指定位置
// FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath)); FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath));
return RestResponse.suc(realFileRelPath); return RestResponse.suc(realFileRelPath);
} }
......
...@@ -225,7 +225,7 @@ public class BranchCompanyStockService { ...@@ -225,7 +225,7 @@ public class BranchCompanyStockService {
//文件存放路径 //文件存放路径
String filePath = baseUploadPath + realFileRelPath; String filePath = baseUploadPath + realFileRelPath;
//将文件写入指定位置 //将文件写入指定位置
// FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath)); FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath));
return RestResponse.suc(realFileRelPath); return RestResponse.suc(realFileRelPath);
} }
......
...@@ -176,7 +176,7 @@ public class CampsiteBiz extends BaseBiz<CampsiteMapper, Campsite> { ...@@ -176,7 +176,7 @@ public class CampsiteBiz extends BaseBiz<CampsiteMapper, Campsite> {
//文件存放路径 //文件存放路径
String filePath = baseUploadPath + realFileRelPath; String filePath = baseUploadPath + realFileRelPath;
//将文件写入指定位置 //将文件写入指定位置
// FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath)); FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath));
return RestResponse.suc(realFileRelPath); return RestResponse.suc(realFileRelPath);
} }
......
...@@ -129,7 +129,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -129,7 +129,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
//文件存放路径 //文件存放路径
String filePath = baseUploadPath + realFileRelPath; String filePath = baseUploadPath + realFileRelPath;
//将文件写入指定位置 //将文件写入指定位置
// FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath)); FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath));
return RestResponse.suc(realFileRelPath); return RestResponse.suc(realFileRelPath);
} }
......
...@@ -8,17 +8,11 @@ import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface; ...@@ -8,17 +8,11 @@ import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.JsonUtil;
import com.github.wxiaoqi.security.common.util.Query; import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.gson.JsonObject;
import com.xxfc.platform.order.pojo.order.OrderPageVO;
import com.xxfc.platform.universal.constant.DictionaryKey;
import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxfc.platform.universal.utils.DateUtil; import com.xxfc.platform.universal.utils.DateUtil;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.BookType; import com.xxfc.platform.vehicle.constant.BookType;
...@@ -45,15 +39,11 @@ import org.springframework.stereotype.Service; ...@@ -45,15 +39,11 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants.DATA_ALL_FALSE; import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants.DATA_ALL_FALSE;
import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
import static com.xxfc.platform.universal.constant.DictionaryKey.VEHICE_ORDER;
import static com.xxfc.platform.universal.constant.DictionaryKey.RESERVE;
@Service @Service
@Slf4j @Slf4j
...@@ -96,9 +86,6 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -96,9 +86,6 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
@Autowired @Autowired
VehicleBiz vehicleBiz; VehicleBiz vehicleBiz;
@Autowired
ThirdFeign thirdFeign;
@Override @Override
public UserFeign getUserFeign() { public UserFeign getUserFeign() {
return userFeign; return userFeign;
...@@ -213,7 +200,7 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -213,7 +200,7 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
} }
} }
vehicleBookRecordQueryVo.setCompanyIds(companyList); vehicleBookRecordQueryVo.setCompanyIds(companyList);
Query query = new Query(vehicleBookRecordQueryVo); Query query = new Query(vehicleBookRecordQueryVo);
PageDataVO<VehicleBookRecordVo> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.getBookRecordInfo(query.getSuper())); PageDataVO<VehicleBookRecordVo> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.getBookRecordInfo(query.getSuper()));
getupKeeps(pageDataVO.getData()); getupKeeps(pageDataVO.getData());
return RestResponse.suc(pageDataVO); return RestResponse.suc(pageDataVO);
...@@ -232,7 +219,6 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -232,7 +219,6 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
} }
} }
} }
/** /**
* 获取随身物品 * 获取随身物品
*/ */
...@@ -249,7 +235,7 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -249,7 +235,7 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
} }
if (vehicleBookRecordVo.getBookUser() != null) { if (vehicleBookRecordVo.getBookUser() != null) {
UserDTO userDTO = userFeign.userinfoByUid(vehicleBookRecordVo.getBookUser()).getData(); UserDTO userDTO = userFeign.userinfoByUid(vehicleBookRecordVo.getBookUser()).getData();
if (userDTO != null) { if(userDTO != null) {
BranchCompany branchCompany = branchCompanyBiz.getById(userDTO.getCompanyId()); BranchCompany branchCompany = branchCompanyBiz.getById(userDTO.getCompanyId());
if (branchCompany != null) { if (branchCompany != null) {
vehicleBookRecordVo.setUserCompanyName(branchCompany.getName()); vehicleBookRecordVo.setUserCompanyName(branchCompany.getName());
...@@ -262,11 +248,11 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -262,11 +248,11 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
public ObjectRestResponse update(BookRecordUpdateLog bookRecordUpdateLog) { public ObjectRestResponse update(BookRecordUpdateLog bookRecordUpdateLog) {
VehicleBookRecord vehicleBookRecord = selectById(bookRecordUpdateLog.getBookRecordId()); VehicleBookRecord vehicleBookRecord = selectById(bookRecordUpdateLog.getBookRecordId());
if (vehicleBookRecord != null) { if(vehicleBookRecord != null) {
vehicleBookRecord.setRetCompany(bookRecordUpdateLog.getNewRetCompanyId()); vehicleBookRecord.setRetCompany(bookRecordUpdateLog.getNewRetCompanyId());
int a = updateSelectiveByIdRe(vehicleBookRecord); int a = updateSelectiveByIdRe(vehicleBookRecord);
log.info(vehicleBookRecord.toString()); log.info(vehicleBookRecord.toString());
if (a <= 0) { if(a <= 0) {
return ObjectRestResponse.createDefaultFail(); return ObjectRestResponse.createDefaultFail();
} }
//出行中才修改车辆停靠分公司 //出行中才修改车辆停靠分公司
...@@ -281,7 +267,7 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -281,7 +267,7 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
// } // }
return bookRecordUpdateLogBiz.save(bookRecordUpdateLog); return bookRecordUpdateLogBiz.save(bookRecordUpdateLog);
} else { } else {
return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_BOOK_RECORD_IS_NOT_EXIST.getCode(), ResCode.VEHICLE_BOOK_RECORD_IS_NOT_EXIST.getDesc()); return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_BOOK_RECORD_IS_NOT_EXIST.getCode(), ResCode.VEHICLE_BOOK_RECORD_IS_NOT_EXIST.getDesc());
} }
} }
...@@ -333,32 +319,32 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -333,32 +319,32 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
} }
public ObjectRestResponse addBookRecord(VehicleBookRecord vehicleBookRecord) { public ObjectRestResponse addBookRecord(VehicleBookRecord vehicleBookRecord) {
if (vehicleBookRecord == null) { if (vehicleBookRecord == null) {
return ObjectRestResponse.paramIsEmpty(); return ObjectRestResponse.paramIsEmpty();
} }
save(vehicleBookRecord); save(vehicleBookRecord);
if (vehicleBookRecord != null) { if (vehicleBookRecord != null) {
//添加交还车记录 //添加交还车记录
VehicleDepartureLog vehicleDepartureLog = new VehicleDepartureLog(); VehicleDepartureLog vehicleDepartureLog = new VehicleDepartureLog();
vehicleDepartureLog.setBookRecordId(vehicleBookRecord.getId()); vehicleDepartureLog.setBookRecordId(vehicleBookRecord.getId());
vehicleDepartureLog.setArrivalBranchCompanyId(vehicleBookRecord.getRetCompany()); vehicleDepartureLog.setArrivalBranchCompanyId(vehicleBookRecord.getRetCompany());
vehicleDepartureLog.setArrivalRemark("后台修改停靠分公司,车辆调度"); vehicleDepartureLog.setArrivalRemark("后台修改停靠分公司,车辆调度");
vehicleDepartureLog.setArrivalTime(new Date()); vehicleDepartureLog.setArrivalTime(new Date());
vehicleDepartureLog.setCheckMan(vehicleBookRecord.getBookUserName()); vehicleDepartureLog.setCheckMan(vehicleBookRecord.getBookUserName());
vehicleDepartureLog.setCheckManTel(vehicleBookRecord.getBookUserName()); vehicleDepartureLog.setCheckManTel(vehicleBookRecord.getBookUserName());
vehicleDepartureLog.setCreateTime(new Date()); vehicleDepartureLog.setCreateTime(new Date());
vehicleDepartureLog.setDepartureBranchCompanyId(vehicleBookRecord.getLiftCompany()); vehicleDepartureLog.setDepartureBranchCompanyId(vehicleBookRecord.getLiftCompany());
vehicleDepartureLog.setDepartureRemark("后台修改停靠分公司,车辆调度"); vehicleDepartureLog.setDepartureRemark("后台修改停靠分公司,车辆调度");
vehicleDepartureLog.setDepartureTime(new Date()); vehicleDepartureLog.setDepartureTime(new Date());
vehicleDepartureLog.setRecycleMan(vehicleBookRecord.getBookUserName()); vehicleDepartureLog.setRecycleMan(vehicleBookRecord.getBookUserName());
vehicleDepartureLog.setRecycleManTel(vehicleBookRecord.getBookUserName()); vehicleDepartureLog.setRecycleManTel(vehicleBookRecord.getBookUserName());
vehicleDepartureLog.setState(1); vehicleDepartureLog.setState(1);
vehicleDepartureLog.setVehicleId(vehicleBookRecord.getVehicleId()); vehicleDepartureLog.setVehicleId(vehicleBookRecord.getVehicleId());
vehicleDepartureLog.setUse("调度"); vehicleDepartureLog.setUse("调度");
vehicleDepartureLog.setUser(vehicleBookRecord.getBookUserName()); vehicleDepartureLog.setUser(vehicleBookRecord.getBookUserName());
vehicleDepartureLog.setUserTel(vehicleBookRecord.getBookUserName()); vehicleDepartureLog.setUserTel(vehicleBookRecord.getBookUserName());
vehicleActiveService.save(vehicleDepartureLog); vehicleActiveService.save(vehicleDepartureLog);
} }
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
...@@ -718,13 +704,4 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -718,13 +704,4 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
} }
return data.subList(fromIndex, toIndex); return data.subList(fromIndex, toIndex);
} }
/**
* 车辆用途字典查询
*/
public ObjectRestResponse<OrderPageVO> getOrderDetail() {
Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData();
String reserveType = dictionaryMap.get(VEHICE_ORDER + "_" +RESERVE).getName();
return ObjectRestResponse.succ(reserveType);
}
} }
...@@ -34,17 +34,17 @@ public class VehicleDepartureService extends BaseBiz<VehicleDepartureLogMapper, ...@@ -34,17 +34,17 @@ public class VehicleDepartureService extends BaseBiz<VehicleDepartureLogMapper,
@Autowired @Autowired
VehicleMapper vehicleMapper; VehicleMapper vehicleMapper;
public PageInfo<VehicleDepartureLogVo> page(String numberPlate,Integer code,Integer zoneId,Integer departureId,Integer arrivalBranchCompanyId,String use,String startTime,String endTime, Integer page, Integer limit) { public PageInfo<VehicleDepartureLogVo> page(String numberPlate,Integer code,Integer zoneId,Integer departureId, String startTime,String endTime, Integer page, Integer limit) {
PageHelper.startPage(page, limit); PageHelper.startPage(page, limit);
return new PageInfo<>(mapper.selectVoAll(numberPlate,code,zoneId,departureId,startTime, endTime,arrivalBranchCompanyId,use)); return new PageInfo<>(mapper.selectVoAll(numberPlate,code,zoneId,departureId,startTime, endTime));
} }
public PageInfo<VehicleDepartureLogVo> pageNotAllData(String numberPlate,Integer code,Integer zoneId,Integer departureId, String startTime,String endTime, Integer arrivalBranchCompanyId,String use, Integer page, Integer limit, List<Integer> companyList) { public PageInfo<VehicleDepartureLogVo> pageNotAllData(String numberPlate,Integer code,Integer zoneId,Integer departureId, String startTime,String endTime, Integer page, Integer limit, List<Integer> companyList) {
PageHelper.startPage(page, limit); PageHelper.startPage(page, limit);
if (companyList == null || companyList.size() == 0) { if (companyList == null || companyList.size() == 0) {
companyList = Arrays.asList(-1); companyList = Arrays.asList(-1);
} }
return new PageInfo<>(mapper.selectVoAllNotAllData(numberPlate,code,zoneId,departureId,startTime, endTime, companyList,arrivalBranchCompanyId,use)); return new PageInfo<>(mapper.selectVoAllNotAllData(numberPlate,code,zoneId,departureId,startTime, endTime, companyList));
} }
public PageInfo<VehicleDepartureLogVo> findByVehicle(String vehicleId, Integer page, Integer limit) { public PageInfo<VehicleDepartureLogVo> findByVehicle(String vehicleId, Integer page, Integer limit) {
......
...@@ -15,18 +15,14 @@ public interface VehicleDepartureLogMapper extends BaseMapper<VehicleDepartureLo ...@@ -15,18 +15,14 @@ public interface VehicleDepartureLogMapper extends BaseMapper<VehicleDepartureLo
VehicleDepartureLog selectLastByVehicleId(String vehicleId); VehicleDepartureLog selectLastByVehicleId(String vehicleId);
List<VehicleDepartureLogVo> selectByVehicleId(String vehicleId); List<VehicleDepartureLogVo> selectByVehicleId(String vehicleId);
List<VehicleDepartureLog> selectByVehicle(String vehicleId); List<VehicleDepartureLog> selectByVehicle(String vehicleId);
List<VehicleDepartureLogVo> selectVoAll(@Param("numberPlate") String numberPlate, List<VehicleDepartureLogVo> selectVoAll(@Param("numberPlate") String numberPlate,
@Param("code") Integer code, @Param("code") Integer code,
@Param("zoneId") Integer zoneId, @Param("zoneId") Integer zoneId,
@Param("departureId") Integer departureId, @Param("departureId") Integer departureId,
@Param("startTime") String startTime, @Param("startTime") String startTime,
@Param("endTime") String endTime, @Param("endTime") String endTime
@Param("arrivalBranchCompanyId") Integer arrivalBranchCompanyId, );
@Param("use") String user
);
List<VehicleDepartureLogVo> selectVoAllNotAllData(@Param("numberPlate") String numberPlate, List<VehicleDepartureLogVo> selectVoAllNotAllData(@Param("numberPlate") String numberPlate,
@Param("code") Integer code, @Param("code") Integer code,
...@@ -34,15 +30,12 @@ public interface VehicleDepartureLogMapper extends BaseMapper<VehicleDepartureLo ...@@ -34,15 +30,12 @@ public interface VehicleDepartureLogMapper extends BaseMapper<VehicleDepartureLo
@Param("departureId") Integer departureId, @Param("departureId") Integer departureId,
@Param("startTime") String startTime, @Param("startTime") String startTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("companyList") List<Integer> companyList, @Param("companyList") List<Integer> companyList);
@Param("arrivalBranchCompanyId") Integer arrivalBranchCompanyId,
@Param("use") String user);
Integer selectMileageByVehicleId(String vehicleId); Integer selectMileageByVehicleId(String vehicleId);
String selectDayByVehicleId(String vehicleId); String selectDayByVehicleId(String vehicleId);
VehicleDepartureLogVo selectByBookRecordId(Long bookRecordId); VehicleDepartureLogVo selectByBookRecordId(Long bookRecordId);
Integer selectAllDepartureLog(Map<String, Object> param); Integer selectAllDepartureLog(Map<String, Object> param);
} }
...@@ -201,7 +201,7 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> { ...@@ -201,7 +201,7 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
} }
@GetMapping("/findByAreaId") @GetMapping("/findByAreaId")
public List<Integer> findCompanyIdsByAreaId(@RequestParam(value = "areaId",required = false) Integer areaId){ public List<Integer> findCompanyIdsByAreaId(@RequestParam(value = "areaId") Integer areaId){
return baseBiz.selectCompanyIdsByAreaId(areaId); return baseBiz.selectCompanyIdsByAreaId(areaId);
} }
......
...@@ -600,10 +600,4 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use ...@@ -600,10 +600,4 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
public List<String> findbyPlateNumberAndVehicleCod(@RequestParam(value = "plateNumber",required = false) String plateNumber,@RequestParam(value = "vehicleCode",required = false) String vehicleCode){ public List<String> findbyPlateNumberAndVehicleCod(@RequestParam(value = "plateNumber",required = false) String plateNumber,@RequestParam(value = "vehicleCode",required = false) String vehicleCode){
return vehicleBiz.findbyPlateNumberAndVehicleCod(plateNumber,vehicleCode); return vehicleBiz.findbyPlateNumberAndVehicleCod(plateNumber,vehicleCode);
} }
@GetMapping("/app/unauth/findDictionaryMaps")
@IgnoreUserToken
public ObjectRestResponse findbyDictionaryMaps(@RequestParam(value = "plateNumber",required = false) String plateNumber,@RequestParam(value = "vehicleCode",required = false) String vehicleCode){
return vehicleBookRecordBiz.getOrderDetail();
}
} }
...@@ -44,13 +44,10 @@ public class VehicleDepartureController { ...@@ -44,13 +44,10 @@ public class VehicleDepartureController {
* @return * @return
*/ */
@GetMapping("page") @GetMapping("page")
@IgnoreUserToken
public RestResponse page(String numberPlate, public RestResponse page(String numberPlate,
@RequestParam(value = "code", required = false) Integer code, String startTime, String endTime, @RequestParam(value = "code", required = false) Integer code, String startTime, String endTime,
@RequestParam(value = "zoneId", required = false) Integer zoneId, @RequestParam(value = "zoneId",required = false) Integer zoneId,
@RequestParam(value = "departureId", required = false) Integer departureId, @RequestParam(value = "departureId", required = false) Integer departureId,
@RequestParam(value = "use", required = false) String use,
@RequestParam(value = "arrivalBranchCompanyId", required = false) Integer arrivalBranchCompanyId,
Integer page, Integer limit, HttpServletRequest request) { Integer page, Integer limit, HttpServletRequest request) {
if (page == null || limit == null) { if (page == null || limit == null) {
page = 1; page = 1;
...@@ -60,16 +57,15 @@ public class VehicleDepartureController { ...@@ -60,16 +57,15 @@ public class VehicleDepartureController {
if (userDTO != null) { if (userDTO != null) {
if (userDTO.getDataAll() == 2) { if (userDTO.getDataAll() == 2) {
List<Integer> companyList = vehicleBiz.dataCompany(userDTO.getDataZone(), userDTO.getDataCompany()); List<Integer> companyList = vehicleBiz.dataCompany(userDTO.getDataZone(), userDTO.getDataCompany());
return RestResponse.data(vehicleDepartureService.pageNotAllData(numberPlate, code, zoneId, departureId,startTime, endTime,arrivalBranchCompanyId,use,page, limit, companyList)); return RestResponse.data(vehicleDepartureService.pageNotAllData(numberPlate, code, zoneId,departureId, startTime, endTime, page, limit, companyList));
} }
} }
return RestResponse.suc(vehicleDepartureService.page(numberPlate, code, zoneId, departureId,arrivalBranchCompanyId, use, startTime, endTime, page, limit)); return RestResponse.suc(vehicleDepartureService.page(numberPlate, code, zoneId,departureId, startTime, endTime, page, limit));
} }
@GetMapping("small/page") @GetMapping("small/page")
@IgnoreUserToken @IgnoreUserToken
public RestResponse pageBySmall(String numberPlate, @RequestParam(value = "code", required = false) public RestResponse pageBySmall(String numberPlate, @RequestParam(value = "code", required = false) Integer code, String startTime, String endTime,Integer page, Integer limit, Integer uid, HttpServletRequest request) {
Integer code, String startTime, String endTime, Integer page, Integer limit, Integer uid, HttpServletRequest request) {
if (page == null || limit == null) { if (page == null || limit == null) {
page = 1; page = 1;
limit = 10; limit = 10;
...@@ -78,10 +74,10 @@ public class VehicleDepartureController { ...@@ -78,10 +74,10 @@ public class VehicleDepartureController {
if (userDTO != null) { if (userDTO != null) {
if (userDTO.getDataAll() == 2) { if (userDTO.getDataAll() == 2) {
List<Integer> companyList = vehicleBiz.dataCompany(userDTO.getDataZone(), userDTO.getDataCompany()); List<Integer> companyList = vehicleBiz.dataCompany(userDTO.getDataZone(), userDTO.getDataCompany());
return RestResponse.data(vehicleDepartureService.pageNotAllData(numberPlate, code, null, null, startTime, endTime, page, limit, companyList)); return RestResponse.data(vehicleDepartureService.pageNotAllData(numberPlate, code, null,null, startTime,endTime, page, limit, companyList));
} }
} }
return RestResponse.suc(vehicleDepartureService.page(numberPlate, code, null, null,null ,null,startTime, endTime, page, limit)); return RestResponse.suc(vehicleDepartureService.page(numberPlate, code, null,null, startTime,endTime, page, limit));
} }
/** /**
......
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.xxfc.platform.vehicle.mapper.VehicleDepartureLogMapper"> <mapper namespace="com.xxfc.platform.vehicle.mapper.VehicleDepartureLogMapper" >
<resultMap id="searchBookRecord" type="com.xxfc.platform.vehicle.pojo.DepartureLogVo"> <resultMap id="searchBookRecord" type="com.xxfc.platform.vehicle.pojo.DepartureLogVo">
<result column="book_record_id" property="bookRecordId" jdbcType="INTEGER" javaType="java.lang.Integer"/> <result column="book_record_id" property="bookRecordId" jdbcType="INTEGER" javaType="java.lang.Integer"/>
...@@ -21,16 +21,14 @@ ...@@ -21,16 +21,14 @@
order by create_time desc order by create_time desc
</select> </select>
<select id="selectByVehicle" parameterType="java.lang.String" <select id="selectByVehicle" parameterType="java.lang.String" resultType="com.xxfc.platform.vehicle.entity.VehicleDepartureLog">
resultType="com.xxfc.platform.vehicle.entity.VehicleDepartureLog">
select vehicle_departure_log.* select vehicle_departure_log.*
from vehicle_departure_log from vehicle_departure_log
where vehicle_id = #{vehicleId} where vehicle_id = #{vehicleId}
order by create_time desc order by create_time desc
</select> </select>
<select id="selectByBookRecordId" parameterType="java.lang.Long" <select id="selectByBookRecordId" parameterType="java.lang.Long" resultType="com.xxfc.platform.vehicle.pojo.VehicleDepartureLogVo">
resultType="com.xxfc.platform.vehicle.pojo.VehicleDepartureLogVo">
select v.*, bc.name as departureName,bc1.name as arrivalName select v.*, bc.name as departureName,bc1.name as arrivalName
from vehicle_departure_log v from vehicle_departure_log v
LEFT JOIN branch_company bc ON v.departure_branch_company_id = bc.id LEFT JOIN branch_company bc ON v.departure_branch_company_id = bc.id
...@@ -40,7 +38,7 @@ ...@@ -40,7 +38,7 @@
</select> </select>
<select id="selectAllDepartureLog" resultType="java.lang.Integer" parameterType="Map"> <select id="selectAllDepartureLog" resultType="java.lang.Integer" parameterType="Map">
SELECT SELECT
count(*) count(*)
FROM FROM
vehicle_departure_log v1 vehicle_departure_log v1
LEFT JOIN vehicle_book_record v2 on v1.book_record_id = v2.id LEFT JOIN vehicle_book_record v2 on v1.book_record_id = v2.id
...@@ -90,21 +88,15 @@ ...@@ -90,21 +88,15 @@
<select id="selectVoAll" resultType="com.xxfc.platform.vehicle.pojo.VehicleDepartureLogVo"> <select id="selectVoAll" resultType="com.xxfc.platform.vehicle.pojo.VehicleDepartureLogVo">
select vehicle_departure_log.*,vehicle.number_plate, select vehicle_departure_log.*,vehicle.number_plate,
/* IFNULL(DATEDIFF(vehicle_departure_log.arrival_time,vehicle_departure_log.departure_time),0)*/ /* IFNULL(DATEDIFF(vehicle_departure_log.arrival_time,vehicle_departure_log.departure_time),0)*/
CONCAT(IFNULL(floor((unix_timestamp(vehicle_departure_log.arrival_time) - CONCAT(IFNULL(floor((unix_timestamp(vehicle_departure_log.arrival_time) - unix_timestamp(vehicle_departure_log.departure_time)) / 86400),0),'天',
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)
IFNULL(floor(IF((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),'小时')
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,bc.name as departureName,bc1.name as arrivalName, 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) 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
as mileage
from vehicle_departure_log from vehicle_departure_log
left join vehicle on vehicle_departure_log.vehicle_id = vehicle.id 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 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 LEFT JOIN branch_company bc1 ON vehicle_departure_log.arrival_branch_company_id = bc1.id
LEFT JOIN vehicle_book_record bc2 ON vehicle_departure_log.book_record_id = bc2.id
<trim prefix="where"> <trim prefix="where">
1=1 1=1
<if test="numberPlate != null and numberPlate != ''"> <if test="numberPlate != null and numberPlate != ''">
...@@ -115,22 +107,16 @@ ...@@ -115,22 +107,16 @@
vehicle_departure_log.departure_time &gt;= str_to_date(#{startTime}, '%Y-%m-%d %H') vehicle_departure_log.departure_time &gt;= str_to_date(#{startTime}, '%Y-%m-%d %H')
</if> </if>
<if test="endTime != null and endTime != ''"> <if test="endTime != null and endTime != ''">
and vehicle_departure_log.arrival_time &gt;= str_to_date(#{endTime}, '%Y-%m-%d %H') and vehicle_departure_log.arrival_time &gt;= str_to_date(#{endTime}, '%Y-%m-%d %H')
</if> </if>
<if test="code!=null"> <if test="code!=null">
and vehicle.code=#{code} and vehicle.code=#{code}
</if> </if>
<if test="zoneId!=null"> <if test="zoneId!=null">
and bc.zone_id=#{zoneId} and bc.zone_id=#{zoneId}
</if> </if>
<if test="departureId!=null"> <if test="departureId!=null">
and vehicle_departure_log.departure_branch_company_id=#{departureId} and vehicle_departure_log.departure_branch_company_id=#{departureId}
</if>
<if test="use!=null">
and bc2.use=#{use}
</if>
<if test="arrivalBranchCompanyId!=null">
and vehicle_departure_log.arrival_branch_company_id=#{arrivalBranchCompanyId}
</if> </if>
</trim> </trim>
order by create_time desc order by create_time desc
...@@ -138,21 +124,15 @@ ...@@ -138,21 +124,15 @@
<select id="selectVoAllNotAllData" resultType="com.xxfc.platform.vehicle.pojo.VehicleDepartureLogVo"> <select id="selectVoAllNotAllData" resultType="com.xxfc.platform.vehicle.pojo.VehicleDepartureLogVo">
select vehicle_departure_log.*,vehicle.number_plate, select vehicle_departure_log.*,vehicle.number_plate,
/*IFNULL(DATEDIFF(vehicle_departure_log.arrival_time,vehicle_departure_log.departure_time),0)*/ /*IFNULL(DATEDIFF(vehicle_departure_log.arrival_time,vehicle_departure_log.departure_time),0)*/
CONCAT(IFNULL(floor((unix_timestamp(vehicle_departure_log.arrival_time) - CONCAT(IFNULL(floor((unix_timestamp(vehicle_departure_log.arrival_time) - unix_timestamp(vehicle_departure_log.departure_time)) / 86400),0),'天',
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)
IFNULL(floor(IF((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),'小时')
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,bc.name as departureName,bc1.name as arrivalName, 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) 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
as mileage
from vehicle_departure_log from vehicle_departure_log
left join vehicle on vehicle_departure_log.vehicle_id = vehicle.id 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 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 LEFT JOIN branch_company bc1 ON vehicle_departure_log.arrival_branch_company_id = bc1.id
LEFT JOIN vehicle_book_record bc2 ON vehicle_departure_log.book_record_id = bc2.id
<trim prefix="where" suffixOverrides="and"> <trim prefix="where" suffixOverrides="and">
<if test="numberPlate != null and numberPlate != ''"> <if test="numberPlate != null and numberPlate != ''">
vehicle.number_plate = #{numberPlate} and vehicle.number_plate = #{numberPlate} and
...@@ -182,24 +162,18 @@ ...@@ -182,24 +162,18 @@
</if> </if>
<if test="endTime != null and endTime != ''"> <if test="endTime != null and endTime != ''">
and vehicle_departure_log.arrival_time >= str_to_date(#{endTime}, '%Y-%m-%d %H') and vehicle_departure_log.arrival_time >= str_to_date(#{endTime}, '%Y-%m-%d %H')
or TO_DAYS(vehicle_departure_log.arrival_time)=TO_DAYS(str_to_date(#{endTime}, '%Y-%m-%d %H')) or TO_DAYS(vehicle_departure_log.arrival_time)=TO_DAYS(str_to_date(#{endTime}, '%Y-%m-%d %H'))
or vehicle_departure_log.arrival_time is null or vehicle_departure_log.arrival_time is null
</if> </if>
<if test="code!=null"> <if test="code!=null">
and vehicle.code=#{code} and vehicle.code=#{code}
</if> </if>
<if test="zoneId!=null"> <if test="zoneId!=null">
and bc.zone_id=#{zoneId} and bc.zone_id=#{zoneId}
</if> </if>
<if test="departureId!=null"> <if test="departureId!=null">
and vehicle_departure_log.departure_branch_company_id=#{departureId} and vehicle_departure_log.departure_branch_company_id=#{departureId}
</if>
<if test="use!=null">
and bc2.use=#{use}
</if>
<if test="arrivalBranchCompanyId!=null">
and vehicle_departure_log.arrival_branch_company_id=#{arrivalBranchCompanyId}
</if> </if>
</trim> </trim>
order by create_time desc order by create_time desc
......
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