仪表盘优化-增加国内地图显示
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user