Commit 3cd4d3a9 authored by youjj's avatar youjj

车辆管理相关修改

parent cba67f5a
......@@ -56,8 +56,9 @@ public class VehicleActiveService {
ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getCode());
}
// 写入车辆公里数
// 写入车辆公里数,预计目的地
vehicle.setMileageLastUpdate(departureVo.getMileage());
vehicle.setExpectDestinationBranchCompanyId(departureVo.getExpectArrivalBranchCompanyId());
vehicleMapper.updateByPrimaryKeySelective(vehicle);
// 修改车辆状态,确认是空闲状态
......@@ -100,8 +101,10 @@ public class VehicleActiveService {
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
}
// 写入车辆公里数
// 写入车辆公里数,还车分公司id
vehicle.setMileageLastUpdate(arrivalVo.getMileage());
vehicle.setParkBranchCompanyId(arrivalVo.getArrivalBranchCompanyId());
vehicle.setExpectDestinationBranchCompanyId(0);
vehicleMapper.updateByPrimaryKeySelective(vehicle);
// 修改状态,确认是出车状态
......
......@@ -83,7 +83,6 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
/**
* 写入上传文件,返回相对路径
* @param file
* @param vehicleId
* @return
*/
public RestResponse<String> uploadDrivingLicense(MultipartFile file) throws Exception{
......@@ -793,6 +792,32 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
PageInfo<QueryVehicleVo> vehiclePageInfo = new PageInfo<>(vehicles);
return PageDataVo.pageInfo(vehiclePageInfo);
}
/**
* 按页查询(非所有数据,过滤分公司信息)
* @param vehiclePageQueryVo
* @return
* @throws Exception
*/
public PageDataVo<QueryVehicleVo> getByPageNotAllData(VehiclePageQueryVo vehiclePageQueryVo, List<Integer> companyList) throws Exception{
Map<String, Object> params = PropertyUtils.describe(vehiclePageQueryVo);
Integer pageSize = (Integer) params.get("limit");
params.remove("pageSize");
Integer pageNo = (Integer) params.get("page");
params.remove("pageNo");
//处理预定日期相关参数
adjustBookedInfoParam(params,vehiclePageQueryVo);
if (companyList != null && companyList.size() > 0) {
params.put("companyList", companyList);
} else {
params.put("companyList", Arrays.asList(-1));
}
PageHelper.startPage(pageNo,pageSize);
List<QueryVehicleVo> vehicles = mapper.getByPageNotAllData(params);
PageInfo<QueryVehicleVo> vehiclePageInfo = new PageInfo<>(vehicles);
return PageDataVo.pageInfo(vehiclePageInfo);
}
public List<Integer> dataCompany(String dataZone, String dataCompany) {
List<BranchCompany> zoneCompanys = branchCompanyBiz.dataCompany(dataZone);
......
......@@ -13,6 +13,9 @@ import com.xinxincaravan.caravan.vehicle.vo.VehicleDepartureStatisticDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
@Service
public class VehicleDepartureService {
......@@ -27,6 +30,14 @@ public class VehicleDepartureService {
return new PageInfo<>(vehicleDepartureLogMapper.selectVoAll(numberPlate));
}
public PageInfo<VehicleDepartureLogVo> pageNotAllData(String numberPlate, Integer page, Integer limit, List<Integer> companyList) {
PageHelper.startPage(page, limit);
if (companyList == null || companyList.size() == 0) {
companyList = Arrays.asList(-1);
}
return new PageInfo<>(vehicleDepartureLogMapper.selectVoAllNotAllData(numberPlate, companyList));
}
public PageInfo<VehicleDepartureLogVo> findByVehicle(String vehicleId, Integer page, Integer limit) {
PageHelper.startPage(page, limit);
return new PageInfo<>(vehicleDepartureLogMapper.selectByVehicleId(vehicleId));
......
......@@ -64,7 +64,8 @@ public class WebConfiguration implements WebMvcConfigurer {
ArrayList<String> list = new ArrayList<>();
String[] urls = {
"/vehicleInfo/**",
"/branchCompany/**"
"/branchCompany/**",
"/departure/**"
};
Collections.addAll(list, urls);
return list;
......
......@@ -127,5 +127,13 @@ public class Vehicle {
* 最后更新里程数
*/
private Integer mileageLastUpdate;
/**
* 停车分公司id
*/
private Integer parkBranchCompanyId;
/**
* 预计目的地分公司id
*/
private Integer expectDestinationBranchCompanyId;
}
\ No newline at end of file
......@@ -15,6 +15,8 @@ public interface VehicleDepartureLogMapper extends BaseMapper<VehicleDepartureLo
List<VehicleDepartureLogVo> selectVoAll(@Param("numberPlate") String numberPlate);
List<VehicleDepartureLogVo> selectVoAllNotAllData(@Param("numberPlate") String numberPlate, @Param("companyList") List<Integer> companyList);
Integer selectMileageByVehicleId(String vehicleId);
Integer selectDayByVehicleId(String vehicleId);
......
......@@ -12,6 +12,7 @@ import java.util.Map;
public interface VehicleMapper extends Mapper<Vehicle> {
public List<QueryVehicleVo> getByPage(Map<String,Object> params);
public List<QueryVehicleVo> getByPageNotAllData(Map<String,Object> params);
public int updateStatusById(Map<String,Object> params);
......
......@@ -19,6 +19,8 @@ import com.xinxincaravan.caravan.vehicle.constant.VehicleBookRecordStatus;
import com.xinxincaravan.caravan.vehicle.entity.Vehicle;
import com.xinxincaravan.caravan.vehicle.entity.VehicleBookInfo;
import com.xinxincaravan.caravan.vehicle.entity.VehicleBookRecord;
import com.xinxincaravan.caravan.vehicle.feign.UserFeign;
import com.xinxincaravan.caravan.vehicle.feign.dto.UserDTO;
import com.xinxincaravan.caravan.vehicle.vo.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
......@@ -36,6 +38,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@RestController
......@@ -47,52 +50,70 @@ public class VehicleController extends BaseController<VehicleBiz> {
@Autowired
private VehicleBookRecordBiz vehicleBookRecordBiz;
private static Integer MAX_DRIVING_LICENSE_SIZE = 10*1024*1024;//10M
@Autowired
VehicleBiz vehicleBiz;
@Autowired
UserFeign userFeign;
@Autowired
private UserAuthConfig userAuthConfig;
private static Integer MAX_DRIVING_LICENSE_SIZE = 10 * 1024 * 1024;//10M
public static final DateTimeFormatter DEFAULT_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
@RequestMapping(value ="/{id}",method = RequestMethod.GET)
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public RestResponse<Vehicle> get(@PathVariable String id) {
return RestResponse.data(baseBiz.get(id));
}
@RequestMapping(value ="",method = RequestMethod.POST)
public RestResponse add(@RequestBody List<AddOrUpdateVehicleVo> addOrUpdateVehicleVoList) throws Exception{
@RequestMapping(value = "", method = RequestMethod.POST)
public RestResponse add(@RequestBody List<AddOrUpdateVehicleVo> addOrUpdateVehicleVoList) throws Exception {
return baseBiz.add(addOrUpdateVehicleVoList);
}
@RequestMapping(value ="",method = RequestMethod.PUT)
public RestResponse update(@RequestBody List<AddOrUpdateVehicleVo> addOrUpdateVehicleVoList) throws Exception{
@RequestMapping(value = "", method = RequestMethod.PUT)
public RestResponse update(@RequestBody List<AddOrUpdateVehicleVo> addOrUpdateVehicleVoList) throws Exception {
return baseBiz.update(addOrUpdateVehicleVoList);
}
@RequestMapping(value ="",method = RequestMethod.DELETE)
public RestResponse discard(@RequestBody List<String> idList) throws Exception{
@RequestMapping(value = "", method = RequestMethod.DELETE)
public RestResponse discard(@RequestBody List<String> idList) throws Exception {
return baseBiz.discard(idList);
}
@RequestMapping(value ="/page",method = RequestMethod.GET)
public RestResponse<PageDataVo<QueryVehicleVo>> getByPage(@RequestParam String vehiclePageQueryVoJson) throws Exception{
@RequestMapping(value = "/page", method = RequestMethod.GET)
public RestResponse<PageDataVo<QueryVehicleVo>> getByPage(@RequestParam String vehiclePageQueryVoJson) throws Exception {
VehiclePageQueryVo vehiclePageQueryVo = null;
try {
vehiclePageQueryVo = JSON.parseObject(vehiclePageQueryVoJson,VehiclePageQueryVo.class);
vehiclePageQueryVo = JSON.parseObject(vehiclePageQueryVoJson, VehiclePageQueryVo.class);
UserDTO userDTO = userFeign.userinfoByToken(userAuthConfig.getToken(request)).getData();
if (userDTO != null) {
if (userDTO.getDataAll() == 2) {
List<Integer> companyList = vehicleBiz.dataCompany(userDTO.getDataZone(), userDTO.getDataCompany());
return RestResponse.data(baseBiz.getByPageNotAllData(vehiclePageQueryVo, companyList));
}
}
return RestResponse.data(baseBiz.getByPage(vehiclePageQueryVo));
} catch (JSONException ex) {
return RestResponse.code(ResCode.INVALID_REST_REQ_PARAM.getCode());
} catch (CustomIllegalParamException ex){
} catch (CustomIllegalParamException ex) {
return RestResponse.code(ResCode.INVALID_REST_REQ_PARAM.getCode());
}
}
@RequestMapping(value ="/upload/drivingLicense",method = RequestMethod.POST)
@RequestMapping(value = "/upload/drivingLicense", method = RequestMethod.POST)
public RestResponse uploadDrivingLicense(@RequestParam("file") MultipartFile file)
throws Exception{
throws Exception {
String contentType = file.getContentType(); //图片文件类型
// String fileName = file.getOriginalFilename(); //图片名字
if(!contentType.equals("image/jpeg") && !contentType.equals("image/gif")){
if (!contentType.equals("image/jpeg") && !contentType.equals("image/gif")) {
return RestResponse.code(ResCode.INVALID_REST_REQ_PARAM.getCode());
}
if(file.getSize() > MAX_DRIVING_LICENSE_SIZE){
if (file.getSize() > MAX_DRIVING_LICENSE_SIZE) {
return RestResponse.code(ResCode.INVALID_REST_REQ_PARAM.getCode());
}
return baseBiz.uploadDrivingLicense(file);
......@@ -100,55 +121,58 @@ public class VehicleController extends BaseController<VehicleBiz> {
@IgnoreUserToken
@RequestMapping(value="/download/drivingLicense",method=RequestMethod.GET) //匹配的是href中的download请求
@RequestMapping(value = "/download/drivingLicense", method = RequestMethod.GET) //匹配的是href中的download请求
public ResponseEntity<byte[]> downloadDrivingLicense(@RequestParam("realFileRelPath") String realFileRelPath) throws Exception {
return baseBiz.downloadDrivingLicense(realFileRelPath);
}
@RequestMapping(value ="/bookedInfo/{vehicleId}/{yearMonth}",method = RequestMethod.GET)
@RequestMapping(value = "/bookedInfo/{vehicleId}/{yearMonth}", method = RequestMethod.GET)
public RestResponse<VehicleBookInfo> getBookedInfo(@PathVariable String vehicleId, @PathVariable String yearMonth) {
return RestResponse.data(baseBiz.getByVehicleIdAndYearMonth(vehicleId,yearMonth));
return RestResponse.data(baseBiz.getByVehicleIdAndYearMonth(vehicleId, yearMonth));
}
@RequestMapping(value ="/bookedInfo/{vehicleId}",method = RequestMethod.GET)
@RequestMapping(value = "/bookedInfo/{vehicleId}", method = RequestMethod.GET)
public RestResponse<List<VehicleBookInfo>> getBookedInfo(@PathVariable String vehicleId) {
return RestResponse.data(baseBiz.getByVehicleIdAndYearMonth(vehicleId));
}
/**
* 申请预定车辆
*
* @param bookVehicleVo
* @return
*/
@RequestMapping(value ="/book/4employee",method = RequestMethod.POST)
public RestResponse<Integer> applyVehicle(@RequestBody BookVehicleVo bookVehicleVo) throws Exception{
@RequestMapping(value = "/book/4employee", method = RequestMethod.POST)
public RestResponse<Integer> applyVehicle(@RequestBody BookVehicleVo bookVehicleVo) throws Exception {
Integer operatorId = Integer.parseInt(BaseContextHandler.getUserID());
String userName = BaseContextHandler.getName();
return baseBiz.applyVehicle4Employee(operatorId,bookVehicleVo,userName);
return baseBiz.applyVehicle4Employee(operatorId, bookVehicleVo, userName);
}
/**
* 批准预定车辆预定
*
* @param bookRecordId
* @return
*/
@RequestMapping(value ="/book/4employee/prove/{bookRecordId}",method = RequestMethod.PUT)
public RestResponse<Integer> proveVehicleBooking(@PathVariable Long bookRecordId) throws Exception{
@RequestMapping(value = "/book/4employee/prove/{bookRecordId}", method = RequestMethod.PUT)
public RestResponse<Integer> proveVehicleBooking(@PathVariable Long bookRecordId) throws Exception {
Integer operatorId = Integer.parseInt(BaseContextHandler.getUserID());
String userName = BaseContextHandler.getName();
return baseBiz.reviewVehicleBooking(operatorId, bookRecordId, VehicleBookRecordStatus.APPROVE.getCode(),userName);
return baseBiz.reviewVehicleBooking(operatorId, bookRecordId, VehicleBookRecordStatus.APPROVE.getCode(), userName);
}
/**
* 拒绝预定车辆申请
*
* @param bookRecordId
* @return
*/
@RequestMapping(value ="/book/4employee/reject/{bookRecordId}",method = RequestMethod.PUT)
public RestResponse<Integer> rejectVehicleBooking(@PathVariable Long bookRecordId) throws Exception{
@RequestMapping(value = "/book/4employee/reject/{bookRecordId}", method = RequestMethod.PUT)
public RestResponse<Integer> rejectVehicleBooking(@PathVariable Long bookRecordId) throws Exception {
Integer operatorId = Integer.parseInt(BaseContextHandler.getUserID());
String userName = BaseContextHandler.getName();
return baseBiz.reviewVehicleBooking(operatorId, bookRecordId, VehicleBookRecordStatus.REJECTED.getCode(),userName);
return baseBiz.reviewVehicleBooking(operatorId, bookRecordId, VehicleBookRecordStatus.REJECTED.getCode(), userName);
}
// /**
......@@ -167,40 +191,41 @@ public class VehicleController extends BaseController<VehicleBiz> {
/**
* 取消车辆预订
*
* @param bookRecordId
* @return
*/
@RequestMapping(value ="/unbook/4employee/{bookRecordId}",method = RequestMethod.DELETE)
public RestResponse<Integer> unbookVehicle(@PathVariable Long bookRecordId) throws Exception{
@RequestMapping(value = "/unbook/4employee/{bookRecordId}", method = RequestMethod.DELETE)
public RestResponse<Integer> unbookVehicle(@PathVariable Long bookRecordId) throws Exception {
Integer operatorId = Integer.parseInt(BaseContextHandler.getUserID());
String userName = BaseContextHandler.getName();
return baseBiz.unbookVehicle4Employee(operatorId,bookRecordId,userName);
return baseBiz.unbookVehicle4Employee(operatorId, bookRecordId, userName);
}
@RequestMapping(value ="/bookedRecord/{bookEndDate}/{id}",method = RequestMethod.GET)
public RestResponse<QueryVehicleBookRecordVo> getBookedRecord(@PathVariable String bookEndDate,@PathVariable Long id) throws Exception{
@RequestMapping(value = "/bookedRecord/{bookEndDate}/{id}", method = RequestMethod.GET)
public RestResponse<QueryVehicleBookRecordVo> getBookedRecord(@PathVariable String bookEndDate, @PathVariable Long id) throws Exception {
try {
return RestResponse.codeAndData(RestResponse.SUC_CODE,vehicleBookRecordBiz.getById(id, DateTime.parse(bookEndDate,DEFAULT_FORMATTER)));
return RestResponse.codeAndData(RestResponse.SUC_CODE, vehicleBookRecordBiz.getById(id, DateTime.parse(bookEndDate, DEFAULT_FORMATTER)));
} catch (JSONException ex) {
return RestResponse.code(ResCode.INVALID_REST_REQ_PARAM.getCode());
} catch (CustomIllegalParamException ex){
} catch (CustomIllegalParamException ex) {
return RestResponse.code(ResCode.INVALID_REST_REQ_PARAM.getCode());
}
}
@RequestMapping(value ="/bookedRecord",method = RequestMethod.GET)
public RestResponse<PageDataVo<QueryVehicleBookRecordVo>> getBookedRecord(@RequestParam String vehicleBookRecordQueryVoJson) throws Exception{
@RequestMapping(value = "/bookedRecord", method = RequestMethod.GET)
public RestResponse<PageDataVo<QueryVehicleBookRecordVo>> getBookedRecord(@RequestParam String vehicleBookRecordQueryVoJson) throws Exception {
VehicleBookRecordQueryVo vehicleBookRecordQueryVo = null;
try {
vehicleBookRecordQueryVo = JSON.parseObject(vehicleBookRecordQueryVoJson,VehicleBookRecordQueryVo.class);
vehicleBookRecordQueryVo = JSON.parseObject(vehicleBookRecordQueryVoJson, VehicleBookRecordQueryVo.class);
return RestResponse.data(vehicleBookRecordBiz.page(vehicleBookRecordQueryVo));
} catch (JSONException ex) {
return RestResponse.code(ResCode.INVALID_REST_REQ_PARAM.getCode());
} catch (CustomIllegalParamException ex){
} catch (CustomIllegalParamException ex) {
return RestResponse.code(ResCode.INVALID_REST_REQ_PARAM.getCode());
}
......@@ -208,26 +233,28 @@ public class VehicleController extends BaseController<VehicleBiz> {
/**
* 提车
*
* @param liftVehicleVo
* @return
*/
@RequestMapping(value ="/book/4employee/lift",method = RequestMethod.PUT)
public RestResponse<Integer> liftVehicle(@RequestBody LiftVehicleVo liftVehicleVo) throws Exception{
@RequestMapping(value = "/book/4employee/lift", method = RequestMethod.PUT)
public RestResponse<Integer> liftVehicle(@RequestBody LiftVehicleVo liftVehicleVo) throws Exception {
Integer operatorId = Integer.parseInt(BaseContextHandler.getUserID());
String userName = BaseContextHandler.getName();
return vehicleBookRecordBiz.lift(operatorId,userName,liftVehicleVo);
return vehicleBookRecordBiz.lift(operatorId, userName, liftVehicleVo);
}
/**
* 还车
*
* @param retVehicleVo
* @return
*/
@RequestMapping(value ="/book/4employee/ret",method = RequestMethod.PUT)
public RestResponse<Integer> retVehicle(@RequestBody RetVehicleVo retVehicleVo) throws Exception{
@RequestMapping(value = "/book/4employee/ret", method = RequestMethod.PUT)
public RestResponse<Integer> retVehicle(@RequestBody RetVehicleVo retVehicleVo) throws Exception {
Integer operatorId = Integer.parseInt(BaseContextHandler.getUserID());
String userName = BaseContextHandler.getName();
return vehicleBookRecordBiz.retVehicle(operatorId,userName,retVehicleVo);
return vehicleBookRecordBiz.retVehicle(operatorId, userName, retVehicleVo);
}
......
package com.xinxincaravan.caravan.vehicle.rest;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.xinxincaravan.caravan.vehicle.biz.VehicleBiz;
import com.xinxincaravan.caravan.vehicle.biz.VehicleDepartureService;
import com.xinxincaravan.caravan.vehicle.common.RestResponse;
import com.xinxincaravan.caravan.vehicle.constant.ResCode.ResCode;
import com.xinxincaravan.caravan.vehicle.feign.UserFeign;
import com.xinxincaravan.caravan.vehicle.feign.dto.UserDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
@IgnoreClientToken
@RestController
@RequestMapping("departure")
......@@ -16,13 +24,28 @@ public class VehicleDepartureController {
@Autowired
VehicleDepartureService vehicleDepartureService;
@Autowired
VehicleBiz vehicleBiz;
@Autowired
UserFeign userFeign;
@Autowired
private UserAuthConfig userAuthConfig;
@GetMapping("page")
public RestResponse page(String numberPlate, Integer page, Integer limit) {
public RestResponse page(String numberPlate, Integer page, Integer limit, HttpServletRequest request) {
if (page == null || limit == null) {
page = 1;
limit = 10;
}
UserDTO userDTO = userFeign.userinfoByToken(userAuthConfig.getToken(request)).getData();
if (userDTO != null) {
if (userDTO.getDataAll() == 2) {
List<Integer> companyList = vehicleBiz.dataCompany(userDTO.getDataZone(), userDTO.getDataCompany());
return RestResponse.data(vehicleDepartureService.pageNotAllData(numberPlate, page, limit, companyList));
}
}
return RestResponse.suc(vehicleDepartureService.page(numberPlate, page, limit));
}
......
......@@ -27,6 +27,34 @@
</trim>
order by create_time desc
</select>
<select id="selectVoAllNotAllData" resultType="com.xinxincaravan.caravan.vehicle.vo.VehicleDepartureLogVo">
select vehicle_departure_log.*,vehicle.number_plate
from vehicle_departure_log
left join vehicle on vehicle_departure_log.vehicle_id = vehicle.id
<trim prefix="where" suffixOverrides="and">
<if test="numberPlate != null and numberPlate != ''">
vehicle.number_plate = #{numberPlate} and
</if>
<if test="companyList != null">
( vehicle.park_branch_company_id in (
<foreach collection="companyList" item="companyId">
<trim suffixOverrides=",">
#{companyId},
</trim>
</foreach>
)
or vehicle.expect_destination_branch_company_id in (
<foreach collection="companyList" item="companyId">
<trim suffixOverrides=",">
#{companyId},
</trim>
</foreach>
)
)
</if>
</trim>
order by create_time desc
</select>
<select id="selectMileageByVehicleId" resultType="int">
select sum(mileage_end - mileage_start)
from vehicle_departure_log
......
<?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" >
<mapper namespace="com.xinxincaravan.caravan.vehicle.mapper.VehicleMapper" >
<mapper namespace="com.xinxincaravan.caravan.vehicle.mapper.VehicleMapper">
<update id="updateStatusById" parameterType="java.util.Map" >
<update id="updateStatusById" parameterType="java.util.Map">
update vehicle set status = #{status} where id in
<foreach collection="idList" index="i" item="item" separator="," open="(" close=")">
#{item}
......@@ -10,7 +10,8 @@
</update>
<select id="getByPage" parameterType="java.util.Map" resultType="com.xinxincaravan.caravan.vehicle.vo.QueryVehicleVo">
<select id="getByPage" parameterType="java.util.Map"
resultType="com.xinxincaravan.caravan.vehicle.vo.QueryVehicleVo">
select v.`id`,
v.`code`,
v.`status`,
......@@ -91,7 +92,7 @@
</if>
<!-- 若需根据预定日期条件查询,针对换为位操作 -->
<if test=" yearMonthAndParam !=null ">
<foreach collection="yearMonthAndParam" index="yearMonth" item="andOperation" >
<foreach collection="yearMonthAndParam" index="yearMonth" item="andOperation">
and
( (vbi.`year_month` = #{yearMonth} or vbi.`year_month` is null) and
ifnull(vbi.`booked_date`,0) &amp; #{andOperation.andOperationFactor} = #{andOperation.andOperationRs}
......@@ -101,7 +102,117 @@
order by v.code
</select>
<select id="lockByCode" resultType="com.xinxincaravan.caravan.vehicle.entity.Vehicle" parameterType="com.xinxincaravan.caravan.vehicle.vo.AddOrUpdateVehicleVo">
<select id="getByPageNotAllData" parameterType="java.util.Map"
resultType="com.xinxincaravan.caravan.vehicle.vo.QueryVehicleVo">
select v.`id`,
v.`code`,
v.`status`,
v.number_plate,
v.brand,
v.subordinate_branch,
bc.name as subBranchName,
v.use_type,
v.remark,
v.create_time,
v.vin,
v.insurance_company,
v.insurance_no,
v.insurance_start_date,
v.insurance_end_date,
v.annual_verification_date,
v.maintenance_date,
v.maintenance_mileage,
v.belong_to,
v.belong_to_name,
v.driving_license_path,
v.engine_num,
v.manufacturer,
v.receive_time,
v.update_time
<if test=" yearMonthAndParam !=null ">
,vbi.booked_date
</if>
from vehicle v
<if test=" yearMonthAndParam !=null ">
left join
vehicle_book_info vbi on v.`id` = vbi.vehicle
</if>
left join branch_company bc on v.`subordinate_branch` = bc.id
where
1=1
<if test="companyList != null">
and ( v.park_branch_company_id in (
<foreach collection="companyList" item="companyId">
<trim suffixOverrides=",">
#{companyId},
</trim>
</foreach>
)
or v.expect_destination_branch_company_id in (
<foreach collection="companyList" item="companyId">
<trim suffixOverrides=",">
#{companyId},
</trim>
</foreach>
)
)
</if>
<if test="mRangeDateEnd !=null">
and v.maintenance_date &lt;= #{mRangeDateEnd}
</if>
<if test="mRangeDateStart !=null">
and v.maintenance_date &gt;= #{mRangeDateStart}
</if>
<if test="aVRangeDateStart !=null">
and v.annual_verification_date &lt;= #{aVRangeDateEnd}
</if>
<if test="aVRangeDateEnd !=null">
and v.annual_verification_date &gt;= #{aVRangeDateStart}
</if>
<if test="insuranceDateRangeStart !=null">
and v.insurance_end_date &lt;= #{insuranceDateRangeEnd}
</if>
<if test="insuranceDateRangeEnd !=null">
and v.insurance_end_date &gt;= #{insuranceDateRangeStart}
</if>
<if test="insuranceCompany !=null">
and v.insurance_company = #{insuranceCompany}
</if>
<if test="vin !=null and vin != ''">
and v.vin = #{vin}
</if>
<if test="subordinateBranch !=null">
and v.subordinate_branch = #{subordinateBranch}
</if>
<if test="code !=null">
and v.code = #{code}
</if>
<if test="status !=null">
and v.status = #{status}
</if>
<if test="numberPlate !=null and numberPlate != ''">
and v.number_plate = #{numberPlate}
</if>
<if test="brand !=null">
and v.brand = #{brand}
</if>
<if test="useType !=null">
and v.use_type = #{useType}
</if>
<!-- 若需根据预定日期条件查询,针对换为位操作 -->
<if test=" yearMonthAndParam !=null ">
<foreach collection="yearMonthAndParam" index="yearMonth" item="andOperation">
and
( (vbi.`year_month` = #{yearMonth} or vbi.`year_month` is null) and
ifnull(vbi.`booked_date`,0) &amp; #{andOperation.andOperationFactor} = #{andOperation.andOperationRs}
)
</foreach>
</if>
order by v.code
</select>
<select id="lockByCode" resultType="com.xinxincaravan.caravan.vehicle.entity.Vehicle"
parameterType="com.xinxincaravan.caravan.vehicle.vo.AddOrUpdateVehicleVo">
select
v.`id`,
v.`code`,
......
......@@ -47,13 +47,13 @@
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<table tableName="member_info" domainObjectName="MemberInfo" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false"/>
<!-- <table tableName="member_info" domainObjectName="MemberInfo" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"/>-->
<table tableName="member_family_info" domainObjectName="MemberFamilyInfo" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false"/>
<!-- <table tableName="member_family_info" domainObjectName="MemberFamilyInfo" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"/>-->
</context>
</generatorConfiguration>
\ No newline at end of file
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