Commit 36b95de3 by zhangyuan

修改首页统计页面,新加统计接口

parent a00f7559
package com.ruoyi.web.controller.system;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.IOrhonFgqyService;
import com.ruoyi.system.service.ISysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* 首页统计
*
* @author ruoyi
*/
@Controller
@RequestMapping("/home/statistics")
public class HomeStatisticsController extends BaseController
{
@Autowired
private IOrhonFgqyService orhonFgqyService;
@PostMapping("/chart")
@ResponseBody
public Object chart(){
try {
return AjaxResult.success(orhonFgqyService.chart());
}catch (Exception e){
return AjaxResult.error();
}
}
}
package com.ruoyi.system.mapper; package com.ruoyi.system.mapper;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.system.domain.OrhonFgqy; import com.ruoyi.system.domain.OrhonFgqy;
/** /**
...@@ -62,4 +64,14 @@ public interface OrhonFgqyMapper ...@@ -62,4 +64,14 @@ public interface OrhonFgqyMapper
public String findDzz(); public String findDzz();
public String findQyzs(); public String findQyzs();
public List<Map> selectLineChart();
List<Map> selectBarChart();
List<Map> selectCurveChart();
List<Map> selectPieChart();
List<Map> selectRadarChart();
} }
package com.ruoyi.system.service; package com.ruoyi.system.service;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.system.domain.OrhonFgqy; import com.ruoyi.system.domain.OrhonFgqy;
/** /**
...@@ -62,4 +64,6 @@ public interface IOrhonFgqyService ...@@ -62,4 +64,6 @@ public interface IOrhonFgqyService
public String findQyzs(); public String findQyzs();
public String findDzz(); public String findDzz();
Object chart();
} }
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.OrhonFgqyMapper; import com.ruoyi.system.mapper.OrhonFgqyMapper;
...@@ -101,4 +105,28 @@ public class OrhonFgqyServiceImpl implements com.ruoyi.system.service.IOrhonFgqy ...@@ -101,4 +105,28 @@ public class OrhonFgqyServiceImpl implements com.ruoyi.system.service.IOrhonFgqy
public String findDzz() { public String findDzz() {
return orhonFgqyMapper.findDzz(); return orhonFgqyMapper.findDzz();
} }
@Override
public Object chart() {
Map resultMap = new HashMap();
try {
List<Map> lineChart = orhonFgqyMapper.selectLineChart();
resultMap.put("lineChart",lineChart);
List<Map> barChart = orhonFgqyMapper.selectBarChart();
resultMap.put("barChart",barChart);
List<Map> curveChart = orhonFgqyMapper.selectCurveChart();
resultMap.put("curveChart",curveChart);
List<Map> pieChart = orhonFgqyMapper.selectPieChart();
resultMap.put("pieChart",pieChart);
List<Map> radarChart = orhonFgqyMapper.selectRadarChart();
resultMap.put("radarChart",radarChart);
}catch (Exception e){
return AjaxResult.error(e+"");
}
return AjaxResult.success(resultMap);
}
} }
...@@ -384,4 +384,90 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -384,4 +384,90 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<!-- 市直、各旗区非公企业分布折线统计-->
<select id="selectLineChart" parameterType="java.util.List" resultType="java.util.Map">
SELECT
d.dict_label name,
count( off.id ) value
FROM
sys_dict_data d
LEFT JOIN orhon_fgqy off ON off.dept_id = d.dict_value
WHERE
d.dict_type = 'orhon_qyfl'
AND d.STATUS = '0'
GROUP BY
d.dict_code
ORDER BY
d.dict_sort
</select>
<!-- 市直、各旗区社会组织分布折线统计-->
<select id="selectBarChart" parameterType="java.util.List" resultType="java.util.Map">
SELECT
d.dict_label name,
count( oz.id ) value
FROM
sys_dict_data d
LEFT JOIN orhon_shzz oz ON oz.dept_id = d.dict_value
WHERE
d.dict_type = 'orhon_qyfl'
AND d.STATUS = '0'
GROUP BY
d.dict_code
ORDER BY
d.dict_sort
</select>
<!-- 市直、各旗区社会组织分布折线统计-->
<select id="selectCurveChart" parameterType="java.util.List" resultType="java.util.Map">
SELECT
d.dict_label name,
(select count(0) from orhon_shzz where dept_id = d.dict_value) shzzValue,
(select count(0) from orhon_fgqy where dept_id = d.dict_value) fgqyValue
FROM
sys_dict_data d
WHERE
d.dict_type = 'orhon_qyfl'
AND d.STATUS = '0'
GROUP BY
d.dict_code
ORDER BY
d.dict_sort
</select>
<!-- 全市非公企业与社会组织党委、党总支、党支部、联合党支部数量分布统计-->
<select id="selectPieChart" parameterType="java.util.List" resultType="java.util.Map">
SELECT
d.dict_label name,
(select count(0) from orhon_shzz where dept_id = d.dict_value) shzzValue,
(select count(0) from orhon_fgqy where dept_id = d.dict_value) fgqyValue
FROM
sys_dict_data d
WHERE
d.dict_type = 'orhon_qyfl'
AND d.STATUS = '0'
GROUP BY
d.dict_code
ORDER BY
d.dict_sort
</select>
<!-- 市直、各旗区非公企业与社会组织统计-->
<select id="selectRadarChart" parameterType="java.util.List" resultType="java.util.Map">
SELECT
d.dict_label name,
(select count(0) from orhon_shzz where dept_id = d.dict_value) shzzValue,
(select count(0) from orhon_fgqy where dept_id = d.dict_value) fgqyValue
FROM
sys_dict_data d
WHERE
d.dict_type = 'orhon_qyfl'
AND d.STATUS = '0'
GROUP BY
d.dict_code
ORDER BY
d.dict_sort
</select>
</mapper> </mapper>
...@@ -384,4 +384,90 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -384,4 +384,90 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<!-- 市直、各旗区非公企业分布折线统计-->
<select id="selectLineChart" parameterType="java.util.List" resultType="java.util.Map">
SELECT
d.dict_label name,
count( off.id ) value
FROM
sys_dict_data d
LEFT JOIN orhon_fgqy off ON off.dept_id = d.dict_value
WHERE
d.dict_type = 'orhon_qyfl'
AND d.STATUS = '0'
GROUP BY
d.dict_code
ORDER BY
d.dict_sort
</select>
<!-- 市直、各旗区社会组织分布折线统计-->
<select id="selectBarChart" parameterType="java.util.List" resultType="java.util.Map">
SELECT
d.dict_label name,
count( oz.id ) value
FROM
sys_dict_data d
LEFT JOIN orhon_shzz oz ON oz.dept_id = d.dict_value
WHERE
d.dict_type = 'orhon_qyfl'
AND d.STATUS = '0'
GROUP BY
d.dict_code
ORDER BY
d.dict_sort
</select>
<!-- 市直、各旗区社会组织分布折线统计-->
<select id="selectCurveChart" parameterType="java.util.List" resultType="java.util.Map">
SELECT
d.dict_label name,
(select count(0) from orhon_shzz where dept_id = d.dict_value) shzzValue,
(select count(0) from orhon_fgqy where dept_id = d.dict_value) fgqyValue
FROM
sys_dict_data d
WHERE
d.dict_type = 'orhon_qyfl'
AND d.STATUS = '0'
GROUP BY
d.dict_code
ORDER BY
d.dict_sort
</select>
<!-- 全市非公企业与社会组织党委、党总支、党支部、联合党支部数量分布统计-->
<select id="selectPieChart" parameterType="java.util.List" resultType="java.util.Map">
SELECT
d.dict_label name,
(select count(0) from orhon_shzz where dept_id = d.dict_value) shzzValue,
(select count(0) from orhon_fgqy where dept_id = d.dict_value) fgqyValue
FROM
sys_dict_data d
WHERE
d.dict_type = 'orhon_qyfl'
AND d.STATUS = '0'
GROUP BY
d.dict_code
ORDER BY
d.dict_sort
</select>
<!-- 市直、各旗区非公企业与社会组织统计-->
<select id="selectRadarChart" parameterType="java.util.List" resultType="java.util.Map">
SELECT
d.dict_label name,
(select count(0) from orhon_shzz where dept_id = d.dict_value) shzzValue,
(select count(0) from orhon_fgqy where dept_id = d.dict_value) fgqyValue
FROM
sys_dict_data d
WHERE
d.dict_type = 'orhon_qyfl'
AND d.STATUS = '0'
GROUP BY
d.dict_code
ORDER BY
d.dict_sort
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment