kongdeqiang
2023-02-22 9812f31d6402a268fa6fd35e8c3a2a59582b720d
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
76
77
78
79
80
81
82
83
84
85
86
87
88
package com.wgcloud.service;
 
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wgcloud.entity.FileWarnState;
import com.wgcloud.mapper.FileWarnStateMapper;
import com.wgcloud.util.DateUtil;
import com.wgcloud.util.UUIDUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
import java.util.Map;
 
/**
 * @version v3.3
 * @ClassName:FileWarnStateService.java
 * @author: http://www.wgstart.com
 * @date: 2021年1月16日
 * @Description: FileWarnStateService.java
 * @Copyright: 2019-2021 wgcloud. All rights reserved.
 */
@Service
public class FileWarnStateService {
 
    private Logger logger = LoggerFactory.getLogger(FileWarnStateService.class);
 
    public PageInfo selectByParams(Map<String, Object> params, int currPage, int pageSize) throws Exception {
        PageHelper.startPage(currPage, pageSize);
        List<FileWarnState> list = fileWarnStateMapper.selectByParams(params);
        PageInfo<FileWarnState> pageInfo = new PageInfo<FileWarnState>(list);
        return pageInfo;
    }
 
    public Integer countByParams(Map<String, Object> params) throws Exception {
        return fileWarnStateMapper.countByParams(params);
    }
 
 
    public void save(FileWarnState FileWarnState) throws Exception {
        FileWarnState.setId(UUIDUtil.getUUID());
        FileWarnState.setCreateTime(DateUtil.getNowTime());
        fileWarnStateMapper.save(FileWarnState);
    }
 
    public void saveRecord(List<FileWarnState> recordList) {
        try {
            if (recordList.size() < 1) {
                return;
            }
            for (FileWarnState as : recordList) {
                as.setId(UUIDUtil.getUUID());
            }
            fileWarnStateMapper.insertList(recordList);
        } catch (Exception e) {
            logger.error("日志文件监控保存错误", e);
        }
    }
 
    public int deleteByFileWarnId(String fileWarnId) throws Exception {
        return fileWarnStateMapper.deleteByFileWarnId(fileWarnId);
    }
 
 
    public int deleteById(String[] id) throws Exception {
        return fileWarnStateMapper.deleteById(id);
    }
 
    public FileWarnState selectById(String id) throws Exception {
        return fileWarnStateMapper.selectById(id);
    }
 
    public List<FileWarnState> selectAllByParams(Map<String, Object> params) throws Exception {
        return fileWarnStateMapper.selectAllByParams(params);
    }
 
    public int deleteByDate(Map<String, Object> map) throws Exception {
        return fileWarnStateMapper.deleteByDate(map);
    }
 
 
    @Autowired
    private FileWarnStateMapper fileWarnStateMapper;
 
 
}