合并故障管理功能
server_2024_4_2_yuanyonghao
玉安君 2024-04-09 16:21:12 +08:00
commit 7abd6f6523
41 changed files with 1871 additions and 27 deletions

View File

@ -0,0 +1,64 @@
package com.zhilian.business.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zhilian.common.core.annotation.Excel;
import com.zhilian.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.List;
/**
* @ClassName Fence
* @Description
* @Author ZeJinG.Su
* @Date 15:28 2024/4/8
*/
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("business_fence")
public class Fence extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
@Excel(name = "参数主键", cellType = Excel.ColumnType.NUMERIC)
@TableId(value = "fence_id", type = IdType.AUTO)
private Long fenceId;
/**
*
*/
@Excel(name = "电子围栏名称")
@TableField("fence_name")
private String fenceName;
/**
*
*/
@Excel(name = "电子围栏类型编号")
@TableField("fence_type_id")
private Long fenceTypeId;
/**
*
*/
@Excel(name = "电子围栏状态")
@TableField("fence_state")
private Long fenceState;
/**
*
*/
@Excel(name = "电子围栏经纬度信息")
@TableField("fence_message")
private String fenceMessage;
@TableField(exist = false)
List<Markers> markersList;
}

View File

@ -0,0 +1,35 @@
package com.zhilian.business.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zhilian.common.core.annotation.Excel;
import com.zhilian.common.core.web.domain.BaseEntity;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.util.List;
@Data
@ToString
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("business_markers")
public class Markers extends BaseEntity {
@TableId(value = "markers_id", type = IdType.AUTO)
@Excel(name = "标识编号")
private Long markersId;
@TableField("markers_name")
@Excel(name = "标识名称")
private String markersName;
@TableField(exist = false)
List<Long> fenceIds;
}

View File

@ -0,0 +1,71 @@
package com.zhilian.business.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zhilian.common.core.annotation.Excel;
import com.zhilian.common.core.web.domain.BaseEntity;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.util.List;
/**
* business_vehicle
*/
@Data
@ToString
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("business_vehicle")
public class Vehicle extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* ID
*/
@Excel(name = "车辆ID",cellType = Excel.ColumnType.NUMERIC)
@TableId(value = "vehicle_id",type = IdType.AUTO)
private Long vehicleId;
/**
* VIN
*/
@TableField("vehicle_vin")
private String vehicleVIN;
/**
*
*/
private Long vehicleTypeId;
@TableField(exist = false)
private Long vehicleTypeName;
/**
*
*/
private String vehicleMotor;
/**
*
*/
private String vehicleBattery;
/**
* ID
*/
private String motorId;
/**
* ID
*/
private String batteryId;
/**
*
*/
private Long vehicleState;
@TableField(exist = false)
private List<Long> markersIds;
}

View File

@ -0,0 +1,29 @@
package com.zhilian.business.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zhilian.common.core.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@ToString
@TableName(value = "business_vehicle_type")
public class VehicleType {
@TableId(value = "vehicle_type_id", type = IdType.AUTO)
@Excel(name = "车型ID")
private Long vehicleTypeId;
@Excel(name = "车型名称")
@TableField(value = "vehicle_type_name")
private String vehicleTypeName;
}

View File

@ -0,0 +1,34 @@
package com.zhilian.business.domain.middle;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.ToString;
@Data
@ToString
@TableName("business_markers_fence")
public class MarkersFence {
/**
*
*/
@TableId(value = "markers_id",type = IdType.INPUT)
private Long markerId;
@TableField(value = "fence_id",insertStrategy = FieldStrategy.IGNORED)
private Long fenceId;
public Long getMarkerId() {
return markerId;
}
public void setMarkerId(Long markerId) {
this.markerId = markerId;
}
public Long getFenceId() {
return fenceId;
}
public void setFenceId(Long fenceId) {
this.fenceId = fenceId;
}
}

View File

@ -0,0 +1,38 @@
package com.zhilian.business.domain.middle;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.ToString;
@Data
@ToString
@TableName("business_vehicle_markers")
public class VehicleMarkers {
/**
*
*/
@TableId(value = "vehicle_id",type = IdType.INPUT)
private Long vehicleId;
/**
*
*/
@TableField(value = "markers_id",insertStrategy = FieldStrategy.IGNORED)
private Long markersId;
public Long getVehicleId() {
return vehicleId;
}
public void setVehicleId(Long vehicleId) {
this.vehicleId = vehicleId;
}
public Long getMarkersId() {
return markersId;
}
public void setMarkersId(Long markersId) {
this.markersId = markersId;
}
}

View File

@ -0,0 +1,8 @@
package com.zhilian.business.domain.vo;
import lombok.Data;
@Data
public class MarkersVo {
}

View File

@ -0,0 +1,37 @@
package com.zhilian.business.domain.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.zhilian.common.core.annotation.Excel;
import lombok.Data;
@Data
public class VehicleVo {
/**
* VIN
*/
private String vehicleVIN;
/**
*
*/
private Long vehicleTypeId;
/**
*
*/
private Long fenceId;
/**
*
*/
private String motorBusiness;
/**
*
*/
private String batteryBusiness;
/**
* ID
*/
private String motorID;
/**
* ID
*/
private String batteryID;
}

View File

@ -0,0 +1,7 @@
package com.zhilian.business.remote;
import org.springframework.stereotype.Component;
@Component
public interface RemoteFenceService {
}

View File

