fine()修改mybatis plus
parent
83312b8e37
commit
5688271d2c
|
@ -501,4 +501,5 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,14 +5,20 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.domain.req.CarInformationAddReq;
|
||||||
|
import com.muyu.domain.req.CarInformationUpdReq;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业车辆管理实体类
|
* 企业车辆管理实体类
|
||||||
|
@ -25,16 +31,16 @@ import java.util.Date;
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@Tag(name = "企业车辆管理实体类")
|
@Tag(name = "企业车辆管理实体类")
|
||||||
@TableName(value = "car_information",autoResultMap = true)
|
@TableName(value = "car_information",autoResultMap = true)
|
||||||
public class CarInformation {
|
public class CarInformation extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆ID
|
* 车辆ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "car_information_id",type = IdType.AUTO)
|
@TableId(value = "car_information_id",type = IdType.AUTO)
|
||||||
private Integer carInformationId;
|
private Long carInformationId;
|
||||||
/**
|
/**
|
||||||
* 车辆唯一VIN
|
* 车辆唯一VIN
|
||||||
*/
|
*/
|
||||||
|
@ -56,7 +62,8 @@ public class CarInformation {
|
||||||
/**
|
/**
|
||||||
* 车辆电子围栏外键ID
|
* 车辆电子围栏外键ID
|
||||||
*/
|
*/
|
||||||
private String carInformationFence;
|
@Schema(title = "车辆电子围栏外键ID", type = "Integer")
|
||||||
|
private Integer carInformationFence;
|
||||||
/**
|
/**
|
||||||
* 车检到期日期
|
* 车检到期日期
|
||||||
*/
|
*/
|
||||||
|
@ -66,6 +73,7 @@ public class CarInformation {
|
||||||
/**
|
/**
|
||||||
* 车辆类型外键ID
|
* 车辆类型外键ID
|
||||||
*/
|
*/
|
||||||
|
@Schema(title = "车辆类型外键ID", type = "Integer")
|
||||||
private Integer carInformationType;
|
private Integer carInformationType;
|
||||||
/**
|
/**
|
||||||
* 车辆品牌外键ID
|
* 车辆品牌外键ID
|
||||||
|
@ -107,4 +115,38 @@ public class CarInformation {
|
||||||
.carInformationLicensePlate(carInformation.getCarInformationLicensePlate())
|
.carInformationLicensePlate(carInformation.getCarInformationLicensePlate())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static CarInformation carInformationUpdBuilder(CarInformationUpdReq carInformation, Supplier<Long> idSupplier) {
|
||||||
|
return CarInformation.builder()
|
||||||
|
.carInformationId(idSupplier.get())
|
||||||
|
.carInformationBrand(carInformation.getCarInformationBrand())
|
||||||
|
.carInformationColor(carInformation.getCarInformationColor())
|
||||||
|
.carInformationDriver(carInformation.getCarInformationDriver())
|
||||||
|
.carInformationMotorManufacturer(carInformation.getCarInformationMotorManufacturer())
|
||||||
|
.carInformationMotorModel(carInformation.getCarInformationMotorModel())
|
||||||
|
.carInformationBatteryManufacturer(carInformation.getCarInformationBatteryManufacturer())
|
||||||
|
.carInformationBatteryModel(carInformation.getCarInformationBatteryModel())
|
||||||
|
.carInformationFence(carInformation.getCarInformationFence())
|
||||||
|
.carInformationType(carInformation.getCarInformationType())
|
||||||
|
.carInformationFocus(carInformation.getCarInformationFocus())
|
||||||
|
.carInformationMotorModel(carInformation.getCarInformationMotorModel())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CarInformation carInformationAddBuilder(CarInformationAddReq carInformation) {
|
||||||
|
return CarInformation.builder()
|
||||||
|
.carInformationVin(carInformation.getCarInformationVin())
|
||||||
|
.carInformationLicensePlate(carInformation.getCarInformationLicensePlate())
|
||||||
|
.carInformationBrand(carInformation.getCarInformationBrand())
|
||||||
|
.carInformationColor(carInformation.getCarInformationColor())
|
||||||
|
.carInformationDriver(carInformation.getCarInformationDriver())
|
||||||
|
.carInformationMotorManufacturer(carInformation.getCarInformationMotorManufacturer())
|
||||||
|
.carInformationMotorModel(carInformation.getCarInformationMotorModel())
|
||||||
|
.carInformationBatteryManufacturer(carInformation.getCarInformationBatteryManufacturer())
|
||||||
|
.carInformationBatteryModel(carInformation.getCarInformationBatteryModel())
|
||||||
|
.carInformationFence(carInformation.getCarInformationFence())
|
||||||
|
.carInformationType(carInformation.getCarInformationType())
|
||||||
|
.carInformationMotorModel(carInformation.getCarInformationMotorModel())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,24 @@
|
||||||
package com.muyu.domain;
|
package com.muyu.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆报文模板实体类
|
* 车辆报文模板实体类
|
||||||
|
* @author 17353
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@TableName(value = "车辆报文模板实体类",autoResultMap = true)
|
@TableName(value = "车辆报文模板实体类",autoResultMap = true)
|
||||||
public class CarMessage {
|
public class CarMessage extends BaseEntity {
|
||||||
//报文类型模块表
|
//报文类型模块表
|
||||||
/**
|
/**
|
||||||
* 自增主键
|
* 自增主键
|
||||||
|
@ -41,7 +45,7 @@ public class CarMessage {
|
||||||
/**
|
/**
|
||||||
* 车辆类型外键
|
* 车辆类型外键
|
||||||
*/
|
*/
|
||||||
private Integer carMessageCartype;
|
private Integer carMessageCarType;
|
||||||
/**
|
/**
|
||||||
* 车辆报文类型外键
|
* 车辆报文类型外键
|
||||||
*/
|
*/
|
||||||
|
@ -63,6 +67,48 @@ public class CarMessage {
|
||||||
*/
|
*/
|
||||||
private Integer carMessageState;
|
private Integer carMessageState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改方法
|
||||||
|
* @param carMessage
|
||||||
|
* @param supplier
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static CarMessage carMessageUpdBuilder(CarMessage carMessage, Supplier<Long> supplier) {
|
||||||
|
return CarMessage.builder()
|
||||||
|
.messageTypeId(supplier.get())
|
||||||
|
.messageTypeCode(carMessage.messageTypeCode)
|
||||||
|
.messageTypeName(carMessage.messageTypeName)
|
||||||
|
.messageTypeBelongs(carMessage.messageTypeBelongs)
|
||||||
|
.carMessageId(carMessage.carMessageId)
|
||||||
|
.carMessageCarType(carMessage.carMessageCarType)
|
||||||
|
.carMessageType(carMessage.carMessageType)
|
||||||
|
.carMessageStartIndex(carMessage.carMessageStartIndex)
|
||||||
|
.carMessageEndIndex(carMessage.carMessageEndIndex)
|
||||||
|
.messageTypeClass(carMessage.messageTypeClass)
|
||||||
|
.carMessageState(carMessage.carMessageState)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加方法
|
||||||
|
* @param carMessage
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static CarMessage carMessageAddBuilder(CarMessage carMessage) {
|
||||||
|
return CarMessage.builder()
|
||||||
|
.messageTypeCode(carMessage.messageTypeCode)
|
||||||
|
.messageTypeName(carMessage.messageTypeName)
|
||||||
|
.messageTypeBelongs(carMessage.messageTypeBelongs)
|
||||||
|
.carMessageId(carMessage.carMessageId)
|
||||||
|
.carMessageCarType(carMessage.carMessageCarType)
|
||||||
|
.carMessageType(carMessage.carMessageType)
|
||||||
|
.carMessageStartIndex(carMessage.carMessageStartIndex)
|
||||||
|
.carMessageEndIndex(carMessage.carMessageEndIndex)
|
||||||
|
.messageTypeClass(carMessage.messageTypeClass)
|
||||||
|
.carMessageState(carMessage.carMessageState)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -37,9 +37,9 @@ public class CarMiddle {
|
||||||
/**
|
/**
|
||||||
* 车辆ID
|
* 车辆ID
|
||||||
*/
|
*/
|
||||||
private Integer carInformationId;
|
private Long carInformationId;
|
||||||
|
|
||||||
public CarMiddle(Integer fenceGroupId, Integer carInformationId) {
|
public CarMiddle(Integer fenceGroupId, Long carInformationId) {
|
||||||
this.fenceGroupId = fenceGroupId;
|
this.fenceGroupId = fenceGroupId;
|
||||||
this.carInformationId = carInformationId;
|
this.carInformationId = carInformationId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,15 @@ public class FaultLog {
|
||||||
* 车辆VIN
|
* 车辆VIN
|
||||||
*/
|
*/
|
||||||
private String carVin;
|
private String carVin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码
|
||||||
|
*/
|
||||||
|
private String faultcodeNumber;
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
*/
|
||||||
|
private String carInformationVin;
|
||||||
/**
|
/**
|
||||||
* 开始报警时间
|
* 开始报警时间
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class CarInformationAddReq {
|
||||||
/**
|
/**
|
||||||
* 车辆唯一VIN
|
* 车辆唯一VIN
|
||||||
*/
|
*/
|
||||||
private String carInformationVIN;
|
private String carInformationVin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车牌号
|
* 车牌号
|
||||||
|
@ -31,7 +31,7 @@ public class CarInformationAddReq {
|
||||||
/**
|
/**
|
||||||
* 车辆品牌
|
* 车辆品牌
|
||||||
*/
|
*/
|
||||||
private String carInformationBrand;
|
private Integer carInformationBrand;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆颜色
|
* 车辆颜色
|
||||||
|
|
|
@ -26,8 +26,8 @@ public class CarInformationUpdReq {
|
||||||
/**
|
/**
|
||||||
* 车辆品牌
|
* 车辆品牌
|
||||||
*/
|
*/
|
||||||
@Schema(title = "车辆品牌", type = "String")
|
@Schema(title = "车辆品牌", type = "Integer")
|
||||||
private String carInformationBrand;
|
private Integer carInformationBrand;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆颜色
|
* 车辆颜色
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class CarInformationResp {
|
||||||
* 车辆ID
|
* 车辆ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "car_information_id",type = IdType.AUTO)
|
@TableId(value = "car_information_id",type = IdType.AUTO)
|
||||||
private Integer carInformationId;
|
private Long carInformationId;
|
||||||
/**
|
/**
|
||||||
* 车辆唯一VIN
|
* 车辆唯一VIN
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class FaultLogListResp {
|
||||||
.startwarningTime(faultLog.getStartwarningTime())
|
.startwarningTime(faultLog.getStartwarningTime())
|
||||||
.endwarningTime(faultLog.getEndwarningTime())
|
.endwarningTime(faultLog.getEndwarningTime())
|
||||||
.faultcodeNumber(faultLog.getFaultcodeNumber())
|
.faultcodeNumber(faultLog.getFaultcodeNumber())
|
||||||
.carInformationVIN(faultLog.getCarInformationVIN())
|
.carInformationVIN(faultLog.getCarInformationVin())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.server.controller;
|
package com.muyu.server.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
|
@ -48,8 +49,8 @@ public class CarInformationController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/selectCarInformationList")
|
@PostMapping("/selectCarInformationList")
|
||||||
@Operation(summary = "企业车辆管理列表")
|
@Operation(summary = "企业车辆管理列表")
|
||||||
public Result<PageInfo<CarInformationResp>> selectCarInformationList(@Validated @RequestBody CarInformationListReq carInformationListReq) {
|
public Result<Page<CarInformationResp>> selectCarInformationList(@Validated @RequestBody CarInformationListReq carInformationListReq) {
|
||||||
PageInfo<CarInformationResp> pageInfo = carInformationService.selectCarInformationList(carInformationListReq);
|
Page<CarInformationResp> pageInfo = carInformationService.selectCarInformationList(carInformationListReq);
|
||||||
log.info("企业车辆管理列表查询",carInformationListReq,pageInfo);
|
log.info("企业车辆管理列表查询",carInformationListReq,pageInfo);
|
||||||
return Result.success(pageInfo);
|
return Result.success(pageInfo);
|
||||||
|
|
||||||
|
@ -64,7 +65,9 @@ public class CarInformationController {
|
||||||
@PostMapping("/addCarInformation")
|
@PostMapping("/addCarInformation")
|
||||||
@Operation(summary = "企业车辆添加管理")
|
@Operation(summary = "企业车辆添加管理")
|
||||||
public Result addCarInformation(@Validated @RequestBody CarInformationAddReq carInformationAddReq){
|
public Result addCarInformation(@Validated @RequestBody CarInformationAddReq carInformationAddReq){
|
||||||
return carInformationService.addCarInformation(carInformationAddReq);
|
return carInformationService.addCarInformation(carInformationAddReq)
|
||||||
|
?Result.success("添加车辆成功")
|
||||||
|
:Result.error(402,"添加车辆失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -75,7 +78,11 @@ public class CarInformationController {
|
||||||
@GetMapping("/delBycarInformationId/{carInformationId}")
|
@GetMapping("/delBycarInformationId/{carInformationId}")
|
||||||
@Operation(summary = "企业车辆删除")
|
@Operation(summary = "企业车辆删除")
|
||||||
public Result delBycarInformationId(@Validated @PathVariable("carInformationId") Integer carInformationId){
|
public Result delBycarInformationId(@Validated @PathVariable("carInformationId") Integer carInformationId){
|
||||||
return carInformationService.delBycarInformationId(carInformationId);
|
boolean delBycarInformationId = carInformationService.delBycarInformationId(carInformationId);
|
||||||
|
if (delBycarInformationId){
|
||||||
|
return Result.success(delBycarInformationId ,"删除车辆成功");
|
||||||
|
}
|
||||||
|
return Result.error(402,"删除车辆失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -87,12 +94,14 @@ public class CarInformationController {
|
||||||
@PostMapping("/updatecarInformation")
|
@PostMapping("/updatecarInformation")
|
||||||
@Operation(summary = "企业车辆修改管理")
|
@Operation(summary = "企业车辆修改管理")
|
||||||
public Result updateCarMessage(@Validated @RequestBody CarInformationUpdReq carInformationUpdReq){
|
public Result updateCarMessage(@Validated @RequestBody CarInformationUpdReq carInformationUpdReq){
|
||||||
Result updatecarInformation = carInformationService.updatecarInformation(carInformationUpdReq);
|
boolean updatecarInformation = carInformationService.updatecarInformation(carInformationUpdReq);
|
||||||
log.info(updatecarInformation);
|
log.info(updatecarInformation);
|
||||||
System.out.println("我在这个里:"+updatecarInformation);
|
System.out.println("我在这个里:"+updatecarInformation);
|
||||||
|
if(updatecarInformation)
|
||||||
return Result.success(updatecarInformation,"修改成功");
|
{
|
||||||
|
return Result.success(carInformationUpdReq,"修改成功");
|
||||||
|
}
|
||||||
|
return Result.error( 402,"修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,12 @@ public class CarMessageController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/insertCarMessage")
|
@PostMapping("/insertCarMessage")
|
||||||
@Operation(summary = "添加报文信息")
|
@Operation(summary = "添加报文信息")
|
||||||
public Result insertCarMessage(@Validated @RequestBody CarMessage carMessage){
|
public Result<Integer> insertCarMessage(@Validated @RequestBody CarMessage carMessage){
|
||||||
Result carMessage1 = carMessageService.insertCarMessage(carMessage);
|
boolean inserted = carMessageService.insertCarMessage(carMessage);
|
||||||
return Result.success(carMessage1);
|
if (inserted){
|
||||||
|
return Result.success(200,"添加成功");
|
||||||
|
}
|
||||||
|
return Result.error(402,"添加失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,9 +58,12 @@ public class CarMessageController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/delectByCarMessageId")
|
@PostMapping("/delectByCarMessageId")
|
||||||
@Operation(summary = "删除报文信息")
|
@Operation(summary = "删除报文信息")
|
||||||
public Result delectByCarMessageId(Integer carMessageId){
|
public Result<Integer> delectByCarMessageId(Integer carMessageId){
|
||||||
Result carMessage1 = carMessageService.delectByCarMessageId(carMessageId);
|
boolean deleteByCarMessageId = carMessageService.delectByCarMessageId(carMessageId);
|
||||||
return Result.success(carMessage1);
|
if (deleteByCarMessageId){
|
||||||
|
return Result.success(200,"删除成功");
|
||||||
|
}
|
||||||
|
return Result.error(402,"删除失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,9 +71,13 @@ public class CarMessageController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/updateCarMessage")
|
@PostMapping("/updateCarMessage")
|
||||||
@Operation(summary = "修改报文信息")
|
@Operation(summary = "修改报文信息")
|
||||||
public Result updateCarMessage(@Validated @RequestBody CarMessage carMessage){
|
public Result<Integer> updateCarMessage(@Validated @RequestBody CarMessage carMessage){
|
||||||
Result updateCarMessage = carMessageService.updateCarMessage(carMessage);
|
boolean updateCarMessage = carMessageService.updateCarMessage(carMessage);
|
||||||
return Result.success(updateCarMessage,"修改成功");
|
if(updateCarMessage)
|
||||||
|
{
|
||||||
|
return Result.success(200,"修改成功");
|
||||||
|
}
|
||||||
|
return Result.error( 402,"修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.server.mapper;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
import com.muyu.domain.CarInformation;
|
import com.muyu.domain.CarInformation;
|
||||||
import com.muyu.domain.req.CarInformationAddReq;
|
import com.muyu.domain.req.CarInformationAddReq;
|
||||||
import com.muyu.domain.req.CarInformationListReq;
|
import com.muyu.domain.req.CarInformationListReq;
|
||||||
|
@ -15,57 +16,6 @@ import java.util.List;
|
||||||
* 车辆信息管理持久层
|
* 车辆信息管理持久层
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface CarInformationMapper extends BaseMapper<CarInformation> {
|
public interface CarInformationMapper extends MPJBaseMapper<CarInformation> {
|
||||||
/**
|
|
||||||
* 企业车辆管理列表
|
|
||||||
* 联查--> 车辆管理--车辆类型表--车辆电子围栏
|
|
||||||
* 搜索-->(车辆唯一VIN carInformationVIN 精确查
|
|
||||||
* 车辆类型ID carTypeId 精确查
|
|
||||||
* 车辆电子围栏外键ID carInformationFence 精确查
|
|
||||||
* 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)
|
|
||||||
* carInformationState 精确查
|
|
||||||
* 车辆电机厂商 carInformationMotorManufacturer 模糊查
|
|
||||||
* 车辆电机型号 carInformationMotorModel 精确查
|
|
||||||
* 车辆电池厂商 carInformationBatteryManufacturer 模糊查
|
|
||||||
* 车辆电池型号 carInformationBatteryModel 精确查
|
|
||||||
* )
|
|
||||||
* 分页--> 分页页数 pageNum 分页条数 pageSize
|
|
||||||
* @param carInformationListReq
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<CarInformationResp> selectCarInformationList(CarInformationListReq carInformationListReq);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 企业车辆添加管理
|
|
||||||
* @param carInformationAddReq
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
Integer addCarInformation(CarInformationAddReq carInformationAddReq);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 企业车辆删除
|
|
||||||
* @param carInformationId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
Integer delBycarInformationId(Integer carInformationId);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 企业车辆修改管理
|
|
||||||
* @param carInformationUpdReq
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
Integer updatecarInformation(CarInformationUpdReq carInformationUpdReq);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* To 电子围栏负责人
|
|
||||||
* 查询企业车辆 carInformationID 和 carInformationLicensePlate
|
|
||||||
* 无参
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<CarInformationResp> selectBycarInformationIDAndLicensePlate();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,28 +11,5 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface CarMessageMapper extends MPJBaseMapper<CarMessage> {
|
public interface CarMessageMapper extends MPJBaseMapper<CarMessage> {
|
||||||
/**
|
|
||||||
* 根据所属车类别 解析 车辆报文模板
|
|
||||||
* @param
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<CarMessage> selectCarMessageList();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加车辆报文规则
|
|
||||||
*/
|
|
||||||
Integer insertCarMessage(CarMessage carMessage);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除车辆报文规则
|
|
||||||
*/
|
|
||||||
Integer deleteByCarMessageId(Integer carMessageId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改车辆报文规则
|
|
||||||
*/
|
|
||||||
Integer updateCarMessage(CarMessage carMessage);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.muyu.server.service;
|
package com.muyu.server.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
|
@ -14,7 +16,7 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* 车辆信息管理业务层
|
* 车辆信息管理业务层
|
||||||
*/
|
*/
|
||||||
public interface CarInformationService {
|
public interface CarInformationService extends IService<CarInformation> {
|
||||||
/**
|
/**
|
||||||
* 企业车辆管理列表
|
* 企业车辆管理列表
|
||||||
* 联查--> 车辆管理--车辆类型表--车辆电子围栏
|
* 联查--> 车辆管理--车辆类型表--车辆电子围栏
|
||||||
|
@ -32,7 +34,7 @@ public interface CarInformationService {
|
||||||
* @param carInformationListReq
|
* @param carInformationListReq
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
PageInfo<CarInformationResp> selectCarInformationList(CarInformationListReq carInformationListReq);
|
Page<CarInformationResp> selectCarInformationList(CarInformationListReq carInformationListReq);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,14 +42,14 @@ public interface CarInformationService {
|
||||||
* @param carInformationAddReq
|
* @param carInformationAddReq
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Result addCarInformation(CarInformationAddReq carInformationAddReq);
|
boolean addCarInformation(CarInformationAddReq carInformationAddReq);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业车辆删除
|
* 企业车辆删除
|
||||||
* @param carInformationId
|
* @param carInformationId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Result delBycarInformationId(Integer carInformationId);
|
boolean delBycarInformationId(Integer carInformationId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +57,7 @@ public interface CarInformationService {
|
||||||
* @param carInformationUpdReq
|
* @param carInformationUpdReq
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Result updatecarInformation(CarInformationUpdReq carInformationUpdReq);
|
boolean updatecarInformation(CarInformationUpdReq carInformationUpdReq);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -23,19 +23,19 @@ public interface CarMessageService extends IService<CarMessage> {
|
||||||
/**
|
/**
|
||||||
* 添加车辆报文规则
|
* 添加车辆报文规则
|
||||||
*/
|
*/
|
||||||
Result insertCarMessage(CarMessage carMessage);
|
boolean insertCarMessage(CarMessage carMessage);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除车辆报文规则
|
* 删除车辆报文规则
|
||||||
*/
|
*/
|
||||||
Result delectByCarMessageId(Integer carMessageId);
|
boolean delectByCarMessageId(Integer carMessageId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改车辆报文规则
|
* 修改车辆报文规则
|
||||||
*/
|
*/
|
||||||
Result updateCarMessage(CarMessage carMessage);
|
boolean updateCarMessage(CarMessage carMessage);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询
|
* 查询
|
||||||
|
|
|
@ -133,7 +133,7 @@ public class CarFenceServiceImpl
|
||||||
|
|
||||||
carInformations.forEach(carInformation -> {
|
carInformations.forEach(carInformation -> {
|
||||||
Integer carFenceGroupId = carFenceGroup.getId();
|
Integer carFenceGroupId = carFenceGroup.getId();
|
||||||
Integer carInformationId = carInformation.getCarInformationId();
|
Long carInformationId = carInformation.getCarInformationId();
|
||||||
carMiddles.add(new CarMiddle(carFenceGroupId,carInformationId));
|
carMiddles.add(new CarMiddle(carFenceGroupId,carInformationId));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,16 @@
|
||||||
package com.muyu.server.service.impl;
|
package com.muyu.server.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
|
import com.muyu.domain.CarFence;
|
||||||
import com.muyu.domain.CarInformation;
|
import com.muyu.domain.CarInformation;
|
||||||
|
import com.muyu.domain.CarType;
|
||||||
import com.muyu.domain.req.CarInformationAddReq;
|
import com.muyu.domain.req.CarInformationAddReq;
|
||||||
import com.muyu.domain.req.CarInformationListReq;
|
import com.muyu.domain.req.CarInformationListReq;
|
||||||
import com.muyu.domain.req.CarInformationUpdReq;
|
import com.muyu.domain.req.CarInformationUpdReq;
|
||||||
|
@ -15,13 +22,17 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆信息管理业务实现层
|
* 车辆信息管理业务实现层
|
||||||
|
* @author 17353
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class CarInformationServiceImpl implements CarInformationService {
|
public class CarInformationServiceImpl
|
||||||
|
extends ServiceImpl<CarInformationMapper, CarInformation>
|
||||||
|
implements CarInformationService {
|
||||||
@Resource
|
@Resource
|
||||||
private CarInformationMapper carInformationMapper;
|
private CarInformationMapper carInformationMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -46,11 +57,41 @@ public class CarInformationServiceImpl implements CarInformationService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<CarInformationResp> selectCarInformationList(CarInformationListReq carInformationListReq) {
|
public Page<CarInformationResp> selectCarInformationList(CarInformationListReq carInformationListReq) {
|
||||||
PageHelper.startPage(carInformationListReq.getPageNum(),carInformationListReq.getPageSize());
|
Page<CarInformationResp> carInformationRespPage = carInformationMapper.selectJoinPage(
|
||||||
List<CarInformationResp> carInformations = carInformationMapper.selectCarInformationList(carInformationListReq);
|
new Page<>(carInformationListReq.getPageNum(), carInformationListReq.getPageSize()),
|
||||||
PageInfo<CarInformationResp> pageInfo = new PageInfo<>(carInformations);
|
CarInformationResp.class,
|
||||||
return pageInfo;
|
new MPJLambdaWrapper<CarInformation>()
|
||||||
|
.selectAll(CarInformation.class)
|
||||||
|
.select(CarType::getCarTypeId, CarType::getCarTypeName)
|
||||||
|
.select(CarFence::getId, CarFence::getName)
|
||||||
|
.leftJoin(CarType.class, CarType::getCarTypeId, CarInformation::getCarInformationType)
|
||||||
|
.leftJoin(CarFence.class, CarFence::getId, CarInformation::getCarInformationFence)
|
||||||
|
.eq(StringUtils.isNotEmpty(carInformationListReq.getCarInformationVIN())
|
||||||
|
,CarInformation::getCarInformationVin
|
||||||
|
, carInformationListReq.getCarInformationVIN())
|
||||||
|
.eq(StringUtils.isNotNull(carInformationListReq.getCarTypeId())
|
||||||
|
,CarType::getCarTypeId, carInformationListReq.getCarTypeId())
|
||||||
|
.eq(StringUtils.isNotNull(carInformationListReq.getCarInformationFence())
|
||||||
|
,CarInformation::getCarInformationFence
|
||||||
|
, carInformationListReq.getCarInformationFence())
|
||||||
|
.eq(StringUtils.isNotEmpty(carInformationListReq.getCarInformationVIN())
|
||||||
|
,CarInformation::getCarInformationState
|
||||||
|
, carInformationListReq.getCarInformationState())
|
||||||
|
.like(StringUtils.isNotEmpty(carInformationListReq.getCarInformationVIN())
|
||||||
|
,CarInformation::getCarInformationVin
|
||||||
|
, carInformationListReq.getCarInformationVIN())
|
||||||
|
.eq(StringUtils.isNotEmpty( carInformationListReq.getCarInformationMotorModel())
|
||||||
|
,CarInformation::getCarInformationMotorModel
|
||||||
|
,carInformationListReq.getCarInformationMotorModel())
|
||||||
|
.like(StringUtils.isNotEmpty(carInformationListReq.getCarInformationBatteryManufacturer())
|
||||||
|
,CarInformation::getCarInformationBatteryManufacturer
|
||||||
|
,carInformationListReq.getCarInformationBatteryManufacturer())
|
||||||
|
.eq(StringUtils.isNotEmpty( carInformationListReq.getCarInformationBatteryModel())
|
||||||
|
,CarInformation::getCarInformationBatteryModel
|
||||||
|
,carInformationListReq.getCarInformationBatteryModel())
|
||||||
|
);
|
||||||
|
return carInformationRespPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,12 +100,10 @@ public class CarInformationServiceImpl implements CarInformationService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result addCarInformation(CarInformationAddReq carInformationAddReq) {
|
public boolean addCarInformation(CarInformationAddReq carInformationAddReq) {
|
||||||
Integer addCarInformation = carInformationMapper.addCarInformation(carInformationAddReq);
|
boolean addCarInformation = this.save(CarInformation.carInformationAddBuilder(carInformationAddReq));
|
||||||
if(addCarInformation > 0){
|
|
||||||
return Result.success(addCarInformation,"添加车辆成功");
|
return addCarInformation;
|
||||||
}
|
|
||||||
return Result.error(402,"添加车辆失败");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,12 +112,9 @@ public class CarInformationServiceImpl implements CarInformationService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result delBycarInformationId(Integer carInformationId) {
|
public boolean delBycarInformationId(Integer carInformationId) {
|
||||||
Integer delBycarInformationId = carInformationMapper.delBycarInformationId(carInformationId);
|
boolean delBycarInformationId = this.removeById(carInformationId);
|
||||||
if (delBycarInformationId > 0){
|
return delBycarInformationId;
|
||||||
return Result.success(delBycarInformationId ,"删除车辆成功");
|
|
||||||
}
|
|
||||||
return Result.error(402,"删除车辆失败");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,13 +124,12 @@ public class CarInformationServiceImpl implements CarInformationService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result updatecarInformation(CarInformationUpdReq carInformationUpdReq) {
|
public boolean updatecarInformation(CarInformationUpdReq carInformationUpdReq) {
|
||||||
Integer updatecarInformation = carInformationMapper.updatecarInformation(carInformationUpdReq);
|
Long carInformationId = carInformationUpdReq.getCarInformationId();
|
||||||
if(updatecarInformation > 0)
|
boolean updatecarInformation = this.updateById(
|
||||||
{
|
CarInformation.carInformationUpdBuilder(
|
||||||
return Result.success(carInformationUpdReq,"修改成功");
|
carInformationUpdReq, ()->carInformationId));
|
||||||
}
|
return updatecarInformation;
|
||||||
return Result.error( 402,"修改失败");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -105,6 +140,17 @@ public class CarInformationServiceImpl implements CarInformationService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<CarInformationResp> selectBycarInformationIDAndLicensePlate() {
|
public List<CarInformationResp> selectBycarInformationIDAndLicensePlate() {
|
||||||
return carInformationMapper.selectBycarInformationIDAndLicensePlate();
|
List<CarInformation> list = this.list()
|
||||||
|
.stream()
|
||||||
|
.map(CarInformation::carInformationBuilder)
|
||||||
|
.toList();
|
||||||
|
ArrayList<CarInformationResp> carInformationResps = new ArrayList<>();
|
||||||
|
CarInformationResp carInformation1 = new CarInformationResp();
|
||||||
|
list.forEach(carInformation -> {
|
||||||
|
carInformation1.setCarInformationId(carInformation.getCarInformationId());
|
||||||
|
carInformation1.setCarInformationLicensePlate( carInformation.getCarInformationLicensePlate());
|
||||||
|
carInformationResps.add(carInformation1);
|
||||||
|
});
|
||||||
|
return carInformationResps;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,14 +3,14 @@ package com.muyu.server.service.impl;
|
||||||
import cn.hutool.db.Page;
|
import cn.hutool.db.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.domain.CarMessage;
|
import com.muyu.domain.CarMessage;
|
||||||
import com.muyu.domain.CarMessageType;
|
import com.muyu.domain.CarMessageType;
|
||||||
|
import com.muyu.domain.CarType;
|
||||||
import com.muyu.domain.resp.CarMessageResp;
|
import com.muyu.domain.resp.CarMessageResp;
|
||||||
import com.muyu.server.mapper.CarMessageMapper;
|
import com.muyu.server.mapper.CarMessageMapper;
|
||||||
import com.muyu.server.service.CarMessageService;
|
import com.muyu.server.service.CarMessageService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -31,41 +31,47 @@ public class CarMessageServiceImpl
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<CarMessage> selectCarMessageList() {
|
public List<CarMessage> selectCarMessageList() {
|
||||||
return carMessageMapper.selectCarMessageList();
|
|
||||||
|
return carMessageMapper.selectJoinList(
|
||||||
|
CarMessage.class
|
||||||
|
,new MPJLambdaWrapper<CarMessage>()
|
||||||
|
.select(CarMessage::getCarMessageId
|
||||||
|
,CarMessage::getCarMessageCarType
|
||||||
|
,CarMessage::getCarMessageType
|
||||||
|
,CarMessage::getCarMessageStartIndex
|
||||||
|
,CarMessage::getCarMessageEndIndex
|
||||||
|
,CarMessage::getMessageTypeClass
|
||||||
|
,CarMessage::getCarMessageState)
|
||||||
|
.select(CarMessageType::getMessageTypeId
|
||||||
|
,CarMessageType::getMessageTypeName
|
||||||
|
,CarMessageType::getMessageTypeBelongs)
|
||||||
|
.select(CarType::getCarTypeId
|
||||||
|
,CarType::getCarTypeName)
|
||||||
|
.leftJoin(CarMessageType.class,CarMessageType::getMessageTypeId,CarMessage::getCarMessageType)
|
||||||
|
.leftJoin(CarType.class,CarType::getCarTypeId,CarMessage::getCarMessageCarType));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 添加车辆报文规则
|
* 添加车辆报文规则
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result insertCarMessage(CarMessage carMessage) {
|
public boolean insertCarMessage(CarMessage carMessage) {
|
||||||
Integer inserted = carMessageMapper.insertCarMessage(carMessage);
|
return this.save(CarMessage.carMessageAddBuilder(carMessage));
|
||||||
if (inserted > 0){
|
|
||||||
return Result.success(inserted,"添加成功");
|
|
||||||
}
|
|
||||||
return Result.error(402,"添加失败");
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 删除车辆报文规则
|
* 删除车辆报文规则
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result delectByCarMessageId(Integer carMessageId) {
|
public boolean delectByCarMessageId(Integer carMessageId) {
|
||||||
Integer deleteByCarMessageId = carMessageMapper.deleteByCarMessageId(carMessageId);
|
return this.removeById(carMessageId);
|
||||||
if (deleteByCarMessageId >0){
|
|
||||||
return Result.success(carMessageId ,"删除成功");
|
|
||||||
}
|
|
||||||
return Result.error(402,"删除失败");
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 修改车辆报文规则
|
* 修改车辆报文规则
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result updateCarMessage(CarMessage carMessage) {
|
public boolean updateCarMessage(CarMessage carMessage) {
|
||||||
Integer integer = carMessageMapper.updateCarMessage(carMessage);
|
// Integer integer = carMessageMapper.updateCarMessage(carMessage);
|
||||||
if(integer > 0)
|
return this.updateById(CarMessage.carMessageUpdBuilder(carMessage, carMessage::getMessageTypeId));
|
||||||
{
|
|
||||||
return Result.success(carMessage,"修改成功");
|
|
||||||
}
|
|
||||||
return Result.error( 402,"修改失败");
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 查询
|
* 查询
|
||||||
|
@ -76,14 +82,14 @@ public class CarMessageServiceImpl
|
||||||
public List<CarMessageResp> selectJoinList(Long id) {
|
public List<CarMessageResp> selectJoinList(Long id) {
|
||||||
return carMessageMapper.selectJoinList(CarMessageResp.class, new MPJLambdaWrapper<CarMessage>()
|
return carMessageMapper.selectJoinList(CarMessageResp.class, new MPJLambdaWrapper<CarMessage>()
|
||||||
.select(CarMessage::getCarMessageId,
|
.select(CarMessage::getCarMessageId,
|
||||||
CarMessage::getCarMessageCartype,
|
CarMessage::getCarMessageCarType,
|
||||||
CarMessage::getCarMessageType,
|
CarMessage::getCarMessageType,
|
||||||
CarMessage::getCarMessageStartIndex,
|
CarMessage::getCarMessageStartIndex,
|
||||||
CarMessage::getCarMessageEndIndex,
|
CarMessage::getCarMessageEndIndex,
|
||||||
CarMessage::getCarMessageState)
|
CarMessage::getCarMessageState)
|
||||||
.select(CarMessageType::getMessageTypeName)
|
.select(CarMessageType::getMessageTypeName)
|
||||||
.leftJoin(CarMessageType.class, CarMessageType::getMessageTypeId, CarMessage::getCarMessageType)
|
.leftJoin(CarMessageType.class, CarMessageType::getMessageTypeId, CarMessage::getCarMessageType)
|
||||||
.eq(CarMessage::getCarMessageCartype, id));
|
.eq(StringUtils.isNotNull(id),CarMessage::getCarMessageCarType, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,192 +0,0 @@
|
||||||
<?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">
|
|
||||||
|
|
||||||
<!-- 1.在mybats的开发中namespace有特殊的意思,一定要是对应接口的全限定名通过namespace可以简历mapper.xml和接口之间的关系(名字不重要,位置不重要)-->
|
|
||||||
|
|
||||||
<mapper namespace="com.muyu.server.mapper.CarInformationMapper">
|
|
||||||
|
|
||||||
<resultMap id="carInformationResult" type="com.muyu.domain.resp.CarInformationResp">
|
|
||||||
<result column="car_information_id" property="carInformationId"/>
|
|
||||||
<result column="car_information_VIN" property="carInformationVin"/>
|
|
||||||
<result column="car_information_license_plate" property="carInformationLicensePlate"/>
|
|
||||||
<result column="car_information_brand" property="carInformationBrand"/>
|
|
||||||
<result column="car_information_color" property="carInformationColor"/>
|
|
||||||
<result column="car_information_driver" property="carInformationDriver"/>
|
|
||||||
<result column="car_information_examine_enddata" property="carInformationExamineEnddata"/>
|
|
||||||
<result column="car_information_motor_manufacturer" property="carInformationMotorManufacturer"/>
|
|
||||||
<result column="car_information_motor_model" property="carInformationMotorModel"/>
|
|
||||||
<result column="car_information_battery_manufacturer" property="carInformationBatteryManufacturer"/>
|
|
||||||
<result column="car_information_battery_model" property="carInformationBatteryModel"/>
|
|
||||||
<result column="car_information_fence" property="carInformationFence"/>
|
|
||||||
<result column="car_information_type" property="carInformationType"/>
|
|
||||||
<result column="car_information_focus" property="carInformationFocus"/>
|
|
||||||
<result column="car_information_state" property="carInformationState"/>
|
|
||||||
<result column="car_type_id" property="carTypeId"/>
|
|
||||||
<result column="car_type_name" property="carTypeName"/>
|
|
||||||
</resultMap>
|
|
||||||
<sql id="carinformationSql">
|
|
||||||
SELECT
|
|
||||||
car_information_id,
|
|
||||||
car_information_VIN,
|
|
||||||
car_information_license_plate,
|
|
||||||
car_information_brand,
|
|
||||||
car_information_color,
|
|
||||||
car_information_driver,
|
|
||||||
car_information_examine_enddata,
|
|
||||||
car_information_motor_manufacturer,
|
|
||||||
car_information_motor_model,
|
|
||||||
car_information_battery_manufacturer,
|
|
||||||
car_information_battery_model,
|
|
||||||
car_information_fence,
|
|
||||||
car_information_type,
|
|
||||||
car_information_focus,
|
|
||||||
car_information_state
|
|
||||||
FROM `car_information`
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
|
|
||||||
<select id="selectCarInformationList" resultMap="carInformationResult" >
|
|
||||||
SELECT
|
|
||||||
car_information_id , car_information_VIN , car_information_license_plate,
|
|
||||||
car_information_brand , car_information_color , car_information_driver,
|
|
||||||
car_information_examine_enddata , car_information_motor_manufacturer , car_information_motor_model,
|
|
||||||
car_information_battery_manufacturer, car_information_battery_model , car_information_fence,
|
|
||||||
car_information_type , car_information_focus , car_information_state,
|
|
||||||
car_type_id , car_type_name ,
|
|
||||||
id , name
|
|
||||||
FROM `car_information`
|
|
||||||
LEFT JOIN `car_type`
|
|
||||||
ON `car_information`.car_information_type = `car_type`.car_type_id
|
|
||||||
LEFT JOIN `car_fence`
|
|
||||||
ON `car_information`.car_information_fence = `car_fence`.id
|
|
||||||
<where>
|
|
||||||
<if test= "carInformationVIN != null and carInformationVIN!='' " >
|
|
||||||
AND `car_information`.car_information_VIN = #{carInformationVin}
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test= "carTypeId != null" >
|
|
||||||
AND `car_information`. car_information_type = #{carTypeId}
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test= "carInformationFence != null" >
|
|
||||||
AND `car_information`.car_information_fence = #{carInformationFence}
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test= "carInformationState != null " >
|
|
||||||
AND `car_information`.car_information_state = #{carInformationState}
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test= "carInformationMotorManufacturer != null and carInformationMotorManufacturer !=''" >
|
|
||||||
AND instr(`car_information`.car_information_motor_manufacturer , #{carInformationMotorManufacturer})
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test= "carInformationMotorModel != null and carInformationMotorModel !='' " >
|
|
||||||
AND `car_information`.car_information_motor_model = #{carInformationMotorModel}
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test= "carInformationBatteryManufacturer != null and carInformationBatteryManufacturer != '' " >
|
|
||||||
AND instr(`car_information`.car_information_battery_manufacturer , #{carInformationBatteryManufacturer})
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test= "carInformationBatteryModel != null and carInformationBatteryModel != '' " >
|
|
||||||
AND `car_information`.car_information_battery_model = #{carInformationBatteryModel}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectBycarInformationIDAndLicensePlate" resultType="com.muyu.domain.resp.CarInformationResp">
|
|
||||||
SELECT
|
|
||||||
car_information_id ,
|
|
||||||
car_information_license_plate
|
|
||||||
FROM `car_information`
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="addCarInformation">
|
|
||||||
INSERT INTO `car_information`
|
|
||||||
(
|
|
||||||
<if test= "carInformationVin != null and carInformationVin!='' " >car_information_VIN,</if>
|
|
||||||
<if test= "carInformationLicensePlate != null and carInformationLicensePlate!='' "> car_information_license_plate,</if>
|
|
||||||
<if test= "carInformationBrand != null and carInformationBrand!='' " >car_information_brand, </if>
|
|
||||||
<if test= "carInformationColor != null and carInformationColor!='' " > car_information_color, </if>
|
|
||||||
<if test= "carInformationDriver != null and carInformationDriver!='' " > car_information_driver, </if>
|
|
||||||
<if test= "carInformationExamineEnddata != null and carInformationExamineEnddata!='' " > car_information_examine_enddata, </if>
|
|
||||||
<if test= "carInformationMotorManufacturer != null and carInformationMotorManufacturer!='' " >car_information_motor_manufacturer, </if>
|
|
||||||
<if test= "carInformationMotorModel != null and carInformationMotorModel!='' " >car_information_motor_model, </if>
|
|
||||||
<if test= "carInformationBatteryManufacturer != null and carInformationBatteryManufacturer!='' " >car_information_battery_manufacturer, </if>
|
|
||||||
<if test= "carInformationBatteryModel != null and carInformationBatteryModel!='' " >car_information_battery_model, </if>
|
|
||||||
<if test= "carInformationFence != null " >car_information_fence, </if>
|
|
||||||
<if test= "carInformationType != null " >car_information_type </if> )
|
|
||||||
VALUES (
|
|
||||||
<if test= "carInformationVin != null and carInformationVin!='' " >#{carInformationVin},</if>
|
|
||||||
<if test= "carInformationLicensePlate != null and carInformationLicensePlate!='' "> #{carInformationLicensePlate},</if>
|
|
||||||
<if test= "carInformationBrand != null and carInformationBrand!='' " > #{carInformationBrand} , </if>
|
|
||||||
<if test= "carInformationColor != null and carInformationColor!='' " > #{carInformationColor}, </if>
|
|
||||||
<if test= "carInformationDriver != null and carInformationDriver!='' " > #{carInformationDriver}, </if>
|
|
||||||
<if test= "carInformationExamineEnddata != null and carInformationExamineEnddata!='' " > #{carInformationExamineEnddata}, </if>
|
|
||||||
<if test= "carInformationMotorManufacturer != null and carInformationMotorManufacturer!='' " >#{carInformationMotorManufacturer}, </if>
|
|
||||||
<if test= "carInformationMotorModel != null and carInformationMotorModel!='' " > #{carInformationMotorModel}, </if>
|
|
||||||
<if test= "carInformationBatteryManufacturer != null and carInformationBatteryManufacturer!='' " > #{carInformationBatteryManufacturer}, </if>
|
|
||||||
<if test= "carInformationBatteryModel != null and carInformationBatteryModel!='' " > #{carInformationBatteryModel}, </if>
|
|
||||||
<if test= "carInformationFence != null " >#{carInformationFence}, </if>
|
|
||||||
<if test= "carInformationType != null " > #{carInformationType} </if> );
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="updatecarInformation">
|
|
||||||
UPDATE `car_information`
|
|
||||||
SET
|
|
||||||
<if test="carInformationVin != null and carInformationVin != '' ">
|
|
||||||
` car_information_VIN` = #{carInformationVin},
|
|
||||||
</if>
|
|
||||||
<if test="carInformationLicensePlate != null and carInformationLicensePlate != '' ">
|
|
||||||
` car_information_license_plate ` = #{carInformationLicensePlate},
|
|
||||||
</if>
|
|
||||||
<if test="carInformationBrand != null and carInformationBrand != '' ">
|
|
||||||
`car_information_brand` = #{carInformationBrand},
|
|
||||||
</if>
|
|
||||||
<if test="carInformationColor != null and carInformationColor != '' ">
|
|
||||||
`car_information_color` = #{carInformationColor},
|
|
||||||
</if>
|
|
||||||
<if test="carInformationDriver != null and carInformationDriver != '' ">
|
|
||||||
`car_information_driver` = #{carInformationDriver},
|
|
||||||
</if>
|
|
||||||
<if test="carInformationMotorManufacturer != null and carInformationMotorManufacturer != '' ">
|
|
||||||
`car_information_motor_manufacturer` = #{carInformationMotorManufacturer},
|
|
||||||
</if>
|
|
||||||
<if test="carInformationMotorModel != null and carInformationMotorModel != '' ">
|
|
||||||
`car_information_motor_model` = #{carInformationMotorModel} ,
|
|
||||||
</if>
|
|
||||||
<if test="carInformationBatteryManufacturer != null and carInformationBatteryManufacturer != '' ">
|
|
||||||
`car_information_battery_manufacturer `= #{carInformationBatteryManufacturer},
|
|
||||||
</if>
|
|
||||||
<if test="carInformationBatteryModel != null and carInformationBatteryModel != '' ">
|
|
||||||
`car_information_battery_model` = #{carInformationBatteryModel},
|
|
||||||
</if>
|
|
||||||
<if test="carInformationFence != null">
|
|
||||||
`car_information_fence` = #{carInformationFence},
|
|
||||||
</if>
|
|
||||||
<if test="carInformationType != null">
|
|
||||||
`car_information_type` = #{carInformationType} ,
|
|
||||||
</if>
|
|
||||||
<if test="carInformationFocus != null">
|
|
||||||
`car_information_focus` = #{carInformationFocus},
|
|
||||||
</if>
|
|
||||||
<if test="carInformationState != null">
|
|
||||||
`car_information_state` = #{carInformationState}
|
|
||||||
</if>
|
|
||||||
WHERE `car_information_id` = #{carInformationId}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
|
|
||||||
<delete id="delBycarInformationId">
|
|
||||||
DELETE FROM `car_information`
|
|
||||||
WHERE `car_information`.car_information_id= #{carInformationId}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
|
|
@ -1,94 +0,0 @@
|
||||||
<?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">
|
|
||||||
|
|
||||||
<!-- 1.在mybats的开发中namespace有特殊的意思,一定要是对应接口的全限定名通过namespace可以简历mapper.xml和接口之间的关系(名字不重要,位置不重要)-->
|
|
||||||
|
|
||||||
<mapper namespace="com.muyu.server.mapper.CarMessageMapper">
|
|
||||||
<resultMap id="carMessageResult" type="com.muyu.domain.CarMessage">
|
|
||||||
<result property="messageTypeId" column="message_type_id"/>
|
|
||||||
<result property="messageTypeCode" column="message_type_code"/>
|
|
||||||
<result property="messageTypeName" column="message_type_name"/>
|
|
||||||
<result property="messageTypeBelongs" column="message_type_belongs"/>
|
|
||||||
<result property="messageTypeClass" column="message_type_class"/>
|
|
||||||
<result property="carMessageId" column="car_message_id"/>
|
|
||||||
<result property="carMessageCartype" column="car_message_cartype"/>
|
|
||||||
<result property="carMessageType" column="car_message_type"/>
|
|
||||||
<result property="carMessageStartIndex" column="car_message_start_index"/>
|
|
||||||
<result property="carMessageEndIndex" column="car_message_end_index"/>
|
|
||||||
<result property="carMessageState" column= "car_message_state"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<insert id="insertCarMessage">
|
|
||||||
INSERT INTO `car_message` (
|
|
||||||
car_message_cartype,
|
|
||||||
car_message_type,
|
|
||||||
car_message_start_index,
|
|
||||||
car_message_end_index,
|
|
||||||
message_type_class,
|
|
||||||
car_message_state
|
|
||||||
)
|
|
||||||
VALUES(
|
|
||||||
#{carMessageCartype},
|
|
||||||
#{carMessageType},
|
|
||||||
#{carMessageStartIndex},
|
|
||||||
#{carMessageEndIndex},
|
|
||||||
#{messageTypeClass},
|
|
||||||
#{carMessageState}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="updateCarMessage">
|
|
||||||
UPDATE `car_message`
|
|
||||||
SET
|
|
||||||
<if test="carMessageCartype != null" >
|
|
||||||
car_message_cartype = #{carMessageCartype} ,
|
|
||||||
</if>
|
|
||||||
<if test="carMessageType != null">
|
|
||||||
car_message_type = #{carMessageType} ,
|
|
||||||
</if>
|
|
||||||
<if test="carMessageStartIndex != null">
|
|
||||||
car_message_start_index = #{carMessageStartIndex} ,
|
|
||||||
</if>
|
|
||||||
<if test="carMessageEndIndex != null">
|
|
||||||
car_message_end_index = #{carMessageEndIndex} ,
|
|
||||||
</if>
|
|
||||||
<if test="messageTypeClass != null and messageTypeClass !=''">
|
|
||||||
message_type_class = #{messageTypeClass} ,
|
|
||||||
</if>
|
|
||||||
<if test="carMessageState != null ">
|
|
||||||
car_message_state = #{carMessageState}
|
|
||||||
</if>
|
|
||||||
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="deleteByCarMessageId">
|
|
||||||
DELETE FROM `car_message`
|
|
||||||
WHERE `car_message`.car_message_id = #{carMessageId}
|
|
||||||
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<select id="selectCarMessageList" resultMap="carMessageResult">
|
|
||||||
SELECT
|
|
||||||
car_message_id,
|
|
||||||
car_message_cartype,
|
|
||||||
car_message_type,
|
|
||||||
car_message_start_index,
|
|
||||||
car_message_end_index,
|
|
||||||
message_type_class,
|
|
||||||
car_message_state,
|
|
||||||
message_type_id,
|
|
||||||
message_type_code,
|
|
||||||
message_type_name,
|
|
||||||
message_type_belongs,
|
|
||||||
car_type_id,
|
|
||||||
car_type_name
|
|
||||||
FROM `car_message`
|
|
||||||
LEFT JOIN `car_message_type`
|
|
||||||
ON `car_message`.car_message_type = `car_message_type`.message_type_id
|
|
||||||
LEFT JOIN `car_type`
|
|
||||||
ON `car_message` .car_message_cartype = `car_type`.car_type_id
|
|
||||||
|
|
||||||
</select>
|
|
||||||
</mapper>
|
|
Loading…
Reference in New Issue