wang-hao-jie
2022-01-18 d9da603305a2b94bde78483fa8777a43ee352548
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/AlarmController.java
@@ -41,9 +41,17 @@
    @RequestMapping(value = "/getAll", method = RequestMethod.GET)
    @ApiOperation(value = "获取全部数据")
    public Result<List<Alarm>> getAll() {
    public Result<List<Alarm>> getAll(String carId) {
        List<Alarm> list = iAlarmService.list();
        QueryWrapper<Alarm> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("flag",0);
        queryWrapper.eq("car_id",carId);
        List<Alarm> list = iAlarmService.list(queryWrapper);
        for(Alarm a:list){
            a.setFlag(1);
            iAlarmService.saveOrUpdate(a);
        }
        return new ResultUtil<List<Alarm>>().setData(list);
    }