feat(): 车辆滑窗配置修改redis
parent
be878ef01a
commit
c0fc641a36
|
@ -18,7 +18,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 车辆故障码对象 fault_code
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 故障记录对象 fault_record
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
package com.muyu.customer.business.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.customer.business.domain.req.IndexConfigurationEditReq;
|
||||
import com.muyu.customer.business.domain.req.IndexConfigurationQueryReq;
|
||||
import com.muyu.customer.business.domain.req.IndexConfigurationSaveReq;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆指标预警配置对象 index_configuration
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-06-28
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("index_configuration")
|
||||
@ApiModel(value = "IndexConfiguration", description = "车辆指标预警配置")
|
||||
public class IndexConfiguration {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@ApiModelProperty(name = "主键id", value = "主键id")
|
||||
private Long id;
|
||||
|
||||
/** 车辆vin */
|
||||
@Excel(name = "车辆vin")
|
||||
@ApiModelProperty(name = "车辆vin", value = "车辆vin")
|
||||
private String vin;
|
||||
|
||||
/** 指标项key */
|
||||
@Excel(name = "指标项key")
|
||||
@ApiModelProperty(name = "指标项key", value = "指标项key")
|
||||
private String keyCode;
|
||||
|
||||
/** 滑窗范围(秒) */
|
||||
@Excel(name = "滑窗范围(秒)")
|
||||
@ApiModelProperty(name = "滑窗范围(秒)", value = "滑窗范围(秒)")
|
||||
private Long intervalRange;
|
||||
|
||||
/** 滑窗时机(秒) */
|
||||
@Excel(name = "滑窗时机(秒)")
|
||||
@ApiModelProperty(name = "滑窗时机(秒)", value = "滑窗时机(秒)")
|
||||
private Long opportunity;
|
||||
|
||||
/** 类型:1 上升 2 波动 3 下降 */
|
||||
@Excel(name = "类型:1 上升 2 波动 3 下降")
|
||||
@ApiModelProperty(name = "类型:1 上升 2 波动 3 下降", value = "类型:1 上升 2 波动 3 下降")
|
||||
private Long attributeType;
|
||||
|
||||
/** 指标值 */
|
||||
@Excel(name = "指标值")
|
||||
@ApiModelProperty(name = "指标值", value = "指标值")
|
||||
private String attributeValue;
|
||||
|
||||
/**
|
||||
* 查询构造器
|
||||
*/
|
||||
public static IndexConfiguration queryBuild( IndexConfigurationQueryReq indexConfigurationQueryReq){
|
||||
return IndexConfiguration.builder()
|
||||
.vin(indexConfigurationQueryReq.getVin())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加构造器
|
||||
*/
|
||||
public static IndexConfiguration saveBuild(IndexConfigurationSaveReq indexConfigurationSaveReq){
|
||||
return IndexConfiguration.builder()
|
||||
.vin(indexConfigurationSaveReq.getVin())
|
||||
.keyCode(indexConfigurationSaveReq.getKeyCode())
|
||||
.intervalRange(indexConfigurationSaveReq.getIntervalRange())
|
||||
.opportunity(indexConfigurationSaveReq.getOpportunity())
|
||||
.attributeType(indexConfigurationSaveReq.getAttributeType())
|
||||
.attributeValue(indexConfigurationSaveReq.getAttributeValue())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改构造器
|
||||
*/
|
||||
public static IndexConfiguration editBuild(Long id, IndexConfigurationEditReq indexConfigurationEditReq){
|
||||
return IndexConfiguration.builder()
|
||||
.id(id)
|
||||
.vin(indexConfigurationEditReq.getVin())
|
||||
.keyCode(indexConfigurationEditReq.getKeyCode())
|
||||
.intervalRange(indexConfigurationEditReq.getIntervalRange())
|
||||
.opportunity(indexConfigurationEditReq.getOpportunity())
|
||||
.attributeType(indexConfigurationEditReq.getAttributeType())
|
||||
.attributeValue(indexConfigurationEditReq.getAttributeValue())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 车辆故障码对象 fault_code
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 车辆故障码对象 fault_code
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 车辆故障码对象 fault_code
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 故障记录对象 fault_record
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 故障记录对象 fault_record
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 故障记录对象 fault_record
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
package com.muyu.customer.business.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
/**
|
||||
* 车辆指标预警配置对象 index_configuration
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-06-28
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "IndexConfigurationEditReq", description = "车辆指标预警配置")
|
||||
public class IndexConfigurationEditReq {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 车辆vin */
|
||||
@ApiModelProperty(name = "车辆vin", value = "车辆vin")
|
||||
private String vin;
|
||||
|
||||
/** 指标项key */
|
||||
@ApiModelProperty(name = "指标项key", value = "指标项key")
|
||||
private String keyCode;
|
||||
|
||||
/** 滑窗范围(秒) */
|
||||
@ApiModelProperty(name = "滑窗范围(秒)", value = "滑窗范围(秒)")
|
||||
private Long intervalRange;
|
||||
|
||||
/** 滑窗时机(秒) */
|
||||
@ApiModelProperty(name = "滑窗时机(秒)", value = "滑窗时机(秒)")
|
||||
private Long opportunity;
|
||||
|
||||
/** 类型:1 上升 2 波动 3 下降 */
|
||||
@ApiModelProperty(name = "类型:1 上升 2 波动 3 下降", value = "类型:1 上升 2 波动 3 下降")
|
||||
private Long attributeType;
|
||||
|
||||
/** 指标值 */
|
||||
@ApiModelProperty(name = "指标值", value = "指标值")
|
||||
private String attributeValue;
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.muyu.customer.business.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆指标预警配置对象 index_configuration
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-06-28
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "IndexConfigurationQueryReq", description = "车辆指标预警配置")
|
||||
public class IndexConfigurationQueryReq {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 车辆vin */
|
||||
@ApiModelProperty(name = "车辆vin", value = "车辆vin")
|
||||
private String vin;
|
||||
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.muyu.customer.business.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆指标预警配置对象 index_configuration
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-06-28
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "IndexConfigurationSaveReq", description = "车辆指标预警配置")
|
||||
public class IndexConfigurationSaveReq {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
|
||||
@ApiModelProperty(name = "主键id", value = "主键id")
|
||||
private Long id;
|
||||
|
||||
/** 车辆vin */
|
||||
|
||||
@ApiModelProperty(name = "车辆vin", value = "车辆vin")
|
||||
private String vin;
|
||||
|
||||
/** 指标项key */
|
||||
|
||||
@ApiModelProperty(name = "指标项key", value = "指标项key")
|
||||
private String keyCode;
|
||||
|
||||
/** 滑窗范围(秒) */
|
||||
|
||||
@ApiModelProperty(name = "滑窗范围(秒)", value = "滑窗范围(秒)")
|
||||
private Long intervalRange;
|
||||
|
||||
/** 滑窗时机(秒) */
|
||||
|
||||
@ApiModelProperty(name = "滑窗时机(秒)", value = "滑窗时机(秒)")
|
||||
private Long opportunity;
|
||||
|
||||
/** 类型:1 上升 2 波动 3 下降 */
|
||||
|
||||
@ApiModelProperty(name = "类型:1 上升 2 波动 3 下降", value = "类型:1 上升 2 波动 3 下降")
|
||||
private Long attributeType;
|
||||
|
||||
/** 指标值 */
|
||||
|
||||
@ApiModelProperty(name = "指标值", value = "指标值")
|
||||
private String attributeValue;
|
||||
|
||||
}
|
|
@ -29,7 +29,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
/**
|
||||
* 车辆故障码Controller
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Api(tags = "车辆故障码")
|
||||
|
|
|
@ -30,7 +30,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
/**
|
||||
* 故障记录Controller
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Api(tags = "故障记录")
|
||||
|
|
|
@ -0,0 +1,154 @@
|
|||
package com.muyu.customer.business.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.customer.business.domain.IndexConfiguration;
|
||||
import com.muyu.customer.business.domain.MessageDetail;
|
||||
import com.muyu.customer.business.domain.Vehicle;
|
||||
import com.muyu.customer.business.domain.req.IndexConfigurationEditReq;
|
||||
import com.muyu.customer.business.domain.req.IndexConfigurationQueryReq;
|
||||
import com.muyu.customer.business.domain.req.IndexConfigurationSaveReq;
|
||||
import com.muyu.customer.business.mapper.MessageDetailMapper;
|
||||
import com.muyu.customer.business.mapper.VehicleMapper;
|
||||
import com.muyu.customer.business.service.IndexConfigurationService;
|
||||
import com.muyu.customer.business.service.MessageDetailService;
|
||||
import com.muyu.customer.business.service.VehicleService;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆指标预警配置Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-06-28
|
||||
*/
|
||||
@Api(tags = "车辆指标预警配置")
|
||||
@RestController
|
||||
@Log4j2
|
||||
@RequestMapping("/indexConfiguration")
|
||||
public class IndexConfigurationController extends BaseController {
|
||||
@Autowired
|
||||
private IndexConfigurationService indexConfigurationService;
|
||||
|
||||
// @Autowired
|
||||
// private VehicleMapper vehicleMapper;
|
||||
@Autowired
|
||||
private MessageDetailMapper messageDetailMapper;
|
||||
|
||||
@Autowired
|
||||
private RabbitTemplate rabbitTemplate;
|
||||
|
||||
@Autowired
|
||||
private StringRedisTemplate redisTemplate;
|
||||
/**
|
||||
* 查询车辆指标预警配置列表
|
||||
*/
|
||||
@ApiOperation("获取车辆指标预警配置列表")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<IndexConfiguration>> list(IndexConfigurationQueryReq indexConfigurationQueryReq) {
|
||||
startPage();
|
||||
List<IndexConfiguration> list = indexConfigurationService.list(IndexConfiguration.queryBuild(indexConfigurationQueryReq));
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出车辆指标预警配置列表
|
||||
*/
|
||||
@RequiresPermissions("customerBusiness:indexConfiguration:list")
|
||||
@ApiOperation("导出车辆指标预警配置列表")
|
||||
@Log(title = "车辆指标预警配置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, IndexConfiguration indexConfiguration) {
|
||||
List<IndexConfiguration> list = indexConfigurationService.list(indexConfiguration);
|
||||
ExcelUtil<IndexConfiguration> util = new ExcelUtil<IndexConfiguration>(IndexConfiguration.class);
|
||||
util.exportExcel(response, list, "车辆指标预警配置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取车辆指标预警配置详细信息
|
||||
*/
|
||||
@ApiOperation("获取车辆指标预警配置详细信息")
|
||||
@RequiresPermissions("customerBusiness:indexConfiguration:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<IndexConfiguration> getInfo(@PathVariable("id") Long id) {
|
||||
return Result.success(indexConfigurationService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增车辆指标预警配置
|
||||
*/
|
||||
@RequiresPermissions("customerBusiness:indexConfiguration:add")
|
||||
@Log(title = "车辆指标预警配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ApiOperation("新增车辆指标预警配置")
|
||||
public Result<String> add(@RequestBody IndexConfigurationSaveReq indexConfigurationSaveReq) {
|
||||
|
||||
indexConfigurationSaveReq.setOpportunity(indexConfigurationSaveReq.getIntervalRange()/indexConfigurationSaveReq.getOpportunity());
|
||||
boolean save = indexConfigurationService.save(IndexConfiguration.saveBuild(indexConfigurationSaveReq));
|
||||
redis(indexConfigurationSaveReq);
|
||||
return toAjax(save);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆指标预警配置
|
||||
*/
|
||||
@RequiresPermissions("customerBusiness:indexConfiguration:edit")
|
||||
@Log(title = "车辆指标预警配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改车辆指标预警配置")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody IndexConfigurationEditReq indexConfigurationEditReq) {
|
||||
indexConfigurationEditReq.setOpportunity(indexConfigurationEditReq.getIntervalRange()/indexConfigurationEditReq.getOpportunity());
|
||||
boolean update = indexConfigurationService.updateById(IndexConfiguration.editBuild(id, indexConfigurationEditReq));
|
||||
// redis(indexConfigurationEditReq);
|
||||
return toAjax(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车辆指标预警配置
|
||||
*/
|
||||
@RequiresPermissions("customerBusiness:indexConfiguration:remove")
|
||||
@Log(title = "车辆指标预警配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除车辆指标预警配置")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(indexConfigurationService.removeBatchByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void redis(IndexConfigurationSaveReq indexConfigurationSaveReq) {
|
||||
List<IndexConfiguration> list = indexConfigurationService.selectByVin(indexConfigurationSaveReq.getVin());
|
||||
// list.add(IndexConfiguration.saveBuild(indexConfigurationSaveReq));
|
||||
// list.stream().distinct();
|
||||
redisTemplate.opsForHash().put("indexConfiguration", indexConfigurationSaveReq.getVin(), JSON.toJSONString(list));
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ import com.muyu.customer.business.domain.FaultCode;
|
|||
/**
|
||||
* 车辆故障码Mapper接口
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
public interface FaultCodeMapper extends BaseMapper<FaultCode> {
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.muyu.customer.business.domain.vo.FaultRecordVo;
|
|||
/**
|
||||
* 故障记录Mapper接口
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
public interface FaultRecordMapper extends BaseMapper<FaultRecord> {
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package com.muyu.customer.business.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.customer.business.domain.IndexConfiguration;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆指标预警配置Mapper接口
|
||||
*
|
||||
* @author chx
|
||||
* @date 2024-06-28
|
||||
*/
|
||||
public interface IndexConfigurationMapper extends BaseMapper<IndexConfiguration> {
|
||||
|
||||
List<IndexConfiguration> selectByVin(@Param("vin") String vin);
|
||||
}
|
|
@ -7,7 +7,7 @@ import com.muyu.customer.business.domain.FaultCode;
|
|||
/**
|
||||
* 车辆故障码Service接口
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
public interface FaultCodeService extends IService<FaultCode> {
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.muyu.customer.business.domain.vo.FaultRecordVo;
|
|||
/**
|
||||
* 故障记录Service接口
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
public interface FaultRecordService extends IService<FaultRecord> {
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package com.muyu.customer.business.service;
|
||||
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.customer.business.domain.IndexConfiguration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆指标预警配置Service接口
|
||||
*
|
||||
* @author chx
|
||||
* @date 2024-06-28
|
||||
*/
|
||||
public interface IndexConfigurationService extends IService<IndexConfiguration> {
|
||||
/**
|
||||
* 查询车辆指标预警配置列表
|
||||
*
|
||||
* @param indexConfiguration 车辆指标预警配置
|
||||
* @return 车辆指标预警配置集合
|
||||
*/
|
||||
public List<IndexConfiguration> list(IndexConfiguration indexConfiguration);
|
||||
|
||||
|
||||
List<IndexConfiguration> selectByVin(String vin);
|
||||
}
|
|
@ -14,7 +14,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
/**
|
||||
* 车辆故障码Service业务层处理
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Slf4j
|
||||
|
|
|
@ -16,7 +16,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
/**
|
||||
* 故障记录Service业务层处理
|
||||
*
|
||||
* @author chx
|
||||
* @author muyu
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Slf4j
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
package com.muyu.customer.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.customer.business.domain.IndexConfiguration;
|
||||
import com.muyu.customer.business.mapper.IndexConfigurationMapper;
|
||||
import com.muyu.customer.business.service.IndexConfigurationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 车辆指标预警配置Service业务层处理
|
||||
*
|
||||
* @author chx
|
||||
* @date 2024-06-28
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class IndexConfigurationServiceImpl extends ServiceImpl<IndexConfigurationMapper, IndexConfiguration> implements IndexConfigurationService {
|
||||
@Autowired
|
||||
private IndexConfigurationMapper indexConfigurationMapper;
|
||||
|
||||
/**
|
||||
* 查询车辆指标预警配置列表
|
||||
*
|
||||
* @param indexConfiguration 车辆指标预警配置
|
||||
* @return 车辆指标预警配置
|
||||
*/
|
||||
@Override
|
||||
public List<IndexConfiguration> list(IndexConfiguration indexConfiguration) {
|
||||
LambdaQueryWrapper<IndexConfiguration> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotEmpty(indexConfiguration.getVin())){
|
||||
queryWrapper.eq(IndexConfiguration::getVin, indexConfiguration.getVin());
|
||||
}
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IndexConfiguration> selectByVin(String vin) {
|
||||
return indexConfigurationMapper.selectByVin(vin);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<?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.muyu.customer.business.mapper.IndexConfigurationMapper">
|
||||
|
||||
<resultMap type="com.muyu.customer.business.domain.IndexConfiguration" id="IndexConfigurationResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="vin" column="vin" />
|
||||
<result property="keyCode" column="key_code" />
|
||||
<result property="intervalRange" column="intervalRange" />
|
||||
<result property="opportunity" column="opportunity" />
|
||||
<result property="attributeType" column="attribute_type" />
|
||||
<result property="attributeValue" column="attribute_value" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectIndexConfigurationVo">
|
||||
select id, vin, key_code, interval_range, opportunity, attribute_type, attribute_value from index_configuration
|
||||
</sql>
|
||||
<select id="selectByVin" resultType="com.muyu.customer.business.domain.IndexConfiguration">
|
||||
select * from index_configuration where vin = #{vin}
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue