feat():车辆预警策略列表,规则列表,通过策略id查询规则,通过策略表的报文id查询报文
parent
6a55491e45
commit
17c891ff02
|
@ -0,0 +1,60 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 10066
|
||||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 106.15.136.7:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: zmw
|
||||
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
||||
# Spring
|
||||
spring:
|
||||
amqp:
|
||||
deserialization:
|
||||
trust:
|
||||
all: true
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
application:
|
||||
# 应用名称
|
||||
name: cloud-car
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos.addr}
|
||||
# nacos用户名
|
||||
username: ${nacos.user-name}
|
||||
# nacos密码
|
||||
password: ${nacos.password}
|
||||
# 命名空间
|
||||
namespace: ${nacos.namespace}
|
||||
config:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos.addr}
|
||||
# nacos用户名
|
||||
username: ${nacos.user-name}
|
||||
# nacos密码
|
||||
password: ${nacos.password}
|
||||
# 命名空间
|
||||
namespace: ${nacos.namespace}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
# 系统共享配置
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# 系统环境Config共享配置
|
||||
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# xxl-job 配置文件
|
||||
- application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# rabbit 配置文件
|
||||
- application-rabbit-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
logging:
|
||||
level:
|
||||
com.muyu.system.mapper: DEBUG
|
|
@ -0,0 +1,39 @@
|
|||
package com.muyu.warn.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.warn.domain.CarMessage;
|
||||
import com.muyu.warn.service.CarMessageService;
|
||||
import com.muyu.warn.service.CarTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName CarMessageController
|
||||
* @Description 描述
|
||||
* @Author YiBo.Liu
|
||||
* @Date 2024/9/22 22:28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/carMessage")
|
||||
public class CarMessageController {
|
||||
@Autowired
|
||||
private CarMessageService carMessageService;
|
||||
|
||||
/**
|
||||
* 根据报文模板id查询报文
|
||||
* @param templateId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/selectByTemplateId")
|
||||
private Result<List<CarMessage>> selectByTemplateId(@RequestParam("templateId") Integer templateId) {
|
||||
return Result.success(carMessageService.list
|
||||
(new LambdaQueryWrapper<CarMessage>().eq(CarMessage::getTemplateId, templateId)));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package com.muyu.warn.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.warn.domain.CarType;
|
||||
import com.muyu.warn.service.CarTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName CarController
|
||||
* @Description 车辆类型Controller层
|
||||
* @Author YiBo.Liu
|
||||
* @Date 2024/9/22 16:52
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/carType")
|
||||
public class CarTypeController {
|
||||
|
||||
@Autowired
|
||||
private CarTypeService carTypeService;
|
||||
|
||||
/**
|
||||
* 查询所有规则
|
||||
* @return carTypeList
|
||||
*/
|
||||
@GetMapping("/carTypeList")
|
||||
private Result<List<CarType>> carTypeList() {
|
||||
List<CarType> carTypeList = carTypeService.list();
|
||||
return Result.success(carTypeList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询类型对象
|
||||
* @param catTypeId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/catTypeId")
|
||||
private Result<CarType> catTypeId(@RequestParam("catTypeId") Integer catTypeId) {
|
||||
CarType carType = carTypeService.findById(catTypeId);
|
||||
return Result.success(carType);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.muyu.warn.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.warn.domain.Template;
|
||||
import com.muyu.warn.service.TemplateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @ClassName Template
|
||||
* @Description 报文模板
|
||||
* @Author YiBo.Liu
|
||||
* @Date 2024/9/22 18:37
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/template")
|
||||
public class TemplateController {
|
||||
|
||||
@Autowired
|
||||
private TemplateService templateService;
|
||||
|
||||
/**
|
||||
* 通过报文id查询
|
||||
* @param templateId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/findByTemplateId")
|
||||
private Result findByTemplateId(@RequestParam("templateId") Integer templateId) {
|
||||
return Result.success(templateService.getOne(
|
||||
new LambdaQueryWrapper<Template>().eq(Template::getTemplateId, templateId)));
|
||||
|
||||
}
|
||||
}
|
|
@ -2,16 +2,12 @@ package com.muyu.warn.controller;
|
|||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.annotation.Resource;
|
||||
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 org.springframework.web.bind.annotation.*;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.warn.domain.WarnRule;
|
||||
import com.muyu.warn.service.IWarnRuleService;
|
||||
|
@ -107,4 +103,18 @@ public class WarnRuleController extends BaseController
|
|||
warnRuleService.removeBatchByIds(Arrays.asList(ids));
|
||||
return success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据策略id查询规则
|
||||
* @param strategyId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/selectByStrategyId")
|
||||
public Result<List<WarnRule>> selectByStrategyId
|
||||
(@RequestParam("strategyId") Long strategyId){
|
||||
List<WarnRule> list = warnRuleService.list
|
||||
(new LambdaQueryWrapper<WarnRule>().eq(WarnRule::getStrategyId, strategyId));
|
||||
return success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ package com.muyu.warn.controller;
|
|||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.warn.domain.Resp.WarnStrategyList;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -107,4 +109,15 @@ public class WarnStrategyController extends BaseController
|
|||
warnStrategyService.removeBatchByIds(Arrays.asList(ids));
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 双表联查
|
||||
* @param warnStrategy
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/strategyRuleList")
|
||||
public Result<List<WarnStrategyList>> StrategyRuleList(@RequestBody WarnStrategy warnStrategy){
|
||||
List<WarnStrategyList> list = warnStrategyService.strategyList(warnStrategy);
|
||||
return Result.success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
package com.muyu.warn.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @ClassName CarMessage
|
||||
* @Description 描述
|
||||
* @Author YiBo.Liu
|
||||
* @Date 2024/9/22 22:24
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "报文表")
|
||||
@TableName(value = "t_car_message")
|
||||
public class CarMessage {
|
||||
|
||||
/**
|
||||
* 报文表
|
||||
*/
|
||||
private Long messageId;
|
||||
/**
|
||||
* 车辆报文类别
|
||||
*/
|
||||
private String messageType;
|
||||
/**
|
||||
* 开始位下标
|
||||
*/
|
||||
private Integer messageStartIndex;
|
||||
/**
|
||||
* 结束位下标
|
||||
*/
|
||||
private Integer messageEndIndex;
|
||||
/**
|
||||
* 模版id
|
||||
*/
|
||||
private Long templateId;
|
||||
/**
|
||||
* 报文标签
|
||||
*/
|
||||
private String messageLabel;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.muyu.warn.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @ClassName CarType
|
||||
* @Description 描述
|
||||
* @Author YiBo.Liu
|
||||
* @Date 2024/9/22 16:53
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "车辆类型表")
|
||||
@TableName(value = "t_car_type")
|
||||
public class CarType {
|
||||
|
||||
/**
|
||||
* 车辆类型id
|
||||
*/
|
||||
private Integer carTypeId;
|
||||
|
||||
/**
|
||||
* 车辆类型名称
|
||||
*/
|
||||
private String carTypeName;
|
||||
|
||||
/**
|
||||
* 模板id
|
||||
*/
|
||||
private Integer templateId;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package com.muyu.warn.domain.Resp;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.warn.domain.WarnRule;
|
||||
import com.muyu.warn.domain.WarnStrategy;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* @ClassName StrategyRuleList
|
||||
* @Description 描述
|
||||
* @Author YiBo.Liu
|
||||
* @Date 2024/9/22 15:07
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "策略规则一对多")
|
||||
public class StrategyRuleList {
|
||||
|
||||
|
||||
/** 策略id */
|
||||
@TableId( type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 车辆类型id */
|
||||
@Excel(name = "车辆类型id")
|
||||
private Long carTypeId;
|
||||
|
||||
/** 策略名称 */
|
||||
@Excel(name = "策略名称")
|
||||
private String strategyName;
|
||||
|
||||
/** 报文模版id */
|
||||
@Excel(name = "报文模版id")
|
||||
private Long msgId;
|
||||
|
||||
private List<WarnRule> warnRuleList;
|
||||
|
||||
// private static StrategyRuleList strategyRuleList
|
||||
// (WarnStrategy warnStrategy, Supplier<Long> supplierId) {
|
||||
// return StrategyRuleList.builder()
|
||||
// .id(warnStrategy.getId())
|
||||
// .carTypeId(warnStrategy.getCarTypeId())
|
||||
// .strategyName(warnStrategy.getStrategyName())
|
||||
// .msgId(warnStrategy.getMsgId())
|
||||
// .warnRuleList(supplierId)
|
||||
// .build();
|
||||
// }
|
||||
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package com.muyu.warn.domain.Resp;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.warn.domain.WarnRule;
|
||||
import com.muyu.warn.domain.WarnStrategy;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName WarnStrategyList
|
||||
* @Description 描述
|
||||
* @Author YiBo.Liu
|
||||
* @Date 2024/9/21 18:45
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "策略规则双表联查")
|
||||
public class WarnStrategyList {
|
||||
|
||||
/** 策略id */
|
||||
private Long strategyId;
|
||||
|
||||
/** 车辆类型id */
|
||||
private Long carTypeId;
|
||||
|
||||
/** 策略名称 */
|
||||
private String strategyName;
|
||||
|
||||
|
||||
/** 报文模版id */
|
||||
private Long msgId;
|
||||
|
||||
/** 规则id */
|
||||
private Long ruleId;
|
||||
|
||||
/** 规则名称 */
|
||||
private String ruleName;
|
||||
|
||||
|
||||
/** 报文数据类型id */
|
||||
private Long msgTypeId;
|
||||
|
||||
/** 滑窗时间 */
|
||||
private Long slideTime;
|
||||
|
||||
/** 滑窗频率 */
|
||||
private Long slideFrequency;
|
||||
|
||||
/** 最大值 */
|
||||
private Long maxValue;
|
||||
|
||||
/** 最小值 */
|
||||
private Long minValue;
|
||||
|
||||
/** 报文数据名称 */
|
||||
private String messageName;;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.muyu.warn.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @ClassName Template
|
||||
* @Description 描述
|
||||
* @Author YiBo.Liu
|
||||
* @Date 2024/9/22 16:54
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Tag(name = "模板表")
|
||||
@TableName(value = "t_template")
|
||||
public class Template {
|
||||
|
||||
/**
|
||||
* 模板id
|
||||
*/
|
||||
private Integer templateId;
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
private String templateName;
|
||||
|
||||
/**
|
||||
* 模板描述
|
||||
*/
|
||||
private String templateDescribe;
|
||||
|
||||
|
||||
}
|
|
@ -41,7 +41,7 @@ public class WarnStrategy{
|
|||
|
||||
/** 报文模版id */
|
||||
@Excel(name = "报文模版id")
|
||||
private Long msgId;
|
||||
private Long templateId;
|
||||
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class WarnStrategy{
|
|||
.append("id", getId())
|
||||
.append("carTypeId", getCarTypeId())
|
||||
.append("strategyName", getStrategyName())
|
||||
.append("msgId", getMsgId())
|
||||
.append("msgId", getTemplateId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package com.muyu.warn.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.warn.domain.CarMessage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface CarMessageMapper extends BaseMapper<CarMessage> {
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.muyu.warn.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.warn.domain.CarType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface CarTypeMapper extends BaseMapper<CarType> {
|
||||
CarType findById(@Param("catTypeId") Integer catTypeId);
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.muyu.warn.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.warn.domain.Template;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TemplateMapper extends BaseMapper<Template> {
|
||||
}
|
|
@ -1,9 +1,12 @@
|
|||
package com.muyu.warn.mapper;
|
||||
|
||||
import com.muyu.warn.domain.Resp.WarnStrategyList;
|
||||
import com.muyu.warn.domain.WarnStrategy;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 预警策略Mapper接口
|
||||
*
|
||||
|
@ -13,4 +16,5 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
@Mapper
|
||||
public interface WarnStrategyMapper extends BaseMapper<WarnStrategy>{
|
||||
|
||||
List<WarnStrategyList> strategyList(WarnStrategy warnStrategy);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package com.muyu.warn.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.warn.domain.CarMessage;
|
||||
|
||||
public interface CarMessageService extends IService<CarMessage> {
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.muyu.warn.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.warn.domain.CarType;
|
||||
|
||||
public interface CarTypeService extends IService<CarType> {
|
||||
CarType findById(Integer catTypeId);
|
||||
|
||||
}
|
|
@ -34,4 +34,6 @@ public interface IWarnRuleService extends IService<WarnRule> {
|
|||
*/
|
||||
Boolean checkIdUnique(WarnRule warnRule);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.muyu.warn.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.warn.domain.Resp.WarnStrategyList;
|
||||
import com.muyu.warn.domain.WarnStrategy;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
@ -34,4 +36,7 @@ public interface IWarnStrategyService extends IService<WarnStrategy> {
|
|||
*/
|
||||
Boolean checkIdUnique(WarnStrategy warnStrategy);
|
||||
|
||||
|
||||
List<WarnStrategyList> strategyList(WarnStrategy warnStrategy);
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package com.muyu.warn.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.warn.domain.Template;
|
||||
|
||||
public interface TemplateService extends IService<Template> {
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.muyu.warn.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.warn.domain.CarMessage;
|
||||
import com.muyu.warn.mapper.CarMessageMapper;
|
||||
import com.muyu.warn.service.CarMessageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @ClassName CarMessageServiceImpl
|
||||
* @Description 描述
|
||||
* @Author YiBo.Liu
|
||||
* @Date 2024/9/22 22:29
|
||||
*/
|
||||
@Service
|
||||
public class CarMessageServiceImpl
|
||||
extends ServiceImpl<CarMessageMapper, CarMessage>
|
||||
implements CarMessageService {
|
||||
|
||||
@Autowired
|
||||
private CarMessageMapper carMessageMapper;
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.muyu.warn.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.warn.domain.CarType;
|
||||
import com.muyu.warn.mapper.CarTypeMapper;
|
||||
import com.muyu.warn.service.CarTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @ClassName CarServiceImpl
|
||||
* @Description 描述
|
||||
* @Author YiBo.Liu
|
||||
* @Date 2024/9/22 16:52
|
||||
*/
|
||||
@Service
|
||||
public class CarTypeTypeServiceImpl
|
||||
extends ServiceImpl<CarTypeMapper, CarType>
|
||||
implements CarTypeService {
|
||||
|
||||
@Autowired
|
||||
private CarTypeMapper carTypeMapper;
|
||||
|
||||
@Override
|
||||
public CarType findById(Integer catTypeId) {
|
||||
CarType carType= carTypeMapper.findById(catTypeId);
|
||||
return carType;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.muyu.warn.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.warn.domain.Template;
|
||||
import com.muyu.warn.mapper.TemplateMapper;
|
||||
import com.muyu.warn.service.TemplateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @ClassName TemplateServiceImpl
|
||||
* @Description 描述
|
||||
* @Author YiBo.Liu
|
||||
* @Date 2024/9/22 18:38
|
||||
*/
|
||||
@Service
|
||||
public class TemplateServiceImpl
|
||||
extends ServiceImpl<TemplateMapper, Template>
|
||||
implements TemplateService {
|
||||
|
||||
@Autowired
|
||||
private TemplateMapper templateMapper;
|
||||
|
||||
}
|
|
@ -83,4 +83,6 @@ public class WarnRuleServiceImpl
|
|||
return this.count(queryWrapper) > 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
package com.muyu.warn.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.warn.domain.Resp.WarnStrategyList;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.warn.mapper.WarnStrategyMapper;
|
||||
import com.muyu.warn.domain.WarnStrategy;
|
||||
|
@ -21,6 +26,9 @@ public class WarnStrategyServiceImpl
|
|||
extends ServiceImpl<WarnStrategyMapper, WarnStrategy>
|
||||
implements IWarnStrategyService {
|
||||
|
||||
@Autowired
|
||||
private WarnStrategyMapper warnStrategyMapper;
|
||||
|
||||
/**
|
||||
* 精确查询预警策略
|
||||
*
|
||||
|
@ -53,8 +61,8 @@ public class WarnStrategyServiceImpl
|
|||
if (StringUtils.isNotNull(warnStrategy.getStrategyName())){
|
||||
queryWrapper.like(WarnStrategy::getStrategyName, warnStrategy.getStrategyName());
|
||||
}
|
||||
if (StringUtils.isNotNull(warnStrategy.getMsgId())){
|
||||
queryWrapper.eq(WarnStrategy::getMsgId, warnStrategy.getMsgId());
|
||||
if (StringUtils.isNotNull(warnStrategy.getTemplateId())){
|
||||
queryWrapper.eq(WarnStrategy::getTemplateId, warnStrategy.getTemplateId());
|
||||
}
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
@ -71,4 +79,10 @@ public class WarnStrategyServiceImpl
|
|||
return this.count(queryWrapper) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WarnStrategyList> strategyList(WarnStrategy warnStrategy) {
|
||||
return warnStrategyMapper.strategyList(warnStrategy);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<?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.warn.mapper.CarTypeMapper">
|
||||
|
||||
<select id="findById" resultType="com.muyu.warn.domain.CarType">
|
||||
select * from t_car_type where t_car_type.car_type_id = #{catTypeId}
|
||||
</select>
|
||||
</mapper>
|
|
@ -0,0 +1,26 @@
|
|||
<?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.warn.mapper.WarnStrategyMapper">
|
||||
|
||||
<select id="strategyList" resultType="com.muyu.warn.domain.Resp.WarnStrategyList">
|
||||
SELECT
|
||||
s.id AS strategy_id,
|
||||
s.msg_id,
|
||||
s.car_type_id,
|
||||
s.strategy_name,
|
||||
r.id AS rule_id,
|
||||
r.max_value,
|
||||
r.min_value,
|
||||
r.msg_type_id,
|
||||
r.rule_name,
|
||||
r.slide_frequency,
|
||||
r.slide_time,
|
||||
r.strategy_id,
|
||||
t_message_type.message_name
|
||||
FROM
|
||||
warn_strategy s
|
||||
LEFT JOIN warn_rule r ON s.id = r.strategy_id
|
||||
LEFT JOIN t_message_type on r.msg_type_id = t_message_type.message_type_id
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue