Browse Source

统计分析和按季度查询优化

v2
蟑螂恶霸 2 years ago
parent
commit
d0518e3a66
  1. 98
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/analysis/analysis.html
  2. 360
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/statistical.html
  3. 21
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalController.java
  4. 28
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/StatisticalVo.java
  5. 3
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalMapper.java
  6. 6
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/StatisticalService.java
  7. 36
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalServiceImpl.java
  8. 4
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml
  9. 4
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml
  10. 4
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseLawEnforcementMapper.xml
  11. 70
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalMapper.xml

98
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/analysis/analysis.html

@ -42,10 +42,11 @@
</select>月度</span> </select>月度</span>
</div> </div>
<div class="statit"> <div class="statit">
<span id="one1" class="actit" onclick="setTab('one',1,4)">案件数量</span> <span id="one1" class="actit" onclick="setTab('one',1,5)">案件数量</span>
<span id="one2" onclick="setTab('one',2,4)">执法人员</span> <span id="one2" onclick="setTab('one',2,5)">执法人员</span>
<span id="one3" onclick="setTab('one',3,4)">检查事项</span> <span id="one3" onclick="setTab('one',3,5)">检查事项</span>
<span id="one4" onclick="setTab('one',4,4)" class="hover">企业类型</span> <span id="one4" onclick="setTab('one',4,5)">企业类型</span>
<span id="one5" onclick="setTab('one',5,5)">企业排序</span>
</div> </div>
<div id="con_one_1" class="tab_item" style="display: block;"> <div id="con_one_1" class="tab_item" style="display: block;">
@ -56,10 +57,14 @@
<div style="float: left; margin: 2% 2%; width: 100%; height: 100%" id="barEnforcer"></div> <div style="float: left; margin: 2% 2%; width: 100%; height: 100%" id="barEnforcer"></div>
</div> </div>
<div id="con_one_3" class="tab_item"> <div id="con_one_3" class="tab_item">
<div style="float: left; margin: 2% 2%; width: 100%; height: 100%" id="pieItem"></div>
</div> </div>
<div id="con_one_4" class="tab_item"> <div id="con_one_4" class="tab_item">
<div style="float: left; margin: 2% 2%; width: 100%; height: 100%" id="pieEnterprise"></div> <div style="float: left; margin: 2% 2%; width: 100%; height: 100%" id="pieEnterprise"></div>
</div> </div>
<div id="con_one_5" class="tab_item">
<div style="float: left; margin: 2% 2%; width: 100%; height: 100%" id="lineEnterprise"></div>
</div>
</div> </div>
<th:block th:include="zdxtInclude :: footer"/> <th:block th:include="zdxtInclude :: footer"/>
<script type="text/javascript" src="/js/echarts.min.js"></script> <script type="text/javascript" src="/js/echarts.min.js"></script>
@ -122,6 +127,31 @@
} }
}); });
} }
function queryItemAnalysis(qorm, year, quarter, month, month) {
$.ajax({
url: prefix + '/itemAnalysis', //后台url
data: {
"qorm": qorm,
"year": year,
"quarter": quarter,
"month": month,
},
type: "GET",
dataType: 'json',
success: function (data) { //成功,回调函数
var datas = [];
for (var i=0; i<data.data.length; i++) {
datas.push({
value: data.data[i].total,
name: data.data[i].lawEnforcement
});
}
pie_rose("pieItem", datas);
},
error: function (er) { //失败,回调函数
}
});
}
function queryEnterpriseAnalysis(qorm, year, quarter, month, month) { function queryEnterpriseAnalysis(qorm, year, quarter, month, month) {
$.ajax({ $.ajax({
url: prefix + '/enterpriseAnalysis', //后台url url: prefix + '/enterpriseAnalysis', //后台url
@ -134,19 +164,6 @@
type: "GET", type: "GET",
dataType: 'json', dataType: 'json',
success: function (data) { //成功,回调函数 success: function (data) { //成功,回调函数
pie_rose("pieEnterprise", [
{value:10, name:'rose1'},
{value:5, name:'rose2'},
{value:15, name:'rose3'},
{value:25, name:'rose4'},
{value:20, name:'rose5'},
{value:35, name:'rose6'},
{value:30, name:'rose7'},
{value:40, name:'rose8'}
]);
console.log("------")
console.log(data);
console.log("------")
var datas = []; var datas = [];
for (var i=0; i<data.data.length; i++) { for (var i=0; i<data.data.length; i++) {
datas.push({ datas.push({
@ -160,6 +177,35 @@
} }
}); });
} }
function queryEnterpriseSortAnalysis(qorm, year, quarter, month, month) {
$.ajax({
url: prefix + '/enterpriseSortAnalysis', //后台url
data: {
"qorm": qorm,
"year": year,
"quarter": quarter,
"month": month,
},
type: "GET",
dataType: 'json',
success: function (data) { //成功,回调函数
console.log("==========")
console.log(data)
console.log("==========")
var dates = [];
for (var i=0; i<data.data.dates.length; i++) {
dates.push(data.data.dates[i]);
}
var nums = [];
for (var i=0; i<data.data.nums.length; i++) {
nums.push(data.data.nums[i]);
}
line_across("lineEnterprise", dates, nums);
},
error: function (er) { //失败,回调函数
}
});
}
function selectDate() { function selectDate() {
var qormElement = document.getElementById("qorm"); var qormElement = document.getElementById("qorm");
@ -172,8 +218,9 @@
var monthValue = monthElement.options[monthElement.selectedIndex].value; var monthValue = monthElement.options[monthElement.selectedIndex].value;
queryCaseAnalysis(qormValue, yearValue, quarterValue, monthValue); queryCaseAnalysis(qormValue, yearValue, quarterValue, monthValue);
queryEnforcerAnalysis(qormValue, yearValue, quarterValue, monthValue); queryEnforcerAnalysis(qormValue, yearValue, quarterValue, monthValue);
queryItemAnalysis(qormValue, yearValue, quarterValue, monthValue);
queryEnterpriseAnalysis(qormValue, yearValue, quarterValue, monthValue); queryEnterpriseAnalysis(qormValue, yearValue, quarterValue, monthValue);
queryEnterpriseSortAnalysis(qormValue, yearValue, quarterValue, monthValue);
} }
function caseAnalysis(dataList) { function caseAnalysis(dataList) {
@ -234,7 +281,7 @@
function pie_rose(targetId, datas) { function pie_rose(targetId, datas) {
var myChart = echarts.init(document.getElementById(targetId)); var myChart = echarts.init(document.getElementById(targetId));
option = { var option = {
tooltip : { tooltip : {
trigger: 'item', trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)" formatter: "{a} <br/>{b} : {c} ({d}%)"
@ -257,6 +304,19 @@
myChart.resize(); myChart.resize();
window.addEventListener('resize', () => { myChart.resize(); }); window.addEventListener('resize', () => { myChart.resize(); });
} }
function line_across(targetId, dates, nums) {
var myChart = echarts.init(document.getElementById(targetId));
var option = {
xAxis: { type: 'category', data: dates },
yAxis: { type: 'value' },
series: [{ type: 'line', data: nums }]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
myChart.resize();
window.addEventListener('resize', () => { myChart.resize(); });
}
</script> </script>
</body> </body>
</html> </html>

360
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/statistical.html

@ -2,130 +2,258 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head> <head>
<th:block th:include="zdxtInclude :: header('登陆记录')"/> <th:block th:include="zdxtInclude :: header('登陆记录')"/>
<link type="text/css" href="/css/stat.css" rel="stylesheet" /> <link type="text/css" href="/css/stat.css" rel="stylesheet"/>
<style type="text/css">
table.gridtable {
font-family: verdana, arial, sans-serif;
font-size: 11px;
color: #333333;
border-width: 1px;
border-color: #666666;
border-collapse: collapse;
table-layout: fixed;
width: 98%;
}
table.gridtable th {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #666666;
background-color: #dedede;
font-weight: bold;
text-align: center;
vertical-align: middle;
}
table.gridtable td {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #666666;
background-color: #ffffff;
}
</style>
</head> </head>
<body> <body>
<div class="statwrap"> <div class="statwrap">
<h1 class="headtit">深圳市各类行政检查实施情况统计表</h1> <h1 class="headtit">深圳市各类行政检查实施情况分析</h1>
<div class="seltime"><i class="icsty"></i><span><select name="year"> <div class="seltime">
<option>2024</option> <i class="icsty"></i>
<option>2023</option> <span><select id="qorm" name="qorm" onchange="selectDate()">
<option>2022</option> <option value="q">季度</option>
</select>年度</span> <option value="m">月度</option>
<span><select name="quarter"> </select>年度</span>
<option>2024-01</option> <span><select id="year" name="year" onchange="selectDate()">
</select>季度</span> <option value="2024">2024</option>
<span><select name="month"> <option value="2023">2023</option>
<option>2024-01</option> <option value="2022">2022</option>
<option>2024-02</option> </select>年度</span>
<option>2024-03</option> <span><select id="quarter" name="quarter" onchange="selectDate()">
</select>月度</span> <option value="q1">1季度</option>
</div> <option value="q2">2季度</option>
<div class="statit"><span id="one1" class="actit" onclick="setTab('one',1,4)">检查事项</span><span id="one2" onclick="setTab('one',2,4)">执法人员</span><span id="one3" onclick="setTab('one',3,4)">案件数量</span><span id="one4" onclick="setTab('one',4,4)" class="hover">企业类型</span></div> <option value="q3">3季度</option>
<div id="con_one_1" class="tab_item" style="display: block;"> <option value="q4">4季度</option>
<div class="listhead"> </select>季度</span>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="desktab"> <span><select id="month" name="month" onchange="selectDate()">
<colgroup> <option value="01">1</option>
<col width="20%" /> <option value="02">2</option>
<col width="75%" /> <option value="03">3</option>
</colgroup> <option value="04">4</option>
<tr class="trodd"> <option value="05">5</option>
<th>行政检查事项</th> <option value="06">6</option>
<th>行政检查次数</th> <option value="07">7</option>
</tr> <option value="08">8</option>
</table> <option value="09">9</option>
</div> <option value="10">10</option>
<div class="listbody"> <option value="11">11</option>
<div class="inner"> <option value="12">12</option>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="desktab"> </select>月度</span>
<colgroup> </div>
<col width="20%" /> <div class="statit">
<col width="75%" /> <span id="one1" class="actit" onclick="setTab('one',1,5)">企业排序</span>
</colgroup> <span id="one2" onclick="setTab('one',2,5)">案件数量</span>
<tr> <span id="one3" onclick="setTab('one',3,5)">执法人员</span>
<td>生态环境检查</td> <span id="one4" onclick="setTab('one',4,5)">检查事项</span>
<td>35</td> <span id="one5" onclick="setTab('one',5,5)">企业类型</span>
</tr> </div>
<tr>
<td>商务领域检查</td>
<td>22</td>
</tr>
<tr>
<td>财务领域检查</td>
<td>18</td>
</tr>
<tr>
<td>水务领域检查</td>
<td>19</td>
</tr>
<tr>
<td>卫生健康检查</td>
<td>43</td>
</tr>
<tr>
<td>生态环境检查</td>
<td>35</td>
</tr>
<tr>
<td>商务领域检查</td>
<td>22</td>
</tr>
<tr>
<td>财务领域检查</td>
<td>18</td>
</tr>
<tr>
<td>水务领域检查</td>
<td>19</td>
</tr>
<tr>
<td>卫生健康检查</td>
<td>43</td>
</tr>
<tr>
<td>生态环境检查</td>
<td>35</td>
</tr>
<tr>
<td>商务领域检查</td>
<td>22</td>
</tr>
<tr>
<td>财政领域检查</td>
<td>18</td>
</tr>
<tr>
<td>水务领域检查</td>
<td>19</td>
</tr>
<tr>
<td>卫生健康检查</td>
<td>43</td>
</tr>
</table>
</div>
</div>
</div> <div id="con_one_1" class="tab_item" style="display: block;">
<div id="con_one_2" class="tab_item"> <div style="float: left; margin: 2% 2%; width: 100%; height: 100%" id="enterpriseSort">
</div> <table class="gridtable">
<thead>
<div id="con_one_3" class="tab_item"> <tr>
</div> <td>企业</td>
<td>执法数</td>
<div id="con_one_4" class="tab_item"> <td>日期</td>
</div> </tr>
</thead>
<tbody id="enterpriseSortBody"></tbody>
</table>
</div>
</div>
<div id="con_one_2" class="tab_item">
</div>
<div id="con_one_3" class="tab_item">
<div style="float: left; margin: 2% 2%; width: 100%; height: 100%" id="pieItem"></div>
</div>
<div id="con_one_4" class="tab_item">
<div style="float: left; margin: 2% 2%; width: 100%; height: 100%" id="pieEnterprise"></div>
</div>
<div id="con_one_5" class="tab_item">
<div style="float: left; margin: 2% 2%; width: 100%; height: 100%" id="lineEnterprise"></div>
</div>
</div> </div>
<th:block th:include="zdxtInclude :: footer"/> <th:block th:include="zdxtInclude :: footer"/>
<script> <script>
function setTab(name,cursel,n){ var prefix = ctx + "statistical";
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i); window.onload = function () {
var con=document.getElementById("con_"+name+"_"+i); selectDate();
menu.className=i==cursel?"actit":""; }
con.style.display=i==cursel?"block":"none";
function setTab(name, cursel, n) {
for (i = 1; i <= n; i++) {
var menu = document.getElementById(name + i);
var con = document.getElementById("con_" + name + "_" + i);
menu.className = i == cursel ? "actit" : "";
con.style.display = i == cursel ? "block" : "none";
}
}
function queryCaseAnalysis(qorm, year, quarter, month, month) {
$.ajax({
url: prefix + '/caseAnalysis', //后台url
data: {
"qorm": qorm,
"year": year,
"quarter": quarter,
"month": month,
},
type: "GET",
dataType: 'json',
success: function (data) { //成功,回调函数
console.log(data.data)
},
error: function (er) { //失败,回调函数
}
});
}
function queryEnforcerAnalysis(qorm, year, quarter, month, month) {
$.ajax({
url: prefix + '/enforcerAnalysis', //后台url
data: {
"qorm": qorm,
"year": year,
"quarter": quarter,
"month": month,
},
type: "GET",
dataType: 'json',
success: function (data) { //成功,回调函数
console.log(data.data)
},
error: function (er) { //失败,回调函数
}
});
}
function queryItemAnalysis(qorm, year, quarter, month, month) {
$.ajax({
url: prefix + '/itemAnalysis', //后台url
data: {
"qorm": qorm,
"year": year,
"quarter": quarter,
"month": month,
},
type: "GET",
dataType: 'json',
success: function (data) { //成功,回调函数
console.log(data.data)
},
error: function (er) { //失败,回调函数
}
});
}
function queryEnterpriseAnalysis(qorm, year, quarter, month, month) {
$.ajax({
url: prefix + '/enterpriseAnalysis', //后台url
data: {
"qorm": qorm,
"year": year,
"quarter": quarter,
"month": month,
},
type: "GET",
dataType: 'json',
success: function (data) { //成功,回调函数
console.log(data.data)
},
error: function (er) { //失败,回调函数
}
});
}
function queryEnterpriseSortAnalysis(qorm, year, quarter, month, month) {
$.ajax({
url: prefix + '/enterpriseTableAnalysis', //后台url
data: {
"qorm": qorm,
"year": year,
"quarter": quarter,
"month": month,
},
type: "GET",
dataType: 'json',
success: function (data) { //成功,回调函数
var tabStr = enterpriseTableBody(data.data);
document.getElementById("enterpriseSortBody").innerHTML = tabStr;
console.log(document.getElementById("enterpriseSortBody"))
},
error: function (er) { //失败,回调函数
}
});
}
function selectDate() {
var qormElement = document.getElementById("qorm");
var qormValue = qormElement.options[qormElement.selectedIndex].value;
var yearElement = document.getElementById("year");
var yearValue = yearElement.options[yearElement.selectedIndex].value;
var quarterElement = document.getElementById("quarter");
var quarterValue = quarterElement.options[quarterElement.selectedIndex].value;
var monthElement = document.getElementById("month");
var monthValue = monthElement.options[monthElement.selectedIndex].value;
// queryCaseAnalysis(qormValue, yearValue, quarterValue, monthValue);
// queryEnforcerAnalysis(qormValue, yearValue, quarterValue, monthValue);
// queryItemAnalysis(qormValue, yearValue, quarterValue, monthValue);
// queryEnterpriseAnalysis(qormValue, yearValue, quarterValue, monthValue);
queryEnterpriseSortAnalysis(qormValue, yearValue, quarterValue, monthValue);
}
function enterpriseTableBody(data) {
var bodyHtml = "";
// 生成表格内容
for (var i = 0; i < data.length; i++) {
var d = data[i];
bodyHtml += "<tr>";
bodyHtml += "<td>";
bodyHtml += d.name;
bodyHtml += "</td>";
bodyHtml += "<td>";
bodyHtml += d.total;
bodyHtml += "</td>";
bodyHtml += "<td>";
bodyHtml += d.date;
bodyHtml += "</td>";
bodyHtml += "</tr>";
}
return bodyHtml;
} }
}
</script> </script>
</body> </body>
</html> </html>

21
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalController.java

@ -75,10 +75,31 @@ public class StatisticalController {
return ZDResponse.success("查询成功", statisticalVos); return ZDResponse.success("查询成功", statisticalVos);
} }
@GetMapping("/itemAnalysis")
@ResponseBody
public ZDResponse itemAnalysis(StatisticalVo statisticalVo){
List<StatisticalVo> statisticalVos = statisticalService.itemAnalysis(statisticalVo);
return ZDResponse.success("查询成功", statisticalVos);
}
@GetMapping("/enterpriseAnalysis") @GetMapping("/enterpriseAnalysis")
@ResponseBody @ResponseBody
public ZDResponse enterpriseAnalysis(StatisticalVo statisticalVo){ public ZDResponse enterpriseAnalysis(StatisticalVo statisticalVo){
List<StatisticalVo> statisticalVos = statisticalService.enterpriseAnalysis(statisticalVo); List<StatisticalVo> statisticalVos = statisticalService.enterpriseAnalysis(statisticalVo);
return ZDResponse.success("查询成功", statisticalVos); return ZDResponse.success("查询成功", statisticalVos);
} }
@GetMapping("/enterpriseSortAnalysis")
@ResponseBody
public ZDResponse enterpriseSortAnalysis(StatisticalVo statisticalVo){
Map<String, Object> res = statisticalService.enterpriseSortAnalysis(statisticalVo);
return ZDResponse.success("查询成功", res);
}
@GetMapping("/enterpriseTableAnalysis")
@ResponseBody
public ZDResponse enterpriseTableAnalysis(StatisticalVo statisticalVo){
List<StatisticalVo> statisticalVos = statisticalService.enterpriseTableAnalysis(statisticalVo);
return ZDResponse.success("查询成功", statisticalVos);
}
} }

28
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/StatisticalVo.java

@ -52,6 +52,34 @@ public class StatisticalVo extends BaseDomain {
/** 月 */ /** 月 */
private String month; private String month;
private String name;
private String value;
private String date;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getQorm() { public String getQorm() {
return qorm; return qorm;
} }

3
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalMapper.java

@ -45,5 +45,8 @@ public interface StatisticalMapper {
List<StatisticalVo> caseAnalysis(StatisticalVo statisticalVo); List<StatisticalVo> caseAnalysis(StatisticalVo statisticalVo);
List<StatisticalVo> enforcerAnalysis(StatisticalVo statisticalVo); List<StatisticalVo> enforcerAnalysis(StatisticalVo statisticalVo);
List<StatisticalVo> itemAnalysis(StatisticalVo statisticalVo);
List<StatisticalVo> enterpriseAnalysis(StatisticalVo statisticalVo); List<StatisticalVo> enterpriseAnalysis(StatisticalVo statisticalVo);
List<StatisticalVo> enterpriseSortAnalysis(StatisticalVo statisticalVo);
List<StatisticalVo> enterpriseTableAnalysis(StatisticalVo statisticalVo);
} }

6
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/StatisticalService.java

@ -25,7 +25,13 @@ public interface StatisticalService {
List<StatisticalVo> caseAnalysis(StatisticalVo statisticalVo); List<StatisticalVo> caseAnalysis(StatisticalVo statisticalVo);
/** 统计执法人员案件数量 */ /** 统计执法人员案件数量 */
List<StatisticalVo> enforcerAnalysis(StatisticalVo statisticalVo); List<StatisticalVo> enforcerAnalysis(StatisticalVo statisticalVo);
/** 统计案件中的检查事项 */
List<StatisticalVo> itemAnalysis(StatisticalVo statisticalVo);
/** 统计案件中的企业类型 */ /** 统计案件中的企业类型 */
List<StatisticalVo> enterpriseAnalysis(StatisticalVo statisticalVo); List<StatisticalVo> enterpriseAnalysis(StatisticalVo statisticalVo);
/** 统计案件中的企业每日案件数排序 */
Map<String, Object> enterpriseSortAnalysis(StatisticalVo statisticalVo);
/** 统计案件中的企业每日案件数表格 */
List<StatisticalVo> enterpriseTableAnalysis(StatisticalVo statisticalVo);
} }

36
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalServiceImpl.java

@ -6,13 +6,11 @@ import com.zdxt.code.mapper.LinkageDictMapper;
import com.zdxt.code.mapper.StatisticalMapper; import com.zdxt.code.mapper.StatisticalMapper;
import com.zdxt.code.service.StatisticalService; import com.zdxt.code.service.StatisticalService;
import com.zdxt.common.annotation.DataScope; import com.zdxt.common.annotation.DataScope;
import org.apache.commons.collections.map.HashedMap;
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 java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service @Service
public class StatisticalServiceImpl implements StatisticalService public class StatisticalServiceImpl implements StatisticalService
@ -72,6 +70,13 @@ public class StatisticalServiceImpl implements StatisticalService
return statisticalVos; return statisticalVos;
} }
@Override
public List<StatisticalVo> itemAnalysis(StatisticalVo statisticalVo) {
this.putParams(statisticalVo);
List<StatisticalVo> statisticalVos = statisticalMapper.itemAnalysis(statisticalVo);
return statisticalVos;
}
@Override @Override
public List<StatisticalVo> enterpriseAnalysis(StatisticalVo statisticalVo) { public List<StatisticalVo> enterpriseAnalysis(StatisticalVo statisticalVo) {
this.putParams(statisticalVo); this.putParams(statisticalVo);
@ -79,6 +84,29 @@ public class StatisticalServiceImpl implements StatisticalService
return statisticalVos; return statisticalVos;
} }
@Override
public Map<String, Object> enterpriseSortAnalysis(StatisticalVo statisticalVo) {
this.putParams(statisticalVo);
List<StatisticalVo> statisticalVos = statisticalMapper.enterpriseSortAnalysis(statisticalVo);
Map<String, Object> res = new HashedMap();
List<String> dates = new ArrayList<>();
List<Integer> nums = new ArrayList<>();
for (StatisticalVo vo : statisticalVos) {
dates.add(vo.getDate());
nums.add(vo.getTotal());
}
res.put("dates", dates);
res.put("nums", nums);
return res;
}
@Override
public List<StatisticalVo> enterpriseTableAnalysis(StatisticalVo statisticalVo) {
this.putParams(statisticalVo);
List<StatisticalVo> statisticalVos = statisticalMapper.enterpriseTableAnalysis(statisticalVo);
return statisticalVos;
}
private void putParams(StatisticalVo statisticalVo) { private void putParams(StatisticalVo statisticalVo) {
Map<String, Object> params = statisticalVo.getParams(); Map<String, Object> params = statisticalVo.getParams();
if ("q".equals(statisticalVo.getQorm())) { if ("q".equals(statisticalVo.getQorm())) {

4
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml

@ -46,12 +46,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and DATE_FORMAT(create_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m') and DATE_FORMAT(create_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')
</if> </if>
<if test="dateType != null and dateType == 2"> <if test="dateType != null and dateType == 2">
AND DATE_FORMAT(enforcement_time, '%Y-%m') >= CONCAT(YEAR(CURDATE()), '-', AND DATE_FORMAT(enforcement_time, '%Y-%m') &gt;= CONCAT(YEAR(CURDATE()), '-',
CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01' CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01'
WHEN QUARTER(CURDATE()) IN (2) THEN '04' WHEN QUARTER(CURDATE()) IN (2) THEN '04'
WHEN QUARTER(CURDATE()) IN (3) THEN '07' WHEN QUARTER(CURDATE()) IN (3) THEN '07'
ELSE '10' END) ELSE '10' END)
and DATE_FORMAT(enforcement_time, '%Y-%m') <= CONCAT(YEAR(CURDATE()), '-', and DATE_FORMAT(enforcement_time, '%Y-%m') &lt;= CONCAT(YEAR(CURDATE()), '-',
CASE CASE
WHEN QUARTER(CURDATE()) IN (1) THEN '03' WHEN QUARTER(CURDATE()) IN (1) THEN '03'
WHEN QUARTER(CURDATE()) IN (2) THEN '06' WHEN QUARTER(CURDATE()) IN (2) THEN '06'

4
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml

@ -86,12 +86,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and DATE_FORMAT(enforcement_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m') and DATE_FORMAT(enforcement_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')
</if> </if>
<if test="dateType != null and dateType == 2"> <if test="dateType != null and dateType == 2">
AND DATE_FORMAT(enforcement_time, '%Y-%m') >= CONCAT(YEAR(CURDATE()), '-', AND DATE_FORMAT(enforcement_time, '%Y-%m') &gt;= CONCAT(YEAR(CURDATE()), '-',
CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01' CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01'
WHEN QUARTER(CURDATE()) IN (2) THEN '04' WHEN QUARTER(CURDATE()) IN (2) THEN '04'
WHEN QUARTER(CURDATE()) IN (3) THEN '07' WHEN QUARTER(CURDATE()) IN (3) THEN '07'
ELSE '10' END) ELSE '10' END)
and DATE_FORMAT(enforcement_time, '%Y-%m') <= CONCAT(YEAR(CURDATE()), '-', and DATE_FORMAT(enforcement_time, '%Y-%m') &lt;= CONCAT(YEAR(CURDATE()), '-',
CASE CASE
WHEN QUARTER(CURDATE()) IN (1) THEN '03' WHEN QUARTER(CURDATE()) IN (1) THEN '03'
WHEN QUARTER(CURDATE()) IN (2) THEN '06' WHEN QUARTER(CURDATE()) IN (2) THEN '06'

4
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseLawEnforcementMapper.xml

@ -72,12 +72,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and DATE_FORMAT(check_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m') and DATE_FORMAT(check_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')
</if> </if>
<if test="dateType != null and dateType == 2"> <if test="dateType != null and dateType == 2">
AND DATE_FORMAT(enforcement_time, '%Y-%m') >= CONCAT(YEAR(CURDATE()), '-', AND DATE_FORMAT(enforcement_time, '%Y-%m') &gt;= CONCAT(YEAR(CURDATE()), '-',
CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01' CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01'
WHEN QUARTER(CURDATE()) IN (2) THEN '04' WHEN QUARTER(CURDATE()) IN (2) THEN '04'
WHEN QUARTER(CURDATE()) IN (3) THEN '07' WHEN QUARTER(CURDATE()) IN (3) THEN '07'
ELSE '10' END) ELSE '10' END)
and DATE_FORMAT(enforcement_time, '%Y-%m') <= CONCAT(YEAR(CURDATE()), '-', and DATE_FORMAT(enforcement_time, '%Y-%m') &lt;= CONCAT(YEAR(CURDATE()), '-',
CASE CASE
WHEN QUARTER(CURDATE()) IN (1) THEN '03' WHEN QUARTER(CURDATE()) IN (1) THEN '03'
WHEN QUARTER(CURDATE()) IN (2) THEN '06' WHEN QUARTER(CURDATE()) IN (2) THEN '06'

70
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalMapper.xml

@ -15,6 +15,9 @@
<result property="enterpriseType" column="enterprise_type" /> <result property="enterpriseType" column="enterprise_type" />
<result property="lawEnforcer" column="law_enforcer" /> <result property="lawEnforcer" column="law_enforcer" />
<result property="complaintCount" column="complaint_count" /> <result property="complaintCount" column="complaint_count" />
<result property="name" column="name" />
<result property="value" column="value" />
<result property="date" column="date" />
</resultMap> </resultMap>
@ -117,13 +120,13 @@
select law_enforcement,count(1) as total from enforcement_registration select law_enforcement,count(1) as total from enforcement_registration
<where> <where>
<if test="params.startDate != null and params.startDate != ''"> <if test="params.startDate != null and params.startDate != ''">
AND DATE_FORMAT(create_time, '%Y-%m') &gt;= #{params.startDate} AND DATE_FORMAT(enforcement_time, '%Y-%m') &gt;= #{params.startDate}
</if> </if>
<if test="params.endDate != null and params.endDate != ''"> <if test="params.endDate != null and params.endDate != ''">
AND DATE_FORMAT(create_time, '%Y-%m') &lt;= #{params.endDate} AND DATE_FORMAT(enforcement_time, '%Y-%m') &lt;= #{params.endDate}
</if> </if>
<if test="params.yearMonth != null and params.yearMonth != ''"> <if test="params.yearMonth != null and params.yearMonth != ''">
AND DATE_FORMAT(create_time, '%Y-%m') = #{params.yearMonth} AND DATE_FORMAT(enforcement_time, '%Y-%m') = #{params.yearMonth}
</if> </if>
</where> </where>
GROUP BY law_enforcement_id GROUP BY law_enforcement_id
@ -133,34 +136,83 @@
select law_enforcer,count(1) as total from enforcement_registration select law_enforcer,count(1) as total from enforcement_registration
<where> <where>
<if test="params.startDate != null and params.startDate != ''"> <if test="params.startDate != null and params.startDate != ''">
AND DATE_FORMAT(create_time, '%Y-%m') &gt;= #{params.startDate} AND DATE_FORMAT(enforcement_time, '%Y-%m') &gt;= #{params.startDate}
</if> </if>
<if test="params.endDate != null and params.endDate != ''"> <if test="params.endDate != null and params.endDate != ''">
AND DATE_FORMAT(create_time, '%Y-%m') &lt;= #{params.endDate} AND DATE_FORMAT(enforcement_time, '%Y-%m') &lt;= #{params.endDate}
</if> </if>
<if test="params.yearMonth != null and params.yearMonth != ''"> <if test="params.yearMonth != null and params.yearMonth != ''">
AND DATE_FORMAT(create_time, '%Y-%m') = #{params.yearMonth} AND DATE_FORMAT(enforcement_time, '%Y-%m') = #{params.yearMonth}
</if> </if>
</where> </where>
GROUP BY law_enforcer_id GROUP BY law_enforcer_id
</select> </select>
<select id="itemAnalysis" parameterType="StatisticalVo" resultMap="StatisticalVoResult">
SELECT d.title as law_enforcement, count(1) as total FROM enforcement_registration r
LEFT JOIN linkage_dict d
ON d.id = r.law_enforcement_item
WHERE r.law_enforcement_item is not null
<if test="params.startDate != null and params.startDate != ''">
AND DATE_FORMAT(r.enforcement_time, '%Y-%m') &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
AND DATE_FORMAT(r.enforcement_time, '%Y-%m') &lt;= #{params.endDate}
</if>
<if test="params.yearMonth != null and params.yearMonth != ''">
AND DATE_FORMAT(r.enforcement_time, '%Y-%m') = #{params.yearMonth}
</if>
GROUP BY d.id
</select>
<select id="enterpriseAnalysis" parameterType="StatisticalVo" resultMap="StatisticalVoResult"> <select id="enterpriseAnalysis" parameterType="StatisticalVo" resultMap="StatisticalVoResult">
SELECT i.company_org_type as law_enforcement, count(1) as total FROM enforcement_registration r SELECT i.company_org_type as law_enforcement, count(1) as total FROM enforcement_registration r
LEFT JOIN enterprise_information i LEFT JOIN enterprise_information i
ON i.enterprise_number = r.enterprise_number ON i.enterprise_number = r.enterprise_number
<where> <where>
<if test="params.startDate != null and params.startDate != ''"> <if test="params.startDate != null and params.startDate != ''">
AND DATE_FORMAT(r.create_time, '%Y-%m') &gt;= #{params.startDate} AND DATE_FORMAT(r.enforcement_time, '%Y-%m') &gt;= #{params.startDate}
</if> </if>
<if test="params.endDate != null and params.endDate != ''"> <if test="params.endDate != null and params.endDate != ''">
AND DATE_FORMAT(r.create_time, '%Y-%m') &lt;= #{params.endDate} AND DATE_FORMAT(r.enforcement_time, '%Y-%m') &lt;= #{params.endDate}
</if> </if>
<if test="params.yearMonth != null and params.yearMonth != ''"> <if test="params.yearMonth != null and params.yearMonth != ''">
AND DATE_FORMAT(r.create_time, '%Y-%m') = #{params.yearMonth} AND DATE_FORMAT(r.enforcement_time, '%Y-%m') = #{params.yearMonth}
</if> </if>
</where> </where>
GROUP BY i.company_org_type GROUP BY i.company_org_type
</select> </select>
<select id="enterpriseSortAnalysis" parameterType="StatisticalVo" resultMap="StatisticalVoResult">
select DATE_FORMAT(enforcement_time, '%Y-%m-%d') as `date`,count(1) as total from enforcement_registration
<where>
<if test="params.startDate != null and params.startDate != ''">
AND DATE_FORMAT(enforcement_time, '%Y-%m') &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
AND DATE_FORMAT(enforcement_time, '%Y-%m') &lt;= #{params.endDate}
</if>
<if test="params.yearMonth != null and params.yearMonth != ''">
AND DATE_FORMAT(enforcement_time, '%Y-%m') = #{params.yearMonth}
</if>
</where>
GROUP BY DATE_FORMAT(enforcement_time, '%Y-%m-%d') ORDER BY enforcement_time ASC
</select>
<select id="enterpriseTableAnalysis" parameterType="StatisticalVo" resultMap="StatisticalVoResult">
select enterprise_name as name,count(1) as total, DATE_FORMAT(enforcement_time, '%Y-%m-%d') as `date` from enforcement_registration
<where>
<if test="params.startDate != null and params.startDate != ''">
AND DATE_FORMAT(enforcement_time, '%Y-%m') &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
AND DATE_FORMAT(enforcement_time, '%Y-%m') &lt;= #{params.endDate}
</if>
<if test="params.yearMonth != null and params.yearMonth != ''">
AND DATE_FORMAT(enforcement_time, '%Y-%m') = #{params.yearMonth}
</if>
</where>
GROUP BY DATE_FORMAT(enforcement_time, '%Y-%m-%d'), enterprise_number
</select>
</mapper> </mapper>
Loading…
Cancel
Save