@ -0,0 +1,8 @@
package com.zhilian.business.remote.factory;
import com.zhilian.common.core.constant.ServiceNameConstants;
import org.springframework.cloud.openfeign.FeignClient;
//@FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.FILE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
public class RemoteFenceFallbackFactory {
}

View File

@ -13,12 +13,14 @@ import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.List;
/**
* @ClassName Fence
* @Description
* @Author ZeJinG.Su
* @Date 15:28 2024/4/8
*/
@Data
@SuperBuilder
@NoArgsConstructor

View File

@ -1,3 +1,4 @@
package com.zhilian.common.business.domain.vo;
import lombok.AllArgsConstructor;

View File

@ -0,0 +1,102 @@
package com.zhilian.business.controller;
import com.zhilian.business.domain.Break;
import com.zhilian.business.domain.BreakVo;
import com.zhilian.business.service.BreakService;
import com.zhilian.common.core.domain.Result;
import com.zhilian.common.core.web.page.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
/**
* @ClassName BreakController
* @Description
* @Author YuanYongH
* @Date 2024/4/4 9:40
*/
@RestController
public class BreakController {
@Autowired
private BreakService breakService;
/**
* @Description // 故障列表
* @Date 2024/4/4
* @param breakVo
* @return com.zhilian.common.core.domain.Result<com.zhilian.common.core.web.page.PageResult<com.zhilian.business.domain.Break>>
**/
@PostMapping("breakList")
public Result<PageResult<Break>> breakList(@RequestBody BreakVo breakVo) {
PageResult<Break> pageResult = breakService.breakList(breakVo);
return Result.success(pageResult);
}
/**
* @Description // 故障添加
* @Date 2024/4/4
* @param break1
* @return com.zhilian.common.core.domain.Result
**/
@PostMapping("breakAdd")
public Result breakAdd(@RequestBody Break break1) {
int i = breakService.breakAdd(break1);
Result<Integer> success = Result.success(i);
return success;
}
/**
* @Description // 故障修改
* @Date 2024/4/4
* @param break1
* @return com.zhilian.common.core.domain.Result
**/
@PostMapping("breakUpd")
public Result breadUpd(@RequestBody Break break1) {
int i = breakService.breakUpd(break1);
Result<Integer> success = Result.success(i);
return success;
}
/**
* @Description // 故障删除
* @Date 2024/4/4
* @param breakId
* @return com.zhilian.common.core.domain.Result
**/
@PostMapping("breakDel/{breakId}")
public Result delFirm(@PathVariable Integer breakId){
int i = breakService.breakDel(breakId);
Result<Integer> success = Result.success(i);
return success;
}
}

View File

@ -0,0 +1,31 @@
package com.zhilian.business.controller;
import com.zhilian.business.domain.BreakLog;
import com.zhilian.business.service.BreakLogService;
import com.zhilian.common.core.domain.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @ClassName BreakLogController
* @Description TODO
* @Author YuanYongH
* @Date 2024/4/8 20:48
*/
@RestController
public class BreakLogController {
@Autowired
private BreakLogService breakLogService;
@PostMapping("log")
public Result<List<BreakLog>> breakLog() {
List<BreakLog> list = breakLogService.breakLog();
Result<List<BreakLog>> success = Result.success(list);
return success;
}
}

View File

