AjhRectificationInfoMapper.java
6.4 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
package com.skua.modules.ajh.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.skua.modules.ajh.entity.AjhRectificationInfo;
import com.skua.modules.ajh.vo.RectificationInfoAnalyseVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/**
* 隐患检查
*/
public interface AjhRectificationInfoMapper extends BaseMapper<AjhRectificationInfo> {
// 隐患统计
List<Map<String, Object>> yhCensus(@Param("now") String now, @Param("last_month") String last_month, @Param("last_year") String last_year);
//教育培训
List<Map<String, Object>> jyCensus(@Param("now") String now, @Param("last_month") String last_month, @Param("last_year") String last_year);
//应急演练
List<Map<String, Object>> yjCensus(@Param("now") String now, @Param("last_month") String last_month, @Param("last_year") String last_year);
//危化资料
List<Map<String, Object>> whCensus(@Param("now") String now, @Param("last_month") String last_month, @Param("last_year") String last_year);
//危险废物
List<Map<String, Object>> wxCensus(@Param("now") String now, @Param("last_month") String last_month, @Param("last_year") String last_year);
//集团安全文件
List<Map<String, Object>> jtaqCensus(@Param("now") String now, @Param("last_month") String last_month, @Param("last_year") String last_year);
//安全管理文件
List<Map<String, Object>> safeCensus(@Param("now") String now, @Param("last_month") String last_month, @Param("last_year") String last_year);
/**
* 柱状图:安全隐患数量
*
* @return
*/
List<RectificationInfoAnalyseVO.Histogram> countHistogramList(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate,
@Param("groupByPattern") String groupByPattern, @Param("departId") String departId);
/**
* 【安全隐患数量】统计
*
* @return
*/
RectificationInfoAnalyseVO.Histogram countByDate(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate,
@Param("departId") String departId);
/**
* 柱状图:风险等级分布
*
* @param startDate
* @param endDate
* @return
*/
List<RectificationInfoAnalyseVO.Histogram> levelHistogramList(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate,
@Param("departId") String departId);
/**
* 柱状图:安全责任人分布
*
* @param startDate
* @param endDate
* @return
*/
List<RectificationInfoAnalyseVO.Histogram> dutyHistogramList(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate,
@Param("departId") String departId);
/**
* 饼图:安全隐患区域分布
*
* @param startDate
* @param endDate
* @return
*/
List<RectificationInfoAnalyseVO.XAndCount> areaList(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate);
/**
* 雷达图:安全隐患伤害类别
*
* @param startDate
* @param endDate
* @return 所有的伤害类别,以逗号分割
*/
String classifyList(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate,
@Param("departId") String departId);
/**
* <pre>
* 安全隐患地图点位统计
* </pre>
*
* @param null
* @author Li Yuanyuan,2023/6/14 15:07
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@Select("SELECT\n" +
"\ta.rec_ord_body,\n" +
"\ta.rec_ord_level,\n" +
"\tcount(*) AS num,\n" +
"\tb.monitor_top,\n" +
"\tb.monitor_left,\n" +
"\tb.monitor_width,\n" +
"\tb.monitor_height\n" +
"FROM\n" +
"\tajh_rectification_info a left join ajh_safe_location b on a.rec_ord_body = b.struct_id\n" +
"\tleft join ajh_safe_manage c on b.manage_id=c.id ${ew.customSqlSegment}")
List<Map<String, Object>> mapPointStatistics(@Param(Constants.WRAPPER) QueryWrapper qw);
@Select("select rec_ord_classify,(select item_text from sys_dict_item where dict_id =(select id from sys_dict where dict_code='rectification_info_classify') and item_value=rec_ord_classify) as rec_ord_classify_dictText,count(*) as num from ajh_rectification_info ${ew.customSqlSegment}")
List<Map<String, Object>> riskPointPieCharts(@Param(Constants.WRAPPER) QueryWrapper qw);
@Select("select SUBSTR(rec_ord_finish_date,1,7) as rec_ord_finish_date ,count(*) as num from ajh_rectification_info ${ew.customSqlSegment}")
List<Map<String, Object>> riskPointLineCharts(@Param(Constants.WRAPPER) QueryWrapper qw);
@Select("SELECT\n" +
"\t(\n" +
"\t\tSELECT\n" +
"\t\t\tstruct_name\n" +
"\t\tFROM\n" +
"\t\t\tsys_struct_dict\n" +
"\t\tWHERE\n" +
"\t\t\tid = aa.rec_ord_body\n" +
"\t) rec_ord_body_dictText,\n" +
"\trec_ord_body,\n" +
"\tSUM(\n" +
"\t\tCASE\n" +
"\t\tWHEN handle_result = '1' THEN\n" +
"\t\t\tnum\n" +
"\t\tELSE\n" +
"\t\t\t0\n" +
"\t\tEND\n" +
"\t) AS 'wcl',\n" +
"\tSUM(\n" +
"\t\tCASE\n" +
"\t\tWHEN handle_result = '3' THEN\n" +
"\t\t\tnum\n" +
"\t\tELSE\n" +
"\t\t\t0\n" +
"\t\tEND\n" +
"\t) AS 'ycl'\n" +
"FROM\n" +
"\t(\n" +
"\t\tSELECT\n" +
"\t\t\trec_ord_body,\n" +
"\t\t\thandle_result,\n" +
"\t\t\tcount(*) AS num\n" +
"\t\tFROM\n" +
"\t\t\tajh_rectification_info\n" +
" ${ew.customSqlSegment} " +
"\t) aa\n" +
"GROUP BY\n" +
"\trec_ord_body")
List<Map<String, Object>> getStructNoHandleDetail(@Param(Constants.WRAPPER) QueryWrapper queryWrapper);
}