仪表盘优化-增加国内地图显示

This commit is contained in:
shimingxy
2024-12-03 09:04:27 +08:00
parent c3c5285175
commit 3ab9b80dfd
10 changed files with 247 additions and 20 deletions

View File

@@ -47,5 +47,6 @@ public interface ReportMapper extends IJpaMapper<JpaEntity> {
public List<Map<String,Object>> analysisApp(HashMap<String,Object> reportParameter );
public List<Map<String,Object>> analysisProvince(HashMap<String,Object> reportParameter);
}

View File

@@ -42,4 +42,5 @@ public interface ReportService extends IJpaService<JpaEntity>{
public List<Map<String,Object>> analysisApp(HashMap<String,Object> reportParameter);
public List<Map<String,Object>> analysisProvince(HashMap<String,Object> reportParameter);
}

View File

@@ -17,6 +17,7 @@
package org.dromara.maxkey.persistence.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -62,4 +63,27 @@ public class ReportServiceImpl extends JpaServiceImpl<ReportMapper,JpaEntity> i
return getMapper().analysisApp(reportParameter);
}
public List<Map<String,Object>> analysisProvince(HashMap<String,Object> reportParameter){
List<Map<String,Object>> maps = getMapper().analysisProvince(reportParameter);
if(null == maps) {
return new ArrayList<>();
}
for(Map<String,Object> map : maps) {
if(map.containsKey("reportstring")){
String name = map.get("reportstring").toString();
if (name.endsWith("")
|| name.endsWith("")
|| name.endsWith("特别行政区")
|| name.endsWith("自治区")) {
name = name.replace("","")
.replace("","")
.replace("特别行政区","")
.replace("自治区","");
}
map.put("name",name);
}
}
return maps;
}
}

View File

@@ -107,5 +107,19 @@
group by appname order by reportcount desc
limit 10
</select>
<!-- 30天各省份的访问统计 -->
<select id="analysisProvince" parameterType="java.util.HashMap" resultType="Map">
select
count(id) as reportcount,
coalesce(province,'Other') as reportstring
from mxk_history_login
where instid = #{instId}
and logintime >date_add(curdate(), interval - day(curdate()) -31 day)
and province !=''
group by reportstring
order by reportcount desc
limit 1000
</select>
</mapper>