@ -0,0 +1,117 @@
package com.zhilian.business.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.zhilian.business.domain.BreakLog;
import com.zhilian.business.domain.request.BreakReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zhilian.common.log.annotation.Log;
import com.zhilian.common.log.enums.BusinessType;
import com.zhilian.common.security.annotation.RequiresPermissions;
import com.zhilian.business.domain.BusinessBreak;
import com.zhilian.business.service.IBusinessBreakService;
import com.zhilian.common.core.web.controller.BaseController;
import com.zhilian.common.core.domain.Result;
import com.zhilian.common.core.utils.poi.ExcelUtil;
import com.zhilian.common.core.web.page.*;
/**
* Controller
*
* @author Yy
* @date 2024-04-07
*/
@RestController
@RequestMapping("/break")
public class BusinessBreakController extends BaseController
{
@Autowired
private IBusinessBreakService businessBreakService;
/**
*
*/
// @RequiresPermissions("business:break:list")
@GetMapping("/list")
public Result<TableDataInfo<BusinessBreak>> list(BreakReq breakReq)
{
startPage();
List<BusinessBreak> list = businessBreakService.selectBusinessBreakList(breakReq);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("business:break:export")
@Log(title = "故障", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BreakReq breakReq)
{
List<BusinessBreak> list = businessBreakService.selectBusinessBreakList(breakReq);
ExcelUtil<BusinessBreak> util = new ExcelUtil<BusinessBreak>(BusinessBreak.class);
util.exportExcel(response, list, "故障数据");
}
/**
*
*/
@RequiresPermissions("business:break:query")
@GetMapping(value = "/{breakId}")
public Result getInfo(@PathVariable("breakId") Long breakId)
{
return success(businessBreakService.selectBusinessBreakByBreakId(breakId));
}
/**
*
*/
@RequiresPermissions("business:break:add")
@Log(title = "故障", businessType = BusinessType.INSERT)
@PostMapping
public Result add(@RequestBody BusinessBreak businessBreak)
{
return toAjax(businessBreakService.insertBusinessBreak(businessBreak));
}
/**
*
*/
@RequiresPermissions("business:break:edit")
@Log(title = "故障", businessType = BusinessType.UPDATE)
@PutMapping
public Result edit(@RequestBody BusinessBreak businessBreak)
{
return toAjax(businessBreakService.updateBusinessBreak(businessBreak));
}
/**
*
*/
@RequiresPermissions("business:break:remove")
@Log(title = "故障", businessType = BusinessType.DELETE)
@DeleteMapping("/{breakIds}")
public Result remove(@PathVariable Long[] breakIds)
{
return toAjax(businessBreakService.deleteBusinessBreakByBreakIds(breakIds));
}
/**
*
*/
@PostMapping("breakLog")
public Result<List<BreakLog>> breakLog(){
List<BreakLog> list = businessBreakService.breakLog();
Result<List<BreakLog>> success = Result.success(list);
return success;
}
}

View File

@ -0,0 +1,44 @@
package com.zhilian.business.domain;
import io.swagger.models.auth.In;
import lombok.Data;
import java.util.Date;
/**
* @ClassName Break
* @Description
* @Author YuanYongH
* @Date 2024/4/4 9:40
*/
@Data
public class Break {
/**
* id
**/
private Integer breakId;
/**
*
**/
private String breakCode;
/**
* VIN
**/
private String breakVin;
/**
*
**/
private Date breakDate;
/**
*
**/
private Date breakTime;
/**
*
**/
private String breakType;
/**
*
**/
private Integer breakState;
}

View File

@ -0,0 +1,30 @@
package com.zhilian.business.domain;
import com.zhilian.common.core.web.page.PageResult;
import io.swagger.models.auth.In;
import lombok.Data;
/**
* @ClassName BreakLog
* @Description TODO
* @Author YuanYongH
* @Date 2024/4/8 15:07
*/
@Data
public class BreakLog {
/** 故障日志id */
private Integer breakLogId;
/** 故障码 */
private String breakCode;
/** 车辆VIN */
private String breakVin;
/** 故障类型 */
private String breakType;
/** 结束报警时间 */
private String breakTime;
/** 开始报警时间 */
private String breakDate;
/** 是否报警 */
private String breakState;
}

View File

@ -0,0 +1,33 @@
package com.zhilian.business.domain;
import io.swagger.models.auth.In;
import lombok.Data;
/**
* @ClassName BreakVo
* @Description TODO
* @Author YuanYongH
* @Date 2024/4/4 9:51
*/
@Data
public class BreakVo {
/**
* id
**/
private Integer breakId;
/**
* VIN
**/
private String breakVin;
/**
*
**/
private Integer breakState;
/**
*
**/
private Integer pageNum = 1;
private Integer pageSize = 3;
}

View File

@ -0,0 +1,112 @@
package com.zhilian.business.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhilian.common.core.annotation.Excel;
import com.zhilian.common.core.web.domain.BaseEntity;
/**
* business_break
*
* @author Yy
* @date 2024-04-07
*/
@Data
public class BusinessBreak extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long breakId;
/** 故障码 */
@Excel(name = "故障码")
private String breakCode;
/** 车辆VIN */
@Excel(name = "车辆VIN")
private String breakVin;
/** 结束报警时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束报警时间", width = 30, dateFormat = "yyyy-MM-dd")
private String breakTime;
/** 故障类型 */
@Excel(name = "故障类型")
private String breakType;
/** 开始报警时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始报警时间", width = 30, dateFormat = "yyyy-MM-dd")
private String breakDate;
/** 是否警告 */
@Excel(name = "是否警告")
private String breakState;
public void setBreakId(Long breakId)
{
this.breakId = breakId;
}
public Long getBreakId()
{
return breakId;
}
public void setBreakCode(String breakCode)
{
this.breakCode = breakCode;
}
public String getBreakCode()
{
return breakCode;
}
public void setBreakVin(String breakVin)
{
this.breakVin = breakVin;
}
public String getBreakVin()
{
return breakVin;
}
public void setBreakType(String breakType)
{
this.breakType = breakType;
}
public String getBreakType()
{
return breakType;
}
public void setBreakState(String breakState)
{
this.breakState = breakState;
}
public String getBreakState()
{
return breakState;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("breakId", getBreakId())
.append("breakCode", getBreakCode())
.append("breakVin", getBreakVin())
.append("breakTime", getBreakTime())
.append("breakType", getBreakType())
.append("breakDate", getBreakDate())
.append("breakState", getBreakState())
.toString();
}
}

View File

@ -0,0 +1,28 @@
package com.zhilian.business.domain.request;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @ClassName BreakReq
* @Description TODO
* @Author YuanYongH
* @Date 2024/4/8 15:28
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BreakReq {
/** 故障id */
private Integer breakId;
/** 故障码 */
private String breakCode;
/** 车辆VIN */
private String breakVin;
/** 故障类型 */
private String breakType;
}

View File

@ -0,0 +1,18 @@
package com.zhilian.business.mapper;
import com.zhilian.business.domain.BreakLog;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @ClassName BreakLogMapper
* @Description TODO
* @Author YuanYongH
* @Date 2024/4/8 20:49
*/
@Mapper
public interface BreakLogMapper {
List<BreakLog> breakLog();
}

View File

