Merge remote-tracking branch 'origin/main' into main

main
15036302109 5 months ago
commit 8668be780b

@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@ -157,6 +158,10 @@ public class EhsIndexStatisticsController extends BaseController {
List<Map<String,Object>> list = ehsIndexStatisticsService.getHiddenDangerTypeMapList();
return AjaxResult.success(list);
}
public static void main(String[] args) {
System.out.println(DateUtil.year(new Date()));
}
/**
*
*/
@ -165,6 +170,9 @@ public class EhsIndexStatisticsController extends BaseController {
public AjaxResult getHiddenDangerDataMapList(String year)
{
JSONArray row = new JSONArray();
if(StringUtils.isEmpty(year)){
year = DateUtil.year(new Date())+"";
}
List<Map<String,Object>> list = ehsIndexStatisticsService.getHiddenDangerDataMapList(year);
if(StringUtils.isNotEmpty(list)){
LinkedHashMap<Object, List<Map<String, Object>>> nameList = list.stream().collect(Collectors.groupingBy(e -> e.get("name"), LinkedHashMap::new, Collectors.toList()));

@ -6,9 +6,9 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://120.46.159.203:13306/ehs-tanghe?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false
url: jdbc:mysql://192.168.10.54:33306/ehs-tanghe?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false
username: root
password: a8EYUSoT8wHbuRkX
password: d86834af4bb81bce
# 从库数据源
slave:
# 从数据源开关/默认关闭

@ -266,61 +266,20 @@ SELECT
d.dict_value
FROM
(
WITH RECURSIVE months AS (
SELECT
DATE_FORMAT( date_add( CONCAT( #{yearStr}, '-01-01' ), INTERVAL ROW MONTH ), '%Y-%m' ) date_time
FROM
(
CONCAT( #{yearStr}, '-01-01' ) AS month_date UNION ALL
SELECT
@ROW := @ROW + 1 AS ROW
DATE_ADD( month_date, INTERVAL 1 MONTH ) AS month_date
FROM
(
SELECT
0 UNION ALL
SELECT
1 UNION ALL
SELECT
2 UNION ALL
SELECT
3 UNION ALL
SELECT
4 UNION ALL
SELECT
5 UNION ALL
SELECT
6 UNION ALL
SELECT
7 UNION ALL
SELECT
8 UNION ALL
SELECT
9
) t,
(
SELECT
0 UNION ALL
SELECT
1 UNION ALL
SELECT
2 UNION ALL
SELECT
3 UNION ALL
SELECT
4 UNION ALL
SELECT
5 UNION ALL
SELECT
6 UNION ALL
SELECT
7 UNION ALL
SELECT
8 UNION ALL
SELECT
9
) t2,
( SELECT @ROW :=- 1 ) r
) se
months
WHERE
DATE_FORMAT( date_add( CONCAT( #{yearStr}, '-01-01' ), INTERVAL ROW MONTH ), '%Y-%m' ) &lt;= DATE_FORMAT( CONCAT( #{yearStr}, '-12-01' ), '%Y-%m' )) s,
month_date &lt; CONCAT( #{yearStr}, '-12-01' )
) SELECT
DATE_FORMAT( month_date, '%Y-%m' ) AS date_time
FROM
months
) s,
sys_dict_data d
WHERE
d.dict_type = 'hidden_danger_grade'

Loading…
Cancel
Save