AlarmRuleConfigMapper.java
6.9 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
package com.skua.modules.alarmtmp.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.alarmtmp.entity.AlarmParamStandardConfig;
import com.skua.modules.alarmtmp.entity.AlarmRuleConfig;
import com.skua.modules.alarmtmp.vo.*;
import com.skua.modules.system.datestandard.entity.SysMonitorMetricInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
import java.util.Map;
/**
* @program: skboot
* @description:
* @author: xie chao
* @create: 2020-11-02 10:01
*/
public interface AlarmRuleConfigMapper extends BaseMapper<AlarmRuleConfig> {
@Select({"select arc.id alarm_rule_id,alarm_rule_name,alarm_param_type,alarm_rule_type,alarm_param_everyday_avg_time,arc.alarm_param_name,alarm_rule_status," +
"alarm_program_code,arc.alarm_param_code,arc.alarm_param_unit,alarm_time_interval,alarm_data_over_standard_rate,depart_id,(select depart_name " +
"from sys_depart sd where sd.id = arc.depart_id) depart_name,arlc.id alarm_rule_level_id,alarm_rule_level_name,effective_upper_limit,effective_lower_limit," +
"alarm_param_is_standardize,alarm_param_standardize_id,case arlc.alarm_param_is_standardize when 0 then arlc.alarm_param_lower_limit " +
"WHEN 1 then apsc.alarm_param_lower_limit end alarm_param_lower_limit,case arlc.alarm_param_is_standardize when 0 then arlc.alarm_param_upper_limit " +
"WHEN 1 then apsc.alarm_param_upper_limit end alarm_param_upper_limit,is_send_sms,sms_send_frequency,sms_allow_send_time,is_send_notice," +
"alarm_sms_recipient,alarm_sms_recipient_phone,alarm_notice_recipient from alarm_rule_config arc left join alarm_rule_level_config arlc " +
"on arc.id = arlc.alarm_rule_id left join alarm_param_standard_config apsc on apsc.id = arlc.alarm_param_standardize_id " +
"${ew.customSqlSegment}"})
List<AlarmRuleAndAlarmRuleLevelVO> getAlarmRuleAndAlarmRuleLevePage(Page page, @Param(Constants.WRAPPER) QueryWrapper<AlarmRuleAndAlarmRuleLevelVO> queryWrapper);
List<AlarmRuleAndAlarmRuleLevelVO> getAlarmRuleAndAlarmRuleLeveList();
@Select({"select arc.*,sd.depart_name depart_name from alarm_rule_config arc left join sys_depart sd on sd.id=arc.depart_id " +
"${ew.customSqlSegment}"})
List<AlarmRuleConfigVO> getList(Page<AlarmRuleConfigVO> page, @Param(Constants.WRAPPER) QueryWrapper<AlarmRuleConfigVO> queryWrapper);
@Select({"select id from sys_factory_datasource where depart_id like concat('%',#{departId},'%')"})
List<Map<String, String>> getDataSourceBydepartId(@Param("departId") String departId);
List<AlarmRuleConfigBatchInfoVO> queryBatchInfoList(@Param("alarmRuleName") String alarmRuleName);
@Select("SELECT id,\n" +
"\tbatch_id,\n" +
"\talarm_rule_name,\n" +
"\tmin( alarm_param_type ) alarm_param_type,\n" +
"\tmin( alarm_rule_type ) alarm_rule_type,\n" +
"\tmin( alarm_param_name ) alarm_param_name,\n" +
"\tmin( alarm_param_code ) alarm_param_code,\n" +
"\tmin( alarm_data_over_standard_rate ) alarm_data_over_standard_rate,\n" +
"\tmin( alarm_param_everyday_avg_time ) alarm_param_everyday_avg_time,\n" +
"\tmin( alarm_param_unit ) alarm_param_unit,\n" +
"\tmin( alarm_time_interval ) alarm_time_interval,\n" +
"\tmin( effective_upper_limit ) effective_upper_limit,\n" +
"\tmin( effective_lower_limit ) effective_lower_limit,\n" +
"\tgroup_concat(depart_id) departId,\n" +
"\tmin( alarm_rule_status ) alarm_rule_status \n" +
"FROM\n" +
"\talarm_rule_config \n" +
"WHERE\n" +
"\tbatch_id = #{batchId}")
AlarmRuleConfigBatchInfoVO queryBatchInfoByBatchId(@Param("batchId") String batchId);
void deleteAlarmConfig(@Param("departId") String departId);
List<AlarmParamStandardConfig> selectEffluentStandard(@Param("departId") String departId);
String selectAlarmParamStandardizeId(@Param("effluentStandard") String effluentStandard);
List<String> selectAlarmRuleConfigId(@Param("departId") String departId);
void deleteAlarmRuleLevelConfig(@Param("configIds") List<String> configIds);
void removeByBatchId(@Param("batchId") String batchId);
Map queryLevelInfoByParam(@Param("departId") String departId, @Param("alarmProgramCode") String alarmProgramCode, @Param("alarmRuleLevelName") String alarmRuleLevelName);
List<String> queryFacByBatchId(@Param("batchId") String batchId);
List<SysMonitorMetricInfo> queryMonitorParam(@Param("departId") String departId, @Param("tabPageType") String tabPageType, @Param("monitorType") String monitorType);
String getAlarmTypeByTag(@Param("metricUidTag") String metricUidTag);
List<Map<String, Object>> getMonitorByType(@Param("type") String type, @Param("departId") String departId);
List<NewAlarmRuleConfigVO> getEquipAlarmInfo();
Map<String, Object> getEquipStatus(@Param("equipId") String equipId);
/**
* <pre>
* 根据处理类名称获取报警配置
* </pre>
* @param tag
* @return
* @author Li Yuanyuan, 2023年12月13日 上午10:42:50
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
List<AlarmRuleConfigAndLevelVO> getAlarmRuleConfigList(@Param("tag")String tag);
Map<String, String> queryUpLowByParam(@Param("alarmParamStandardizeId") String alarmParamStandardizeId, @Param("configId") String configId);
List<String> getDepartIds();
List<Map<String, Object>> queryUpLow(@Param("id") String id);
Map<String, Object> queryUpLowByAlarm(@Param("id") String id);
/**
* <pre>
* 获取已配置报警规则,工艺数据项数据标签变更报警数据
* </pre>
* @param departId
* @param tabPageType
* @return
* @author Li Yuanyuan, 2023年3月25日 下午2:01:58
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
List<AlarmRuleConfigVO> queryMonitorModifyParam(String departId, String tabPageType);
/**
* <pre>
* 报警配置同步更新采集数据标签分类变更数据
* </pre>
* @author Li Yuanyuan, 2023年3月27日 上午10:39:10
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
void updateAlarmRuleTypeFormMetricDict();
/**
* <pre>
* 获取已配置报警规则并属于设计标准的指标信息
* </pre>
* @param departId
* @param tabPageType
* @return
* @author Li Yuanyuan, 2023年3月28日 下午4:22:53
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
List<Map<String,Object>> getStandardParamsConfig(String departId, String tabPageType);
}