@ -0,0 +1,27 @@
package com.zhilian.business.mapper;
import com.zhilian.business.domain.Break;
import com.zhilian.business.domain.BreakVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.Date;
import java.util.List;
/**
* @ClassName BreakMapper
* @Description TODO
* @Author YuanYongH
* @Date 2024/4/4 9:59
*/
@Mapper
public interface BreakMapper {
List<Break> breakList(BreakVo breakVo);
int breakAdd(Break break1);
int breakUpd(Break break1);
int breakDel(Integer breakId);
Integer addBreak(String breakCode, String breakVin, Date breakTime, Date breakDate, String breakType, Integer breakState);
}

View File

@ -0,0 +1,67 @@
package com.zhilian.business.mapper;
import java.util.List;
import com.zhilian.business.domain.BreakLog;
import com.zhilian.business.domain.BusinessBreak;
import com.zhilian.business.domain.request.BreakReq;
/**
* Mapper
*
* @author Yy
* @date 2024-04-07
*/
public interface BusinessBreakMapper
{
/**
*
*
* @param breakId
* @return
*/
public BusinessBreak selectBusinessBreakByBreakId(Long breakId);
/**
*
*
* @param breakReq
* @return
*/
public List<BusinessBreak> selectBusinessBreakList(BreakReq breakReq);
/**
*
*
* @param businessBreak
* @return
*/
public int insertBusinessBreak(BusinessBreak businessBreak);
/**
*
*
* @param businessBreak
* @return
*/
public int updateBusinessBreak(BusinessBreak businessBreak);
/**
*
*
* @param breakId
* @return
*/
public int deleteBusinessBreakByBreakId(Long breakId);
/**
*
*
* @param breakIds
* @return
*/
public int deleteBusinessBreakByBreakIds(Long[] breakIds);
List<BreakLog> breakLog();
}

View File

@ -0,0 +1,16 @@
package com.zhilian.business.service;
import com.zhilian.business.domain.BreakLog;
import java.util.List;
/**
* @ClassName BreakLogService
* @Description TODO
* @Author YuanYongH
* @Date 2024/4/8 20:49
*/
public interface BreakLogService {
List<BreakLog> breakLog();
}

View File

@ -0,0 +1,21 @@
package com.zhilian.business.service;
import com.zhilian.business.domain.Break;
import com.zhilian.business.domain.BreakVo;
import com.zhilian.common.core.web.page.PageResult;
/**
* @ClassName BreakService
* @Description TODO
* @Author YuanYongH
* @Date 2024/4/4 9:54
*/
public interface BreakService {
PageResult<Break> breakList(BreakVo breakVo);
int breakAdd(Break break1);
int breakUpd(Break break1);
int breakDel(Integer breakId);
}

View File

@ -0,0 +1,67 @@
package com.zhilian.business.service;
import java.util.List;
import com.zhilian.business.domain.BreakLog;
import com.zhilian.business.domain.BusinessBreak;
import com.zhilian.business.domain.request.BreakReq;
/**
* Service
*
* @author Yy
* @date 2024-04-07
*/
public interface IBusinessBreakService
{
/**
*
*
* @param breakId
* @return
*/
public BusinessBreak selectBusinessBreakByBreakId(Long breakId);
/**
*
*
* @param breakReq
* @return
*/
public List<BusinessBreak> selectBusinessBreakList(BreakReq breakReq);
/**
*
*
* @param businessBreak
* @return
*/
public int insertBusinessBreak(BusinessBreak businessBreak);
/**
*
*
* @param businessBreak
* @return
*/
public int updateBusinessBreak(BusinessBreak businessBreak);
/**
*
*
* @param breakIds
* @return
*/
public int deleteBusinessBreakByBreakIds(Long[] breakIds);
/**
*
*
* @param breakId
* @return
*/
public int deleteBusinessBreakByBreakId(Long breakId);
List<BreakLog> breakLog();
}

View File

