feat():修改车辆管理
parent
f4772c7799
commit
154b26d7a6
|
@ -20,10 +20,9 @@ public class SysCar extends BaseEntity {
|
|||
private String carVin;
|
||||
private Long carTypeId;
|
||||
private String state;
|
||||
private Long fenceId;
|
||||
private String carMotorManufacturer;
|
||||
private String carMotorModel;
|
||||
private String carBatteryManufacturer;
|
||||
private String carBatteryModel;
|
||||
|
||||
private Long strategyId;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.domain.resp;
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.domain.SysCar;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
@ -12,8 +13,10 @@ import lombok.NoArgsConstructor;
|
|||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysCarVo extends SysCar {
|
||||
|
||||
@Excel(name = "车辆类型名称")
|
||||
private String typeName;
|
||||
private String fenceName;
|
||||
@Excel(name = "策略名称")
|
||||
private Long strategyName;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.mapper.SysCarMapper">
|
||||
<select id="selectSysCarVoList" resultType="com.muyu.domain.resp.SysCarVo">
|
||||
SELECT * ,car_type.type_name,tb_fence.fence_name
|
||||
SELECT * ,car_type.type_name,warn_strategy.strategy_name
|
||||
FROM `sys_car`
|
||||
LEFT JOIN car_type ON sys_car.car_type_id=car_type.id
|
||||
LEFT JOIN tb_fence ON sys_car.fence_id=tb_fence.fence_id
|
||||
LEFT JOIN warn_strategy ON sys_car.strategy_id=warn_strategy.id
|
||||
<where>
|
||||
<if test="carVin!=null and carVin!=''">
|
||||
sys_car.car_vin=#{carVin}
|
||||
|
@ -32,10 +32,10 @@
|
|||
|
||||
|
||||
<select id="selectSysCarVoById" resultType="com.muyu.domain.resp.SysCarVo">
|
||||
SELECT * ,car_type.type_name,tb_fence.fence_name
|
||||
SELECT * ,car_type.type_name,warn_strategy.strategy_name
|
||||
FROM `sys_car`
|
||||
LEFT JOIN car_type ON sys_car.car_type_id=car_type.id
|
||||
LEFT JOIN tb_fence ON sys_car.fence_id=tb_fence.fence_id
|
||||
LEFT JOIN warn_strategy ON sys_car.strategy_id=warn_strategy.id
|
||||
where sys_car.id=#{id}
|
||||
</select>
|
||||
<select id="findFenceByCarVin" resultType="com.muyu.domain.resp.SysCarFaultLogVo">
|
||||
|
|
|
@ -36,11 +36,9 @@ public class WarnLogsController extends BaseController
|
|||
/**
|
||||
* 查询预警日志列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<WarnLogs>> list(@RequestBody WarnLogs warnLogs)
|
||||
{
|
||||
List<WarnLogs> list = warnLogsService.selectWarnLogsList(warnLogs);
|
||||
return getDataTable(list);
|
||||
@GetMapping("/selectWarnLogsList")
|
||||
public Result selectWarnLogsList(){
|
||||
return Result.success(warnLogsService.selectWarnLogsList());
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,7 +46,7 @@ public class WarnLogsController extends BaseController
|
|||
* 获取预警日志详细信息
|
||||
*/
|
||||
@GetMapping(value = "selectWarnLogsById/{id}")
|
||||
public Result<List<WarnLogs>> selectWarnLogsById(@PathVariable("id") Long id)
|
||||
public Result selectWarnLogsById(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(warnLogsService.selectWarnLogsById(id));
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WarnLogsResq extends WarnLogs {
|
||||
public class WarnLogsResp extends WarnLogs {
|
||||
/** 规则名称 */
|
||||
@Excel(name = "规则名称")
|
||||
private String ruleName;
|
|
@ -3,7 +3,9 @@ package com.muyu.mapper;
|
|||
import java.util.List;
|
||||
import com.muyu.domain.WarnLogs ;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.domain.resp.WarnLogsResp;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 预警日志Mapper接口
|
||||
|
@ -13,5 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
*/
|
||||
@Mapper
|
||||
public interface WarnLogsMapper extends BaseMapper<WarnLogs>{
|
||||
List<WarnLogsResp> selectWarnLogsList();
|
||||
|
||||
WarnLogsResp selectWarnLogs(@Param("id")Long id);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.muyu.service;
|
|||
import java.util.List;
|
||||
import com.muyu.domain.WarnLogs ;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.domain.resp.WarnLogsResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 预警日志Service接口
|
||||
|
@ -17,16 +19,13 @@ public interface WarnLogsService extends IService<WarnLogs> {
|
|||
* @param id 预警日志主键
|
||||
* @return 预警日志
|
||||
*/
|
||||
public WarnLogs selectWarnLogsById(Long id);
|
||||
public WarnLogsResp selectWarnLogsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询预警日志列表
|
||||
*
|
||||
* @param warnLogs 预警日志
|
||||
* @return 预警日志集合
|
||||
*/
|
||||
public List<WarnLogs> selectWarnLogsList(WarnLogs warnLogs);
|
||||
|
||||
List<WarnLogsResp> selectWarnLogsList();
|
||||
|
||||
/**
|
||||
* 添加
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.service.impl;
|
|||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.domain.resp.WarnLogsResp;
|
||||
import com.muyu.mapper.WarnLogsMapper;
|
||||
import com.muyu.service.WarnLogsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -32,26 +33,20 @@ public class WarnLogsServiceImpl
|
|||
* @return 预警日志
|
||||
*/
|
||||
@Override
|
||||
public WarnLogs selectWarnLogsById(Long id)
|
||||
public WarnLogsResp selectWarnLogsById(Long id)
|
||||
{
|
||||
return warnLogsMapper.selectById(id);
|
||||
return warnLogsMapper.selectWarnLogs(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询预警日志列表
|
||||
*
|
||||
* @param warnLogs 预警日志
|
||||
* @return 预警日志
|
||||
*/
|
||||
@Override
|
||||
public List<WarnLogs> selectWarnLogsList(WarnLogs warnLogs)
|
||||
public List<WarnLogsResp> selectWarnLogsList()
|
||||
{
|
||||
LambdaQueryWrapper<WarnLogs> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotEmpty(warnLogs.getVin())){
|
||||
queryWrapper.eq(WarnLogs::getVin, warnLogs.getVin());
|
||||
}
|
||||
return warnLogsMapper.selectList(queryWrapper);
|
||||
return warnLogsMapper.selectWarnLogsList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
<?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.mapper.WarnLogsMapper">
|
||||
<select id="selectWarnLogsList" resultType="com.muyu.domain.resp.WarnLogsResp">
|
||||
SELECT
|
||||
*,
|
||||
warn_rule.rule_name
|
||||
FROM
|
||||
warn_logs
|
||||
LEFT JOIN warn_rule
|
||||
ON warn_logs.warn_rule_id = warn_rule.id
|
||||
</select>
|
||||
<select id="selectWarnLogs" resultType="com.muyu.domain.resp.WarnLogsResp">
|
||||
SELECT
|
||||
*,
|
||||
warn_rule.rule_name
|
||||
FROM
|
||||
warn_logs
|
||||
LEFT JOIN warn_rule
|
||||
ON warn_logs.warn_rule_id = warn_rule.id
|
||||
where warn_rule.id=#{id}
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue