地质所 沉降监测网建设项目
zmk
2024-05-15 9e3afc6d0fa514f986d3fea40fa23124e6fb5070
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
package com.javaweb.geo.service.impl;
 
import java.util.List;
 
import cn.hutool.core.util.ObjectUtil;
import com.javaweb.common.core.domain.AjaxResult;
import com.javaweb.common.utils.IdGenerate;
import com.javaweb.common.utils.StringUtils;
import com.javaweb.geotdp.domain.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.javaweb.geo.mapper.ExceptionConfigMapper;
import com.javaweb.geo.domain.ExceptionConfig;
import com.javaweb.geo.service.IExceptionConfigService;
import com.javaweb.common.core.text.Convert;
 
/**
 * 异常配置Service业务层处理
 * 
 * @author cxy
 * @date 2022-11-14
 */
@Service
public class ExceptionConfigServiceImpl implements IExceptionConfigService 
{
    @Autowired
    private ExceptionConfigMapper exceptionConfigMapper;
 
    /**
     * 查询异常配置
     * 
     * @param ids 异常配置ID
     * @return 异常配置
     */
    @Override
    public ExceptionConfig selectExceptionConfigById(Long ids)
    {
        return exceptionConfigMapper.selectExceptionConfigById(ids);
    }
 
    /**
     * 查询异常配置列表
     * 
     * @param exceptionConfig 异常配置
     * @return 异常配置
     */
    @Override
    public List<ExceptionConfig> selectExceptionConfigList(ExceptionConfig exceptionConfig)
    {
        return exceptionConfigMapper.selectExceptionConfigList(exceptionConfig);
    }
 
    /**
     * 新增异常配置
     * 
     * @param exceptionConfig 异常配置
     * @return 结果
     */
    @Override
    public AjaxResult insertExceptionConfig(ExceptionConfig exceptionConfig)
    {
        if (ObjectUtil.isEmpty(exceptionConfig.getIds())){
            String id = IdGenerate.nextId();
            exceptionConfig.setIds(id);
            exceptionConfigMapper.insertExceptionConfig(exceptionConfig);
        }else {
            exceptionConfigMapper.updateExceptionConfig(exceptionConfig);
        }
        return AjaxResult.success("数据保存成功");
    }
 
    /**
     * 修改异常配置
     * 
     * @param exceptionConfig 异常配置
     * @return 结果
     */
    @Override
    public int updateExceptionConfig(ExceptionConfig exceptionConfig)
    {
        return exceptionConfigMapper.updateExceptionConfig(exceptionConfig);
    }
 
    /**
     * 删除异常配置对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteExceptionConfigByIds(String ids)
    {
        return exceptionConfigMapper.deleteExceptionConfigByIds(Convert.toStrArray(ids));
    }
 
    /**
     * 删除异常配置信息
     * 
     * @param ids 异常配置ID
     * @return 结果
     */
    @Override
    public int deleteExceptionConfigById(Long ids)
    {
        return exceptionConfigMapper.deleteExceptionConfigById(ids);
    }
 
    @Override
    public ResponseResult configInfo() {
        ExceptionConfig data = exceptionConfigMapper.selectExceptionConfigById(1L);
        if (ObjectUtil.isNotEmpty(data)){
            return ResponseResult.success("查询成功!",data);
        }
        return ResponseResult.error("查询失败!",null);
    }
}