diff --git a/src/main/resources/magic/api/监管决策BI/企业资质统计.ms b/src/main/resources/magic/api/监管决策BI/企业资质统计.ms index aa08cac..fc82e48 100644 --- a/src/main/resources/magic/api/监管决策BI/企业资质统计.ms +++ b/src/main/resources/magic/api/监管决策BI/企业资质统计.ms @@ -5,7 +5,7 @@ "groupId" : "485e36d471af4f809398babc4abadafe", "name" : "企业资质统计", "createTime" : null, - "updateTime" : 1712567948590, + "updateTime" : 1716214741977, "lock" : null, "createBy" : null, "updateBy" : "admin", @@ -34,7 +34,7 @@ "responseBodyDefinition" : null } ================================ -List list = db.select("SELECT REPLACE(d.dict_value, '单位', '') dict_value, COUNT(m.id) num FROM wisdomsitezw.enterprise a LEFT JOIN wisdomsitezw.enterprise_main m ON m.enterprise_sn = a.enterprise_sn LEFT JOIN wisdomsitezw.system_dict_data d ON m.main_type = d.dict_label AND d.dict_type = 'enterprise_main' WHERE a.state = 1 AND #govalias GROUP BY d.dict_value") +List list = db.select("SELECT REPLACE(d.dict_value, '单位', '') dict_value, COUNT(m.id) num FROM enterprise a LEFT JOIN enterprise_main m ON m.enterprise_sn = a.enterprise_sn LEFT JOIN system_dict_data d ON m.main_type = d.dict_label AND d.dict_type = 'enterprise_main' WHERE a.state = 1 AND #govalias GROUP BY d.dict_value") List dict = Arrays.asList("勘察", "建设", "施工", "监理", "设计"); Integer other = 0; diff --git a/src/main/resources/magic/api/监管决策BI/实名制信息统计.ms b/src/main/resources/magic/api/监管决策BI/实名制信息统计.ms index d0d6cbc..fa3bbcf 100644 --- a/src/main/resources/magic/api/监管决策BI/实名制信息统计.ms +++ b/src/main/resources/magic/api/监管决策BI/实名制信息统计.ms @@ -5,7 +5,7 @@ "groupId" : "485e36d471af4f809398babc4abadafe", "name" : "实名制信息统计", "createTime" : null, - "updateTime" : 1712567953141, + "updateTime" : 1716214746934, "lock" : null, "createBy" : null, "updateBy" : "admin", @@ -35,7 +35,7 @@ } ================================ import java.math.BigDecimal -Map map = db.selectOne("SELECT COUNT(id) total,IFNULL(SUM(IF(person_type = 1, 1, 0)),0) manager,IFNULL(SUM(IF(person_type = 2, 1, 0)),0) worker FROM wisdomsitezw.worker_info WHERE #project") +Map map = db.selectOne("SELECT COUNT(id) total,IFNULL(SUM(IF(person_type = 1, 1, 0)),0) manager,IFNULL(SUM(IF(person_type = 2, 1, 0)),0) worker FROM worker_info WHERE #project") var total = map.get("total")::int var manager = map.get("manager")::int var worker = map.get("worker")::int diff --git a/src/main/resources/magic/api/监管决策BI/扬尘报警类型统计.ms b/src/main/resources/magic/api/监管决策BI/扬尘报警类型统计.ms index da5179a..d9e5028 100644 --- a/src/main/resources/magic/api/监管决策BI/扬尘报警类型统计.ms +++ b/src/main/resources/magic/api/监管决策BI/扬尘报警类型统计.ms @@ -5,7 +5,7 @@ "groupId" : "485e36d471af4f809398babc4abadafe", "name" : "扬尘报警类型统计", "createTime" : null, - "updateTime" : 1712567966222, + "updateTime" : 1716214850727, "lock" : null, "createBy" : null, "updateBy" : "admin", @@ -83,9 +83,9 @@ } ================================ import java.math.BigDecimal -List list = db.select("SELECT d.dict_value as type, COUNT(a.id) num FROM wisdomsitezw.system_dict_data d LEFT JOIN wisdomsitezw.environment_alarm a ON d.dict_value = a.type AND TO_DAYS(a.create_time) = TO_DAYS(NOW()) AND #project WHERE d.dict_type = 'environment_alarm_type' GROUP BY d.dict_value") +List list = db.select("SELECT d.dict_value as type, COUNT(a.id) num FROM system_dict_data d LEFT JOIN environment_alarm a ON d.dict_value = a.type AND TO_DAYS(a.create_time) = TO_DAYS(NOW()) AND #project WHERE d.dict_type = 'environment_alarm_type' GROUP BY d.dict_value") -Map totalMap = db.selectOne("SELECT COUNT( id ) num FROM wisdomsitezw.environment_alarm WHERE TO_DAYS( create_time ) = TO_DAYS(NOW()) AND #project") +Map totalMap = db.selectOne("SELECT COUNT( id ) num FROM environment_alarm WHERE TO_DAYS( create_time ) = TO_DAYS(NOW()) AND #project") String total = totalMap.get("num")::int for (item in list) { Map map = item; diff --git a/src/main/resources/magic/api/监管决策BI/查询工程分类统计.ms b/src/main/resources/magic/api/监管决策BI/查询工程分类统计.ms index 2b5d5bf..bdc4040 100644 --- a/src/main/resources/magic/api/监管决策BI/查询工程分类统计.ms +++ b/src/main/resources/magic/api/监管决策BI/查询工程分类统计.ms @@ -5,7 +5,7 @@ "groupId" : "485e36d471af4f809398babc4abadafe", "name" : "查询工程分类统计", "createTime" : null, - "updateTime" : 1712567831373, + "updateTime" : 1716214710069, "lock" : null, "createBy" : null, "updateBy" : "admin", @@ -83,11 +83,11 @@ } ================================ import java.math.BigDecimal -List list = db.select("SELECT d.dict_value, COUNT( a.id ) num FROM wisdomsitezw.engineering a RIGHT JOIN wisdomsitezw.system_dict_data d ON a.engineering_type = d.dict_label AND #projectalias WHERE a.examine_state = 3 AND d.dict_type = 'engineering_type' GROUP BY d.dict_value ORDER BY d.dict_sort") +List list = db.select("SELECT d.dict_value, COUNT( a.id ) num FROM engineering a RIGHT JOIN system_dict_data d ON a.engineering_type = d.dict_label AND #projectalias WHERE a.examine_state = 3 AND d.dict_type = 'engineering_type' GROUP BY d.dict_value ORDER BY d.dict_sort") -List dictList = db.select("SELECT dict_value, dict_label num FROM wisdomsitezw.system_dict_data where dict_type = 'engineering_type' ORDER BY dict_sort") +List dictList = db.select("SELECT dict_value, dict_label num FROM system_dict_data where dict_type = 'engineering_type' ORDER BY dict_sort") -Map totalMap = db.selectOne("SELECT COUNT(id) num FROM wisdomsitezw.engineering WHERE examine_state = 3 AND #project") +Map totalMap = db.selectOne("SELECT COUNT(id) num FROM engineering WHERE examine_state = 3 AND #project") String total = totalMap.get("num") List result = new ArrayList(); Integer other = 0; diff --git a/src/main/resources/magic/api/监管决策BI/查询工程详细信息.ms b/src/main/resources/magic/api/监管决策BI/查询工程详细信息.ms index 4d09189..68eae3d 100644 --- a/src/main/resources/magic/api/监管决策BI/查询工程详细信息.ms +++ b/src/main/resources/magic/api/监管决策BI/查询工程详细信息.ms @@ -5,7 +5,7 @@ "groupId" : "485e36d471af4f809398babc4abadafe", "name" : "查询工程详细信息", "createTime" : null, - "updateTime" : 1712567922984, + "updateTime" : 1716214719556, "lock" : null, "createBy" : null, "updateBy" : "admin", @@ -34,4 +34,4 @@ "responseBodyDefinition" : null } ================================ -return db.select("SELECT e.*, ent.enterprise_name FROM wisdomsitezw.engineering e LEFT JOIN wisdomsitezw.engineering_main m ON e.engineering_sn = m.engineering_sn LEFT JOIN wisdomsitezw.enterprise ent ON m.enterprise_sn = ent.enterprise_sn WHERE examine_state = 3 AND m.type = 1 AND #project") \ No newline at end of file +return db.select("SELECT e.*, ent.enterprise_name FROM engineering e LEFT JOIN engineering_main m ON e.engineering_sn = m.engineering_sn LEFT JOIN enterprise ent ON m.enterprise_sn = ent.enterprise_sn WHERE examine_state = 3 AND m.type = 1 AND #project") \ No newline at end of file diff --git a/src/main/resources/magic/api/监管决策BI/查询所有项目数.ms b/src/main/resources/magic/api/监管决策BI/查询所有项目数.ms index a6c8673..9bdcbf4 100644 --- a/src/main/resources/magic/api/监管决策BI/查询所有项目数.ms +++ b/src/main/resources/magic/api/监管决策BI/查询所有项目数.ms @@ -5,7 +5,7 @@ "groupId" : "485e36d471af4f809398babc4abadafe", "name" : "查询所有项目数", "createTime" : null, - "updateTime" : 1712567927180, + "updateTime" : 1716214724052, "lock" : null, "createBy" : null, "updateBy" : "admin", @@ -34,6 +34,6 @@ "responseBodyDefinition" : null } ================================ -Map map = db.selectOne("SELECT COUNT(project_id) as total FROM wisdomsitezw.project WHERE state = 1 AND #gov") +Map map = db.selectOne("SELECT COUNT(project_id) as total FROM project WHERE state = 1 AND #gov") map.put("total", map.get("total")::int) return map \ No newline at end of file diff --git a/src/main/resources/magic/api/监管决策BI/查询项目详细信息.ms b/src/main/resources/magic/api/监管决策BI/查询项目详细信息.ms index c3f3984..b868c79 100644 --- a/src/main/resources/magic/api/监管决策BI/查询项目详细信息.ms +++ b/src/main/resources/magic/api/监管决策BI/查询项目详细信息.ms @@ -5,7 +5,7 @@ "groupId" : "485e36d471af4f809398babc4abadafe", "name" : "查询项目详细信息", "createTime" : null, - "updateTime" : 1712567931221, + "updateTime" : 1716214727894, "lock" : null, "createBy" : null, "updateBy" : "admin", @@ -22,4 +22,4 @@ "responseBodyDefinition" : null } ================================ -return db.select("SELECT * FROM wisdomsitezw.project WHERE state = 1 AND #gov") \ No newline at end of file +return db.select("SELECT * FROM project WHERE state = 1 AND #gov") \ No newline at end of file diff --git a/src/main/resources/magic/api/监管决策BI/顶部查询工程统计信息.ms b/src/main/resources/magic/api/监管决策BI/顶部查询工程统计信息.ms index f39e2bc..df4141d 100644 --- a/src/main/resources/magic/api/监管决策BI/顶部查询工程统计信息.ms +++ b/src/main/resources/magic/api/监管决策BI/顶部查询工程统计信息.ms @@ -5,7 +5,7 @@ "groupId" : "485e36d471af4f809398babc4abadafe", "name" : "顶部查询工程统计信息", "createTime" : null, - "updateTime" : 1712567936389, + "updateTime" : 1716214733431, "lock" : null, "createBy" : null, "updateBy" : "admin", @@ -34,4 +34,4 @@ "responseBodyDefinition" : null } ================================ -return db.selectOne("SELECT IFNULL(SUM(IF(examine_state = 3, 1, 0)),0) total,IFNULL(SUM(IF(YEAR(start_time) = YEAR(NOW()) AND state > 1, 1, 0)),0) newBuild,IFNULL(SUM(IF(YEAR(start_time) = YEAR(NOW()) AND state = 7, 1, 0)),0) finish,IFNULL(SUM(IF(is_important = 1 AND state > 1, 1, 0)),0) important,IFNULL( SUM( IF ( examine_state = 3 AND state = 1, 1, 0 )), 0 ) unStart,IFNULL( SUM( IF ( examine_state = 3 AND state = 2, 1, 0 )), 0 ) building,IFNULL( SUM( IF ( examine_state = 3 AND state = 4, 1, 0 )), 0 ) complete FROM wisdomsitezw.engineering WHERE #project") \ No newline at end of file +return db.selectOne("SELECT IFNULL(SUM(IF(examine_state = 3, 1, 0)),0) total,IFNULL(SUM(IF(YEAR(start_time) = YEAR(NOW()) AND state > 1, 1, 0)),0) newBuild,IFNULL(SUM(IF(YEAR(start_time) = YEAR(NOW()) AND state = 7, 1, 0)),0) finish,IFNULL(SUM(IF(is_important = 1 AND state > 1, 1, 0)),0) important,IFNULL( SUM( IF ( examine_state = 3 AND state = 1, 1, 0 )), 0 ) unStart,IFNULL( SUM( IF ( examine_state = 3 AND state = 2, 1, 0 )), 0 ) building,IFNULL( SUM( IF ( examine_state = 3 AND state = 4, 1, 0 )), 0 ) complete FROM engineering WHERE #project") \ No newline at end of file