@ -0,0 +1,67 @@
package com.zhilian.business.service.impl;
import com.zhilian.business.domain.BreakLog;
import com.zhilian.business.mapper.BreakLogMapper;
import com.zhilian.business.service.BreakLogService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @ClassName BreakLogServiceImpl
* @Description
* @Author YuanYongH
* @Date 2024/4/8 20:49
*/
@Service
@Log4j2
public class BreakLogServiceImpl implements BreakLogService {
@Autowired
private BreakLogMapper breakLogMapper;
@Autowired
private RedisTemplate<String ,String> redisTemplate;
@Override
public List<BreakLog> breakLog() {
BreakLog breakLog = new BreakLog();
// 10秒
final long timeInterval = 10000;
Runnable runnable = new Runnable() {
@Override
public void run() {
while (true){
breakLogMapper.breakLog();
log.info("扫描故障状态");
String breakState = breakLog.getBreakState();
if (breakState != null){
// 判断故障状态
if (breakLog.getBreakState().equals("0")){
log.info("正常");
}else if (breakLog.getBreakState().equals("1")){
log.info("故障");
}else {
log.info("未知");
}
}
try {
Thread.sleep(timeInterval);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
};
// 开启线程
Thread thread = new Thread(runnable);
thread.start();
// 返回故障日志
return breakLogMapper.breakLog();
}
}

View File

@ -0,0 +1,51 @@
package com.zhilian.business.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhilian.business.domain.Break;
import com.zhilian.business.domain.BreakVo;
import com.zhilian.business.mapper.BreakMapper;
import com.zhilian.business.service.BreakService;
import com.zhilian.common.core.web.page.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @ClassName BreakServiceImpl
* @Description TODO
* @Author YuanYongH
* @Date 2024/4/4 9:54
*/
@Service
public class BreakServiceImpl implements BreakService {
@Autowired
private BreakMapper breakMapper;
@Override
public PageResult<Break> breakList(BreakVo breakVo) {
PageHelper.startPage(breakVo.getPageNum(),breakVo.getPageSize());
List<Break> list = breakMapper.breakList(breakVo);
PageInfo<Break> info = new PageInfo<>(list);
return PageResult.toResult(info.getTotal(),list).getData();
}
@Override
public int breakAdd(Break break1) {
int i = breakMapper.breakAdd(break1);
if (i>0){
breakMapper.addBreak(break1.getBreakCode(),break1.getBreakVin(),break1.getBreakTime(),break1.getBreakDate(),break1.getBreakType(),break1.getBreakState());
}
return i;
}
@Override
public int breakUpd(Break break1) {
return breakMapper.breakUpd(break1);
}
@Override
public int breakDel(Integer breakId) {
return breakMapper.breakDel(breakId);
}
}

View File

@ -0,0 +1,101 @@
package com.zhilian.business.service.impl;
import java.util.List;
import com.zhilian.business.domain.BreakLog;
import com.zhilian.business.domain.request.BreakReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhilian.business.mapper.BusinessBreakMapper;
import com.zhilian.business.domain.BusinessBreak;
import com.zhilian.business.service.IBusinessBreakService;
/**
* Service
*
* @author Yy
* @date 2024-04-07
*/
@Service
public class BusinessBreakServiceImpl implements IBusinessBreakService
{
@Autowired
private BusinessBreakMapper businessBreakMapper;
/**
*
*
* @param breakId
* @return
*/
@Override
public BusinessBreak selectBusinessBreakByBreakId(Long breakId)
{
return businessBreakMapper.selectBusinessBreakByBreakId(breakId);
}
/**
*
*
* @param breakReq
* @return
*/
@Override
public List<BusinessBreak> selectBusinessBreakList(BreakReq breakReq)
{
return businessBreakMapper.selectBusinessBreakList(breakReq);
}
/**
*
*
* @param businessBreak
* @return
*/
@Override
public int insertBusinessBreak(BusinessBreak businessBreak)
{
return businessBreakMapper.insertBusinessBreak(businessBreak);
}
/**
*
*
* @param businessBreak
* @return
*/
@Override
public int updateBusinessBreak(BusinessBreak businessBreak)
{
return businessBreakMapper.updateBusinessBreak(businessBreak);
}
/**
*
*
* @param breakIds
* @return
*/
@Override
public int deleteBusinessBreakByBreakIds(Long[] breakIds)
{
return businessBreakMapper.deleteBusinessBreakByBreakIds(breakIds);
}
/**
*
*
* @param breakId
* @return
*/
@Override
public int deleteBusinessBreakByBreakId(Long breakId)
{
return businessBreakMapper.deleteBusinessBreakByBreakId(breakId);
}
@Override
public List<BreakLog> breakLog() {
return businessBreakMapper.breakLog();
}
}

View File

@ -0,0 +1,10 @@
<?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.zhilian.business.mapper.BreakLogMapper">
<select id="breakLog" resultType="com.zhilian.business.domain.BreakLog">
select * from business_break_log
</select>
</mapper>

View File

@ -0,0 +1,22 @@
<?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.zhilian.business.mapper.BreakMapper">
<insert id="breakAdd">
</insert>
<insert id="addBreak">
</insert>
<update id="breakUpd">
</update>
<update id="breakDel">
delete from business_breakdown where break_id = #{breakId}
</update>
<select id="breakList" resultType="com.zhilian.business.domain.Break">
select * from business_break
</select>
</mapper>

View File

@ -0,0 +1,81 @@
<?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.zhilian.business.mapper.BusinessBreakMapper">
<resultMap type="com.zhilian.business.domain.BusinessBreak" id="BusinessBreakResult">
<result property="breakId" column="break_id" />
<result property="breakCode" column="break_code" />
<result property="breakVin" column="break_vin" />
<result property="breakTime" column="break_time" />
<result property="breakType" column="break_type" />
<result property="breakDate" column="break_date" />
<result property="breakState" column="break_state" />
</resultMap>
<sql id="selectBusinessBreakVo">
select break_id, break_code, break_vin, break_time, break_type, break_date, break_state from business_break
</sql>
<select id="selectBusinessBreakList" parameterType="com.zhilian.business.domain.BusinessBreak" resultMap="BusinessBreakResult">
<include refid="selectBusinessBreakVo"/>
<where>
<if test="breakCode != null and breakCode != ''"> and break_code = #{breakCode}</if>
<if test="breakVin != null and breakVin != ''"> and break_vin = #{breakVin}</if>
<if test="breakType != null and breakType != ''"> and break_type = #{breakType}</if>
</where>
</select>
<select id="selectBusinessBreakByBreakId" parameterType="Long" resultMap="BusinessBreakResult">
<include refid="selectBusinessBreakVo"/>
where break_id = #{breakId}
</select>
<select id="breakLog" resultType="com.zhilian.business.domain.BreakLog">
select * from business_break_log
</select>
<insert id="insertBusinessBreak" parameterType="com.zhilian.business.domain.BusinessBreak" useGeneratedKeys="true" keyProperty="breakId">
insert into business_break
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="breakCode != null">break_code,</if>
<if test="breakVin != null">break_vin,</if>
<if test="breakTime != null">break_time,</if>
<if test="breakType != null">break_type,</if>
<if test="breakDate != null">break_date,</if>
<if test="breakState != null">break_state,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="breakCode != null">#{breakCode},</if>
<if test="breakVin != null">#{breakVin},</if>
<if test="breakTime != null">#{breakTime},</if>
<if test="breakType != null">#{breakType},</if>
<if test="breakDate != null">#{breakDate},</if>
<if test="breakState != null">#{breakState},</if>
</trim>
</insert>
<update id="updateBusinessBreak" parameterType="com.zhilian.business.domain.BusinessBreak">
update business_break
<trim prefix="SET" suffixOverrides=",">
<if test="breakCode != null">break_code = #{breakCode},</if>
<if test="breakVin != null">break_vin = #{breakVin},</if>
<if test="breakTime != null">break_time = #{breakTime},</if>
<if test="breakType != null">break_type = #{breakType},</if>
<if test="breakDate != null">break_date = #{breakDate},</if>
<if test="breakState != null">break_state = #{breakState},</if>
</trim>
where break_id = #{breakId}
</update>
<delete id="deleteBusinessBreakByBreakId" parameterType="Long">
delete from business_break where break_id = #{breakId}
</delete>
<delete id="deleteBusinessBreakByBreakIds" parameterType="String">
delete from business_break where break_id in
<foreach item="breakId" collection="array" open="(" separator="," close=")">
#{breakId}
</foreach>
</delete>
</mapper>

View File

@ -140,31 +140,31 @@ public class MqttxConfig {
public void messageArrived(String s, MqttMessage mqttMessage) throws Exception {
log.info("消息到达,接受消息主题{},接受消息Qos{},接受消息内容{}", topic, mqttMessage.getQos(), new String(mqttMessage.getPayload()));
HashSet<String> strings = new HashSet<>();
strings.add("malfunction");
strings.add("event-storage");
strings.add("geofence");
redisService.setCacheSet("vehicle-event:" + "VIN123456789DIJE4",strings);
Set<Object> cacheSet = redisService.getCacheSet("vehicle-event:" + "VIN123456789DIJE4");
if (redisService.hasKey("vehicle-event:" + "VIN123456789DIJE4")){
//有事件
Set<Object> cacheSet1 = redisService.getCacheSet("vehicle-event:" + "VIN123456789DIJE4");
Set<String> events = cacheSet1.stream().map(item -> {
return String.valueOf(item);
}).collect(Collectors.toSet());
if (events.contains("geofence")){
//包含围栏事件
}else {
//不包含围栏事件
redisService.setCacheSet("vehicle-event:" + "VIN123456789DIJE4","geofence");
redisService.deleteCacheSet("vehicle-event:" + "VIN123456789DIJE4");
events.add("geofence");
redisService.setCacheSet("vehicle-event:" + "VIN123456789DIJE4",events);
}
}
// HashSet<String> strings = new HashSet<>();
// strings.add("malfunction");
// strings.add("event-storage");
// strings.add("geofence");
//
// redisService.setCacheSet("vehicle-event:" + "VIN123456789DIJE4",strings);
// Set<Object> cacheSet = redisService.getCacheSet("vehicle-event:" + "VIN123456789DIJE4");
//
// if (redisService.hasKey("vehicle-event:" + "VIN123456789DIJE4")){
// //有事件
// Set<Object> cacheSet1 = redisService.getCacheSet("vehicle-event:" + "VIN123456789DIJE4");
// Set<String> events = cacheSet1.stream().map(item -> {
// return String.valueOf(item);
// }).collect(Collectors.toSet());
// if (events.contains("geofence")){
// //包含围栏事件
//
// }else {
// //不包含围栏事件
// redisService.setCacheSet("vehicle-event:" + "VIN123456789DIJE4","geofence");
// redisService.deleteCacheSet("vehicle-event:" + "VIN123456789DIJE4");
// events.add("geofence");
// redisService.setCacheSet("vehicle-event:" + "VIN123456789DIJE4",events);
// }
// }
//将接受到的车辆报文存储到kafka中
executorService.execute(() -> {

View File

@ -1,5 +1,7 @@
package com.zhilian.resolver;
import com.zhilian.common.security.annotation.EnableCustomConfig;
import com.zhilian.common.security.annotation.EnableMyFeignClients;
import com.zhilian.common.swagger.annotation.EnableCustomSwagger2;
import org.mybatis.spring.annotation.MapperScan;
@ -7,6 +9,13 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* @ClassName ZhiLianResolverApplication
* @Description TODO
* @Author YuanYongH
* @Date 2024/4/8 17:25
*/
@EnableCustomConfig
@EnableCustomSwagger2
@EnableScheduling
@EnableMyFeignClients

View File

@ -4,7 +4,6 @@ import com.zhilian.common.business.domain.vo.FenceVo;
import com.zhilian.common.resolver.domain.ResolverReportData;
import com.zhilian.resolver.service.ResolverEventService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;

View File

@ -0,0 +1,103 @@
package com.zhilian.system.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zhilian.common.log.annotation.Log;
import com.zhilian.common.log.enums.BusinessType;
import com.zhilian.common.security.annotation.RequiresPermissions;
import com.zhilian.system.domain.BusinessBreak;
import com.zhilian.system.service.IBusinessBreakService;
import com.zhilian.common.core.web.controller.BaseController;
import com.zhilian.common.core.domain.Result;
import com.zhilian.common.core.utils.poi.ExcelUtil;
import com.zhilian.common.core.web.page.TableDataInfo;
/**
*
* @author y
* @date 2024-04-07
*/
@RestController
@RequestMapping("/break")
public class BusinessBreakController extends BaseController
{
@Autowired
private IBusinessBreakService businessBreakService;
/**
*
*/
@RequiresPermissions("system:break:list")
@GetMapping("/list")
public Result<TableDataInfo<BusinessBreak>> list(BusinessBreak businessBreak)
{
startPage();
List<BusinessBreak> list = businessBreakService.selectBusinessBreakList(businessBreak);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("system:break:export")
@Log(title = "", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BusinessBreak businessBreak)
{
List<BusinessBreak> list = businessBreakService.selectBusinessBreakList(businessBreak);
ExcelUtil<BusinessBreak> util = new ExcelUtil<BusinessBreak>(BusinessBreak.class);
util.exportExcel(response, list, "故障码数据");
}
/**
*
*/
@RequiresPermissions("system:break:query")
@GetMapping(value = "/{breakId}")
public Result getInfo(@PathVariable("breakId") Long breakId)
{
return success(businessBreakService.selectBusinessBreakByBreakId(breakId));
}
/**
*
*/
@RequiresPermissions("system:break:add")
@Log(title = "", businessType = BusinessType.INSERT)
@PostMapping
public Result add(@RequestBody BusinessBreak businessBreak)
{
return toAjax(businessBreakService.insertBusinessBreak(businessBreak));
}
/**
*
*/
@RequiresPermissions("system:break:edit")
@Log(title = "", businessType = BusinessType.UPDATE)
@PutMapping
public Result edit(@RequestBody BusinessBreak businessBreak)
{
return toAjax(businessBreakService.updateBusinessBreak(businessBreak));
}
/**
*
*/
@RequiresPermissions("system:break:remove")
@Log(title = "", businessType = BusinessType.DELETE)
@DeleteMapping("/{breakIds}")
public Result remove(@PathVariable Long[] breakIds)
{
return toAjax(businessBreakService.deleteBusinessBreakByBreakIds(breakIds));
}
}

View File

@ -0,0 +1,150 @@
package com.zhilian.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhilian.common.core.annotation.Excel;
import com.zhilian.common.core.web.domain.BaseEntity;
/**
*
* @author zhilian
* @date 2024-04-07
*/
public class BusinessBreak extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long breakId;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String breakCar;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String breakVin;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date breakTime;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String breakType;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String breakRank;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String breakState;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String breakDevice;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String breakDesc;
public void setBreakId(Long breakId)
{
this.breakId = breakId;
}
public Long getBreakId()
{
return breakId;
}
public void setBreakCar(String breakCar)
{
this.breakCar = breakCar;
}
public String getBreakCar()
{
return breakCar;
}
public void setBreakVin(String breakVin)
{
this.breakVin = breakVin;
}
public String getBreakVin()
{
return breakVin;
}
public void setBreakTime(Date breakTime)
{
this.breakTime = breakTime;
}
public Date getBreakTime()
{
return breakTime;
}
public void setBreakType(String breakType)
{
this.breakType = breakType;
}
public String getBreakType()
{
return breakType;
}
public void setBreakRank(String breakRank)
{
this.breakRank = breakRank;
}
public String getBreakRank()
{
return breakRank;
}
public void setBreakState(String breakState)
{
this.breakState = breakState;
}
public String getBreakState()
{
return breakState;
}
public void setBreakDevice(String breakDevice)
{
this.breakDevice = breakDevice;
}
public String getBreakDevice()
{
return breakDevice;
}
public void setBreakDesc(String breakDesc)
{
this.breakDesc = breakDesc;
}
public String getBreakDesc()
{
return breakDesc;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("breakId", getBreakId())
.append("breakCar", getBreakCar())
.append("breakVin", getBreakVin())
.append("breakTime", getBreakTime())
.append("breakType", getBreakType())
.append("breakRank", getBreakRank())
.append("breakState", getBreakState())
.append("breakDevice", getBreakDevice())
.append("breakDesc", getBreakDesc())
.toString();
}
}

View File

@ -0,0 +1,30 @@
package com.zhilian.system.mapper;
import java.util.List;
import com.zhilian.system.domain.BusinessBreak;
/**
*
* @author zhilian
* @date 2024-04-07
*/
public interface BusinessBreakMapper
{
public BusinessBreak selectBusinessBreakByBreakId(Long breakId);
public List<BusinessBreak> selectBusinessBreakList(BusinessBreak businessBreak);
public int insertBusinessBreak(BusinessBreak businessBreak);
public int updateBusinessBreak(BusinessBreak businessBreak);
public int deleteBusinessBreakByBreakId(Long breakId);
public int deleteBusinessBreakByBreakIds(Long[] breakIds);
}

View File

@ -0,0 +1,25 @@
package com.zhilian.system.service;
import java.util.List;
import com.zhilian.system.domain.BusinessBreak;
public interface IBusinessBreakService
{
public BusinessBreak selectBusinessBreakByBreakId(Long breakId);
public List<BusinessBreak> selectBusinessBreakList(BusinessBreak businessBreak);
public int insertBusinessBreak(BusinessBreak businessBreak);
public int updateBusinessBreak(BusinessBreak businessBreak);
public int deleteBusinessBreakByBreakIds(Long[] breakIds);
public int deleteBusinessBreakByBreakId(Long breakId);
}

View File

@ -0,0 +1,58 @@
package com.zhilian.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhilian.system.mapper.BusinessBreakMapper;
import com.zhilian.system.domain.BusinessBreak;
import com.zhilian.system.service.IBusinessBreakService;
@Service
public class BusinessBreakServiceImpl implements IBusinessBreakService
{
@Autowired
private BusinessBreakMapper businessBreakMapper;
@Override
public BusinessBreak selectBusinessBreakByBreakId(Long breakId)
{
return businessBreakMapper.selectBusinessBreakByBreakId(breakId);
}
@Override
public List<BusinessBreak> selectBusinessBreakList(BusinessBreak businessBreak)
{
return businessBreakMapper.selectBusinessBreakList(businessBreak);
}
@Override
public int insertBusinessBreak(BusinessBreak businessBreak)
{
return businessBreakMapper.insertBusinessBreak(businessBreak);
}
@Override
public int updateBusinessBreak(BusinessBreak businessBreak)
{
return businessBreakMapper.updateBusinessBreak(businessBreak);
}
@Override
public int deleteBusinessBreakByBreakIds(Long[] breakIds)
{
return businessBreakMapper.deleteBusinessBreakByBreakIds(breakIds);
}
@Override
public int deleteBusinessBreakByBreakId(Long breakId)
{
return businessBreakMapper.deleteBusinessBreakByBreakId(breakId);
}
}

View File

@ -0,0 +1,91 @@
<?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.zhilian.system.mapper.BusinessBreakMapper">
<resultMap type="com.zhilian.system.domain.BusinessBreak" id="BusinessBreakResult">
<result property="breakId" column="break_id" />
<result property="breakCar" column="break_car" />
<result property="breakVin" column="break_vin" />
<result property="breakTime" column="break_time" />
<result property="breakType" column="break_type" />
<result property="breakRank" column="break_rank" />
<result property="breakState" column="break_state" />
<result property="breakDevice" column="break_device" />
<result property="breakDesc" column="break_desc" />
</resultMap>
<sql id="selectBusinessBreakVo">
select break_id, break_car, break_vin, break_time, break_type, break_rank, break_state, break_device, break_desc from business_break
</sql>
<select id="selectBusinessBreakList" parameterType="com.zhilian.system.domain.BusinessBreak" resultMap="BusinessBreakResult">
<include refid="selectBusinessBreakVo"/>
<where>
<if test="breakCar != null and breakCar != ''"> and break_car = #{breakCar}</if>
<if test="breakVin != null and breakVin != ''"> and break_vin = #{breakVin}</if>
<if test="breakTime != null "> and break_time = #{breakTime}</if>
<if test="breakType != null and breakType != ''"> and break_type = #{breakType}</if>
<if test="breakRank != null and breakRank != ''"> and break_rank = #{breakRank}</if>
<if test="breakState != null and breakState != ''"> and break_state = #{breakState}</if>
<if test="breakDevice != null and breakDevice != ''"> and break_device = #{breakDevice}</if>
<if test="breakDesc != null and breakDesc != ''"> and break_desc = #{breakDesc}</if>
</where>
</select>
<select id="selectBusinessBreakByBreakId" parameterType="Long" resultMap="BusinessBreakResult">
<include refid="selectBusinessBreakVo"/>
where break_id = #{breakId}
</select>
<insert id="insertBusinessBreak" parameterType="com.zhilian.system.domain.BusinessBreak" useGeneratedKeys="true" keyProperty="breakId">
insert into business_break
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="breakCar != null">break_car,</if>
<if test="breakVin != null">break_vin,</if>
<if test="breakTime != null">break_time,</if>
<if test="breakType != null">break_type,</if>
<if test="breakRank != null">break_rank,</if>
<if test="breakState != null">break_state,</if>
<if test="breakDevice != null">break_device,</if>
<if test="breakDesc != null">break_desc,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="breakCar != null">#{breakCar},</if>
<if test="breakVin != null">#{breakVin},</if>
<if test="breakTime != null">#{breakTime},</if>
<if test="breakType != null">#{breakType},</if>
<if test="breakRank != null">#{breakRank},</if>
<if test="breakState != null">#{breakState},</if>
<if test="breakDevice != null">#{breakDevice},</if>
<if test="breakDesc != null">#{breakDesc},</if>
</trim>
</insert>
<update id="updateBusinessBreak" parameterType="com.zhilian.system.domain.BusinessBreak">
update business_break
<trim prefix="SET" suffixOverrides=",">
<if test="breakCar != null">break_car = #{breakCar},</if>
<if test="breakVin != null">break_vin = #{breakVin},</if>
<if test="breakTime != null">break_time = #{breakTime},</if>
<if test="breakType != null">break_type = #{breakType},</if>
<if test="breakRank != null">break_rank = #{breakRank},</if>
<if test="breakState != null">break_state = #{breakState},</if>
<if test="breakDevice != null">break_device = #{breakDevice},</if>
<if test="breakDesc != null">break_desc = #{breakDesc},</if>
</trim>
where break_id = #{breakId}
</update>
<delete id="deleteBusinessBreakByBreakId" parameterType="Long">
delete from business_break where break_id = #{breakId}
</delete>
<delete id="deleteBusinessBreakByBreakIds" parameterType="String">
delete from business_break where break_id in
<foreach item="breakId" collection="array" open="(" separator="," close=")">
#{breakId}
</foreach>
</delete>
</mapper>