fei.wang
2025-04-18 321a74059773cfecc01d6313f7c2e2d45545d6d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package com.hxzkappboot.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
import com.hxzkappboot.mapper.TbWarningMapper;
import com.hxzkappboot.pojo.TbWarning;
import com.hxzkappboot.service.TbWarningService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.ArrayList;
import java.util.List;
 
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wangfei
 * @since 2024-03-08
 */
@Service
public class TbWarningServiceImpl extends ServiceImpl<TbWarningMapper, TbWarning> implements TbWarningService {
 
    @Autowired
    TbWarningMapper warningDao;
 
 
    @Override
    public List<TbWarning> findAll(Page page, String objectid,String company) {
            QueryWrapper queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("status","未处理");
        List<TbWarning> CompanyPage = new ArrayList<TbWarning>();
        if (objectid!=null){
            String output = objectid.toUpperCase();//将小写字母转成大写字母
 
            CompanyPage = baseMapper.findwarper1(company,output,page.getCurrent()-1,page.getSize());
        }else{
             CompanyPage = baseMapper.findwarper(company,page.getCurrent()-1,page.getSize());
 
        }
        queryWrapper.orderByDesc("time");
 
        return CompanyPage;
    }
 
    @Override
    public Integer findWarningNum(String company ) {
        List<TbWarning> CompanyPage = new ArrayList<TbWarning>();
//        QueryWrapper queryWrapper = new QueryWrapper<>();
//        queryWrapper.eq("status","未处理");
        CompanyPage = baseMapper.findwarper2(company);
        return CompanyPage.size();
    }
 
    @Override
    public TbWarning findWarningid(Integer id ) {
        QueryWrapper queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id",id);
        return baseMapper.selectOne(queryWrapper);
    }
 
 
    @Override
    public TbWarning processingWarn(TbWarning warning) {
        QueryWrapper queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id",warning.getId());
        baseMapper.update(warning,queryWrapper);
 
        return baseMapper.selectOne(queryWrapper);
    }
 
}