feat:是否警告接口

dev
袁子龙 2024-09-21 19:51:02 +08:00
parent 4686fc17fe
commit bf235658fb
5 changed files with 39 additions and 2 deletions

View File

@ -1,5 +1,7 @@
package com.muyu.breakdown.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.muyu.breakdown.domain.SysCarFault;
import com.muyu.breakdown.service.SysCarFaultService;
import com.muyu.common.core.domain.Result;
@ -104,4 +106,28 @@ public class SysCarFaultController extends BaseController
sysCarFaultService.removeBatchByIds(Arrays.asList(ids));
return success();
}
/**
*
* @param id
*/
@PutMapping("/enableWarningsById/{id}")
public void enableWarningsById(@PathVariable("id")Long id){
UpdateWrapper<SysCarFault> wrapper = new UpdateWrapper<>();
wrapper.eq("id",id);
wrapper.set("warn_status",0);
sysCarFaultService.update(wrapper);
}
/**
*
* @param id
*/
@PutMapping("/disableWarningsById/{id}")
public void disableWarningsById(@PathVariable("id")Long id){
UpdateWrapper<SysCarFault> wrapper = new UpdateWrapper<>();
wrapper.eq("id",id);
wrapper.set("warn_status",1);
sysCarFaultService.update(wrapper);
}
}

View File

@ -80,11 +80,11 @@ public class SysCarFault extends BaseEntity{
/** 启用状态(1.待处理 2.处理中 3.已处理 4.忽略) */
@Excel(name = "启用状态(1.待处理 2.处理中 3.已处理 4.忽略)")
private Long status;
private Integer status;
/** 是否警告(0.开启 1.禁止) */
@Excel(name = "是否警告(0.开启 1.禁止)")
private Long warnStatus;
private Integer warnStatus;

View File

@ -35,4 +35,6 @@ public interface SysCarFaultService extends IService<SysCarFault> {
*/
Boolean checkIdUnique(SysCarFault sysCarFault);
}

View File

@ -72,4 +72,6 @@ public class SysCarFaultServiceImpl
return this.count(queryWrapper) > 0;
}
}

View File

@ -127,4 +127,11 @@
#{id}
</foreach>
</delete>
<update id="enableWarningsById" parameterType="Long">
update sys_car_fault set warn_status = 0 where id = #{id}
</update>
<update id="disableWarningsById" parameterType="Long">
update sys_car_fault set warn_status = 1 where id = #{id}
</update>
</mapper>