Browse Source

综合分析初版提交

v6
蟑螂恶霸 2 years ago
parent
commit
85d46c994b
  1. 7
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/css/font-awesome.css.map
  2. 4
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/css/font-awesome.min.css
  3. BIN
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/fonts/FontAwesome.otf
  4. BIN
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/fonts/fontawesome-webfont.eot
  5. 2671
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/fonts/fontawesome-webfont.svg
  6. BIN
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/fonts/fontawesome-webfont.ttf
  7. BIN
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/fonts/fontawesome-webfont.woff
  8. BIN
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/fonts/fontawesome-webfont.woff2
  9. BIN
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/bg_analy_card.jpg
  10. BIN
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/bg_analy_card_2.jpg
  11. BIN
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/bg_body.jpg
  12. BIN
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/bg_data_item.jpg
  13. BIN
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/icon_com.png
  14. BIN
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/icon_doing.png
  15. BIN
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/icon_done.png
  16. BIN
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/icon_rev.png
  17. BIN
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/icon_scr.png
  18. 1186
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/scripts/charts-analyov.js
  19. 45
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/scripts/echarts.min.js
  20. 2
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/scripts/jquery-3.3.1.min.js
  21. 489
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/styles/analysis.css
  22. 227
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/overall-analysis.html
  23. 569
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html
  24. 45
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalPanelController.java
  25. 75
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/SixAnalysis.java
  26. 140
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/SixAnalysisParams.java
  27. 60
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalPanelMapper.java
  28. 16
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/StatisticalPaneService.java
  29. 250
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java
  30. 658
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml

7
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/css/font-awesome.css.map

File diff suppressed because one or more lines are too long

4
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/css/font-awesome.min.css

File diff suppressed because one or more lines are too long

BIN
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/fonts/FontAwesome.otf

Binary file not shown.

BIN
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/fonts/fontawesome-webfont.eot

Binary file not shown.

2671
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/fonts/fontawesome-webfont.svg

File diff suppressed because it is too large

After

Width:  |  Height:  |  Size: 434 KiB

BIN
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/fonts/fontawesome-webfont.ttf

Binary file not shown.

BIN
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/fonts/fontawesome-webfont.woff

Binary file not shown.

BIN
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/font-awesome/fonts/fontawesome-webfont.woff2

Binary file not shown.

BIN
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/bg_analy_card.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/bg_analy_card_2.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/bg_body.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/bg_data_item.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/icon_com.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/icon_doing.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/icon_done.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/icon_rev.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/images/icon_scr.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

1186
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/scripts/charts-analyov.js

File diff suppressed because it is too large

45
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/scripts/echarts.min.js

File diff suppressed because one or more lines are too long

2
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/scripts/jquery-3.3.1.min.js

File diff suppressed because one or more lines are too long

489
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/styles/analysis.css

@ -0,0 +1,489 @@
@charset "utf-8";
/* CSS Document */
* {
margin: 0;
padding: 0;
font-family: 'Microsoft Yahei', Arial, Verdana, sans-serif;
}
html {
width: 100%;
height: 100%;
overflow: hidden;
}
body {
height: 100%;
width: 100%;
color: #4c4c4c;
font-size: 14px;
}
.wrap_all {
width: 100%;
height: 100%;
background: url(../images/bg_body.jpg) no-repeat;
background-size: cover;
box-sizing: border-box;
overflow: hidden;
}
.select_set {
display: flex;
margin: 0.5% 0.5% 0.6%;
padding-left: 30px;
background: url(../images/icon_scr.png) no-repeat left;
background-size: auto 100%;
}
.select_item {
margin: 0 0 0 5px;
font-size: 1.2rem;
white-space: nowrap;
}
.select_item > label {
position: relative;
display: inline-block;
margin: 0 5px 0 0;
padding: 0 25px 0 10px;
height: 28px;
line-height: 28px;
color: #315EFB;
font-weight: 500;
background: rgba(59, 145, 253, 0.12);
letter-spacing: 0;
text-align: center;
border-radius: 6px;
cursor: pointer;
}
.select_item > label > a {
display: inline-block;
position: absolute;
right: 0;
width: 18px;
height: 100%;
}
.select_item > label > a::after {
position: absolute;
right: 0;
width: 18px;
height: 18px;
content: "\f105";
color: #678dfe;
font-family: "FontAwesome";
font-size: 16px;
}
.select_item > label.active > a::after {
position: absolute;
top: 0.45rem;
right: -0.2rem;
transform: rotate(90deg);
}
.fold_cont {
display: none;
position: absolute;
top: 3rem;
left: 2%;
z-index: 100;
padding: 0.5rem 1rem 1rem 0.5rem;
min-width: 10rem;
background: rgba(255, 255, 255, .9);
border-radius: 0.5rem;
box-shadow: 0 0 0.5rem #b1c9d7;
}
.fold_cont dd {
position: relative;
padding: 0 0 0 2rem;
font-size: 1.0rem;
line-height: 2;
}
.fold_cont dd::before {
position: absolute;
top: 0;
left: 0.5rem;
width: 1.5rem;
content: "\f096";
color: rgba(0, 0, 0, .4);
font-size: 1.1rem;
font-family: "FontAwesome";
}
.fold_cont dd.selchk::before {
content: "\f046";
color: #315efb;
}
.data_cont {
display: flex;
margin: 0.5%;
width: calc(99% - 2px);
border-radius: 10px;
box-shadow: 0 0 10px #ddd;
background: #fff url(../images/bg_data_item.jpg) no-repeat;
border: 1px solid rgba(126, 195, 241, .8);
}
.data_item {
position: relative;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: space-around;
margin: 0.5% 1.5%;
width: 22%;
height: 100%;
}
.data_item::after {
position: absolute;
top: 0;
right: 0;
content: "";
width: 1px;
height: 90%;
background: linear-gradient(to bottom,transparent 15%, #e1dede 50%, transparent 100%);
}
.data_item:last-child::after {
background: none;
}
.cont-title {
margin: 2% 0;
color: #666;
font-size: 0.9rem;
font-weight: 550;
white-space: nowrap;
}
.panel-card-bottom .cont-title {
margin: 2% 0;
color: #333;
font-size: 1.6rem;
font-weight: 550;
}
.cont-total {
display: flex;
align-items: center;
margin: 0 0 1%;
color: #999;
font-size: 1.25rem;
}
.cont-total b {
margin-right: 1rem;
color: #ff8400;
font-size: 2.5rem;
font-weight: 500;
line-height: 1.5;
}
.percent-tag {
display: flex;
align-items: center;
margin: 1% 3% 0 0;
white-space: nowrap;
}
.percent-tag span {
margin: 0;
color: #333;
font-size: 1.0rem;
line-height: 1;
}
.percent-tag span.data-rise, .percent-tag span.data-fall {
margin: 0.75% 2% 1% 0.5%;
color: #67dc53;
font-size: 1.0rem;
}
.percent-tag span.data-fall {
color: #fd7c7c;
}
.percent-tag label {
margin: 0 2% 0 1%;
color: #999;
font-size: 0.75rem;
}
.nece-data .percent-tag span {
margin: 0 0 0 5%;
color: #4767fe;
font-size: 1.25rem;
font-weight: 500;
line-height: 1.25;
}
.echarts_box {
position: relative;
width: 100%;
height: calc(85% - 3.75rem);
overflow: hidden;
}
.inner {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin-bottom: 2%;
height: 98%;
overflow-x: hidden;
overflow-y: scroll;
}
.onebox {
flex-wrap: wrap;
margin: 0.5% 0.5% 0.5%;
padding: 0.75% 1% 0.25%;
width: 99%;
height: 18rem;
background: #fff none;
border: 0;
box-sizing: border-box;
}
.twobox {
margin: 0.25% 0.5% 0;
padding: 0;
width: 99%;
min-height: 18rem;
border: 0;
box-sizing: border-box;
}
.echarts_mult {
display: flex;
flex-wrap: wrap;
margin: 0.75% 0.5% 1%;
padding-bottom: 5rem;
width: 99%;
height: calc(100% - 25rem);
}
.chart_div {
float: left;
margin: 0 0 1% 1%;
width: 32.25%;
height: 32.25%;
}
.chart_tit {
width: 100%;
height: 1.5rem;
font-size: 1.0rem;
line-height: 1.5;
}
.chart_box {
margin: 0 1%;
width: 98%;
height: calc(100% - 2rem);
}
.threebox {
position: relative;
flex-wrap: wrap;
float: left;
margin: 0.5% 1.23% 0.85% 0;
padding: 0.75% 1% 0.25%;
width: 32.51%;
height: 18rem;
background: #fff none;
border: 0;
box-sizing: border-box;
}
.threebox:nth-child(3n) {
margin-right: 0;
}
.twobox .threebox {
height: 25rem;
}
.twobox .threebox:last-child {
margin-right: 0;
width: 66.25%;
}
.sel_rank {
position: absolute;
right: 20px;
}
.sel_rank select {
height: 26px;
border: 1px solid #ccc;
border-radius: 3px;
}
.count_wrap {
display: flex;
flex-wrap: wrap;
width: 100%;
}
.count_item {
float: left;
position: relative;
margin: 0 1% 1.5% 1.5%;
width: 30.5%;
height: 10rem;
background: url(../images/bg_analy_card.jpg) no-repeat;
background-size: cover;
border-radius: 10px;
font-size: 1rem;
text-align: center;
}
.count_item label {
display: inline-flex;
margin: 5.5% 5% 5%;
width: 90%;
color: #666;
font-size: 0.9rem;
text-align: left;
}
.number_count {
display: block;
color: #4767fe;
font-size: 2.15rem;
font-weight: 500;
line-height: 2;
}
.number_percent {
color: #666;
font-size: 1rem;
}
.number_percent > i {
margin-left: 2%;
color: #999;
font-size: 0.8rem;
}
.com_cate {
float: right;
margin: -2rem 0 0 1%;
width: 45%;
}
.com_cate h3.chart_tit {
margin-bottom: 0.5rem;
}
.com_cate .number_count {
color: #f73b3b;
}
.com_cate .count_item {
background: url(../images/bg_analy_card_2.jpg) no-repeat;
background-size: cover;
}
.count_review {
float: left;
width: 54%;
height: 90%;
}
.count_com {
display: flex;
align-items: center;
width: 100%;
}
.count_com h4 {
padding-top: 6.75rem;
width: 35%;
height: 10rem;
background: url(../images/icon_com.png) no-repeat center;
background-size: auto 100%;
box-sizing: border-box;
text-align: center;
}
.count_list {
width: 75%;
}
.count_row {
display: flex;
justify-content: space-around;
margin: 3% 3%;
font-size: 1rem;
}
.count_row span {
width: 30%;
font-weight: 550;
}
.count_row span:nth-child(1) {
width: 40%;
font-weight: 500;
}
.count_rev {
margin-top: 2%;
}
.count_rev h4 {
background: url(../images/icon_rev.png) no-repeat center;
background-size: auto 100%;
}
/** 滚动条样式 **/
::-webkit-scrollbar-track {
background-color: #F5F5F5;
}
::-webkit-scrollbar {
width: 6px;
height: 10px;
background-color: #F5F5F5;
}
::-webkit-scrollbar-thumb {
border-radius: 6px;
background-color: #ccc;
}

227
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/overall-analysis.html

@ -0,0 +1,227 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>综合分析--执法监督码执法监督</title>
<link type="text/css" rel="stylesheet" href="/statistical/font-awesome/css/font-awesome.min.css" />
<link type="text/css" rel="stylesheet" href="/statistical/styles/analysis.css" />
<script type="text/javascript" src="/statistical/scripts/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/statistical/scripts/echarts.min.js"></script>
</head>
<body>
<div class="wrap_all">
<div class="select_set">
<div class="select_item">
<label class="select_area">深圳市<a></a></label>
<dl class="fold_cont">
<dd class="check_label" onclick="">深圳市</dd>
<dd class="check_label" onclick="">福田区</dd>
<dd class="check_label" onclick="">罗湖区</dd>
<dd class="check_label" onclick="">南山区</dd>
<dd class="check_label" onclick="">盐田区</dd>
<dd class="check_label" onclick="">宝安区</dd>
<dd class="check_label" onclick="">龙岗区</dd>
<dd class="check_label" onclick="">龙华区</dd>
<dd class="check_label" onclick="">坪山区</dd>
<dd class="check_label" onclick="">光明区</dd>
<dd class="check_label" onclick="">大鹏新区</dd>
<dd class="check_label" onclick="">深汕特别合作区</dd>
</dl>
</div>
<div class="select_item">
<label class="select_unit">全市<a></a></label>
</div>
<div class="select_item">
<label class="select_time">2025年第1季度<a></a></label>
<span>综合数据</span></div>
</div>
<div class="data_cont" id = "sixIndicators"></div>
<div class="echarts_box">
<div class="inner">
<div class="data_cont onebox">
<h3 class="chart_tit">各区综合数据</h3>
<div class="chart_box" id="countDistrict" style="top: -8%;"></div>
</div>
<div class="echarts_mult">
<div class="data_cont threebox">
<h3 class="chart_tit">检查类别数量及占比</h3>
<div class="chart_box" id="countInspect"></div>
</div>
<div class="data_cont threebox">
<h3 class="chart_tit">企业类别数量及占比</h3>
<div class="chart_box" id="countCommpany"></div>
</div>
<div class="data_cont threebox">
<h3 class="chart_tit">投诉类别数量及占比</h3>
<div class="chart_box" id="countComplaint"></div>
</div>
<div class="data_cont threebox">
<h3 class="chart_tit">被检查企业次数排行</h3>
<span class="sel_rank">
<select name="">
<option>TOP 10</option>
<option>TOP 5</option>
<option>TOP 20</option>
<option>TOP 30</option>
</select>
</span>
<div class="chart_box" id="rankCommpany"></div>
</div>
<div class="data_cont threebox">
<h3 class="chart_tit">被投诉单位排行</h3>
<span class="sel_rank">
<select name="">
<option>TOP 10</option>
<option>TOP 5</option>
<option>TOP 20</option>
<option>TOP 30</option>
</select>
</span>
<div class="chart_box" id="rankComplaint"></div>
</div>
<div class="data_cont threebox">
<h3 class="chart_tit">执法检查数量排行</h3>
<span class="sel_rank">
<select name="">
<option>TOP 10</option>
<option>TOP 5</option>
<option>TOP 20</option>
<option>TOP 30</option>
</select>
</span>
<div class="chart_box" id="rankInspect"></div>
</div>
<div class="data_cont threebox">
<h3 class="chart_tit">职权使用率排行</h3>
<span class="sel_rank">
<select name="">
<option>TOP 10</option>
<option>TOP 5</option>
<option>TOP 20</option>
<option>TOP 30</option>
</select>
</span>
<div class="chart_box" id="powerUse"></div>
</div>
<div class="data_cont threebox">
<h3 class="chart_tit">职权休眠率排行</h3>
<span class="sel_rank">
<select name="">
<option>TOP 10</option>
<option>TOP 5</option>
<option>TOP 20</option>
<option>TOP 30</option>
</select>
</span>
<div class="chart_box" id="powerSleep"></div>
</div>
<div class="data_cont threebox">
<h3 class="chart_tit">职权使用次数排行</h3>
<span class="sel_rank">
<select name="">
<option>TOP 10</option>
<option>TOP 5</option>
<option>TOP 20</option>
<option>TOP 30</option>
</select>
</span>
<div class="chart_box" id="powerNumber"></div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="/statistical/scripts/charts-analyov.js"></script>
<script>
var ctx="/"
$(function(){
sixIndicators();
});
function sixIndicators() {
$.ajax({
url: ctx + "code/statisticalPanel/sixIndicators",
type: "get",
data: {dateType: "year", year:"2025"},
success: function(res) {
if(res.success) {
const indicators = res.data;
html = "";
for(var i=0; i < indicators.length; i++) {
var indicator = indicators[i];
html += '<div class="data_item">';
html += ' <div class="cont-title">'+indicator.title+'</div>';
html += ' <div class="cont-total"><b><span id="regis-total">'+indicator.num+'</span></b>';
html += ' <div class="nece-data">';
html += ' <div class="percent-tag">';
html += ' <label id="">昨日</label>';
html += ' <span class="data-change" id="">'+indicator.yesterday_num+'</span>'
html += ' </div>';
html += ' <div class="percent-tag">';
html += ' <label id="">本月</label>';
html += ' <span class="data-change" id="">'+indicator.current_month_num+'</span>'
html += ' </div>';
html += ' </div>';
html += ' </div>';
html += ' <div class="percent-tag">';
html += ' <label id="">同比</label>';
html += ' <span class="data-rise" id=""><i class="fa fa fa-long-arrow-up"></i></span>';
html += ' <span class="data-fall" id="" style="display: none;"><i class="fa fa fa-long-arrow-down"></i></span>';
html += ' <span class="data-change" id="">'+indicator.yoy+'%</span>';
html += ' </div>'
html += ' <div class="percent-tag">';
html += ' <label id="">环比</label>';
html += ' <span class="data-rise" id="" style="display: none;"><i class="fa fa fa-long-arrow-up"></i></span>';
html += ' <span class="data-fall" id=""><i class="fa fa fa-long-arrow-down"></i></span>';
html += ' <span class="data-change" id="">'+indicator.ring_ratio+'%</span>';
html += ' </div>';
html += '</div>';
}
console.log(html.length);
$("#sixIndicators").html(html);
}
},
error: function (error) {
$.modal.alertWarning("获取分析数据失败。");
}
});
}
$('.fold_cont dd:first').addClass('selchk');//给第一个dd追加
//each遍历元素
$(".fold_cont dd").each(function () {
$(this).click(function () { //点击事件
//当点击自身的时候添加,及删除同级的
$(this).addClass('selchk').siblings().removeClass('selchk')
})
});
/**********数据子项折叠************/
$(".select_item > label").each(function (i) {
var ame = $(this);
ame.attr("flag", "1");
ame.on("click", {idx: i, a: ame}, function (e) {
var aobj = e.data.a;
var aflag = aobj.attr("flag");
var foldCoutArray = $(".fold_cont");
foldCoutArray.hide();
if (aflag == "1") {
foldCoutArray.eq(e.data.idx).show();
aobj.attr("flag", "0");
$(this).addClass("active")
} else {
aobj.attr("flag", "1");
$(this).removeClass("active")
}
})
});
</script>
</body>
</html>

569
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html

@ -0,0 +1,569 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>单一主体综合分析--执法监督码执法监督</title>
<link type="text/css" rel="stylesheet" href="/statistical/font-awesome/css/font-awesome.min.css" />
<link type="text/css" rel="stylesheet" href="/statistical/styles/analysis.css" />
<script type="text/javascript" src="/statistical/scripts/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/statistical/scripts/echarts.min.js"></script>
</head>
<body>
<div class="wrap_all">
<div class="select_set">
<div class="select_item">
<label class="select_area">深圳市司法局<a></a></label>
<dl class="fold_cont">
<dd class="check_label" onclick="">深圳市司法局</dd>
<dd class="check_label" onclick="">深圳市发展和改革委员会</dd>
<dd class="check_label" onclick="">深圳市教育局</dd>
<dd class="check_label" onclick="">深圳市科技创新局</dd>
<dd class="check_label" onclick="">深圳市工业和信息化局</dd>
<dd class="check_label" onclick="">深圳市公安局</dd>
<dd class="check_label" onclick="">深圳市民政局</dd>
<dd class="check_label" onclick="">深圳市财政局</dd>
<dd class="check_label" onclick="">深圳市人力资源和社会保障局</dd>
<dd class="check_label" onclick="">深圳市规划和自然资源局</dd>
</dl>
</div>
<div class="select_item">
<label class="select_time">2025年第1季度<a></a></label>
<span>综合数据</span></div>
</div>
<div class="data_cont" id = "sixIndicators"></div>
<div class="echarts_box">
<div class="inner">
<div class="twobox">
<div class="data_cont threebox">
<h3 class="chart_tit">行政检查类别及占比</h3>
<div class="count_wrap">
<div class="count_item">
<label>日常检查</label>
<span class="number_count">1024</span><span class="number_percent">42.68%</span></div>
<div class="count_item">
<label>上级交办</label>
<span class="number_count">1024</span><span class="number_percent">42.68%</span></div>
<div class="count_item">
<label>其他机关移送</label>
<span class="number_count">1024</span><span class="number_percent">42.68%</span></div>
<div class="count_item">
<label>重点领域治理</label>
<span class="number_count">1024</span><span class="number_percent">42.68%</span></div>
<div class="count_item">
<label>投诉举报</label>
<span class="number_count">1024</span><span class="number_percent">42.68%</span></div>
<div class="count_item">
<label>其他</label>
<span class="number_count">1024</span><span class="number_percent">42.68%</span></div>
</div>
</div>
<div class="data_cont threebox">
<h3 class="chart_tit">行政检查投诉评议</h3>
<div class="count_review">
<div class="count_com">
<h4>投诉</h4>
<div class="count_list">
<div class="count_row"><span>投诉率</span><span>135</span><span>1.35%</span></div>
<div class="count_row"><span>投诉处理率</span><span>135</span><span>1.35%</span></div>
<div class="count_row"><span>已办结</span><span>135</span><span>1.35%</span></div>
<div class="count_row"><span>未办结</span><span>135</span><span>1.35%</span></div>
</div>
</div>
<div class="count_com count_rev">
<h4>评议</h4>
<div class="count_list">
<div class="count_row"><span>满意</span><span>135</span><span>1.35%</span></div>
<div class="count_row"><span>较满意</span><span>135</span><span>1.35%</span></div>
<div class="count_row"><span>不满意</span><span>135</span><span>1.35%</span></div>
</div>
</div>
</div>
<div class="count_wrap com_cate">
<h3 class="chart_tit">行政执法投诉类别及占比</h3>
<div class="count_item">
<label>违法执法</label>
<span class="number_count">1024</span><span class="number_percent">42.68%</span></div>
<div class="count_item">
<label>违规执法</label>
<span class="number_count">1024</span><span class="number_percent">42.68%</span></div>
<div class="count_item">
<label>执法不文明</label>
<span class="number_count">1024</span><span class="number_percent">42.68%</span></div>
<div class="count_item">
<label>选择性执法</label>
<span class="number_count">1024</span><span class="number_percent">42.68%</span></div>
<div class="count_item">
<label>其他</label>
<span class="number_count">1024</span><span class="number_percent">42.68%</span></div>
<div class="count_item">
<label>入企不扫码</label>
<span class="number_count">1024</span><span class="number_percent">42.68%</span></div>
</div>
</div>
</div>
<div class="echarts_mult">
<div class="data_cont threebox">
<h3 class="chart_tit">职权使用次数排行</h3>
<span class="sel_rank">
<select name="">
<option>TOP 10</option>
<option>TOP 5</option>
<option>TOP 20</option>
<option>TOP 30</option>
</select>
</span>
<div class="chart_box" id="powerNumber"></div>
</div>
<div class="data_cont threebox">
<h3 class="chart_tit">职权被投诉次数排行</h3>
<span class="sel_rank">
<select name="">
<option>TOP 10</option>
<option>TOP 5</option>
<option>TOP 20</option>
<option>TOP 30</option>
</select>
</span>
<div class="chart_box" id="powerComplaint"></div>
</div>
<div class="data_cont threebox">
<h3 class="chart_tit">职权使用率</h3>
<div class="chart_box" id="powerUseRate"></div>
</div>
</div>
</div>
</div>
</div>
<script>
var ctx="/"
$(function(){
sixIndicators();
});
function sixIndicators() {
$.ajax({
url: ctx + "code/statisticalPanel/sixIndicators",
type: "get",
data: {dateType: "year", year:"2025"},
success: function(res) {
if(res.success) {
const indicators = res.data;
html = "";
for(var i=0; i < indicators.length; i++) {
var indicator = indicators[i];
html += '<div class="data_item">';
html += ' <div class="cont-title">'+indicator.title+'</div>';
html += ' <div class="cont-total"><b><span id="regis-total">'+indicator.num+'</span></b>';
html += ' <div class="nece-data">';
html += ' <div class="percent-tag">';
html += ' <label id="">昨日</label>';
html += ' <span class="data-change" id="">'+indicator.yesterday_num+'</span>'
html += ' </div>';
html += ' <div class="percent-tag">';
html += ' <label id="">本月</label>';
html += ' <span class="data-change" id="">'+indicator.current_month_num+'</span>'
html += ' </div>';
html += ' </div>';
html += ' </div>';
html += ' <div class="percent-tag">';
html += ' <label id="">同比</label>';
html += ' <span class="data-rise" id=""><i class="fa fa fa-long-arrow-up"></i></span>';
html += ' <span class="data-fall" id="" style="display: none;"><i class="fa fa fa-long-arrow-down"></i></span>';
html += ' <span class="data-change" id="">'+indicator.yoy+'%</span>';
html += ' </div>'
html += ' <div class="percent-tag">';
html += ' <label id="">环比</label>';
html += ' <span class="data-rise" id="" style="display: none;"><i class="fa fa fa-long-arrow-up"></i></span>';
html += ' <span class="data-fall" id=""><i class="fa fa fa-long-arrow-down"></i></span>';
html += ' <span class="data-change" id="">'+indicator.ring_ratio+'%</span>';
html += ' </div>';
html += '</div>';
}
console.log(html.length);
$("#sixIndicators").html(html);
}
},
error: function (error) {
$.modal.alertWarning("获取分析数据失败。");
}
});
}
$('.fold_cont dd:first').addClass('selchk');//给第一个dd追加
//each遍历元素
$(".fold_cont dd").each(function () {
$(this).click(function () { //点击事件
//当点击自身的时候添加,及删除同级的
$(this).addClass('selchk').siblings().removeClass('selchk')
})
});
/**********数据子项折叠************/
$(".select_item > label").each(function(i) {
var ame = $(this);
ame.attr("flag", "1");
ame.on("click", {idx: i, a: ame}, function(e) {
var aobj = e.data.a;
var aflag = aobj.attr("flag");
var foldCoutArray = $(".fold_cont");
foldCoutArray.hide();
if (aflag == "1") {
foldCoutArray.eq(e.data.idx).show();
aobj.attr("flag", "0");
$(this).addClass("active")
} else {
aobj.attr("flag", "1");
$(this).removeClass("active")
}
})
});
/*******职权使用次数排行***********/
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('powerNumber'));
// 指定图表的配置项和数据
var option = {
title : {
text: '',
subtext: ''
},
tooltip : {
trigger: 'axis'
},
grid: {
left: '0',
right: '0',
bottom: '5%',
top: '15%',
containLabel: true
},
toolbox: {
show : false,
feature : {
dataView : {show: true, readOnly: false},
magicType : {show: true, type: ['line', 'bar']},
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : true,
xAxis : [
{
type : 'category',
data : ['深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局'],
axisLine: {show: false},
axisTick: {show: false},
axisLabel: {
show: true,
interval: 0,
rotate: 30,
textStyle: {
color: '#999',
fontSize: 12,
}
},
}
],
yAxis : [
{
type : 'value',
splitLine: {
show: true,
lineStyle: {
color: 'transparent',
}
},
axisLine: {show: false},
axisTick: {show: false},
axisLabel: {
show: true,
textStyle: {
color: '#79a3ca',
fontSize: 12,
}
},
}
],
series : [
{
name:'职权使用次数',
type:'bar',
barWidth: '25%',
showBackground: true,
backgroundStyle: {
borderRadius: [10, 10, 0, 0]
},
data:[13, 12, 11, 9, 8, 7, 6, 5, 5, 4],
color:'#7ca9fb',
itemStyle: {
borderRadius: [10, 10, 0, 0]
}
},
]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
window.addEventListener("resize",function(){
myChart.resize();
});
/*******职权被投诉次数排行***********/
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('powerComplaint'));
// 指定图表的配置项和数据
var option = {
title : {
text: '',
subtext: ''
},
tooltip : {
trigger: 'axis'
},
grid: {
left: '0',
right: '0',
bottom: '5%',
top: '15%',
containLabel: true
},
toolbox: {
show : false,
feature : {
dataView : {show: true, readOnly: false},
magicType : {show: true, type: ['line', 'bar']},
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : true,
xAxis : [
{
type : 'category',
data : ['深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局'],
axisLine: {show: false},
axisTick: {show: false},
axisLabel: {
show: true,
interval: 0,
rotate: 30,
textStyle: {
color: '#999',
fontSize: 12,
}
},
}
],
yAxis : [
{
type : 'value',
splitLine: {
show: true,
lineStyle: {
color: 'transparent',
}
},
axisLine: {show: false},
axisTick: {show: false},
axisLabel: {
show: true,
textStyle: {
color: '#79a3ca',
fontSize: 12,
}
},
}
],
series : [
{
name:'职权被投诉次数',
type:'bar',
barWidth: '25%',
showBackground: true,
backgroundStyle: {
borderRadius: [10, 10, 0, 0]
},
data:[13, 12, 11, 9, 8, 7, 6, 5, 5, 4],
color:'#7ca9fb',
itemStyle: {
borderRadius: [10, 10, 0, 0]
}
},
]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
window.addEventListener("resize",function(){
myChart.resize();
});
//*****************职权使用率
$(function () {
xdnx();
function xdnx() {
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('powerUseRate'));
var xData = ['投诉率', '使用率']
var yData = ['25', '62']
var colorList = [ '#fc7d8f', '#4e97fe', '#fed100','#ababac']
var visualMapPiecesData = []
// visualMap: {
// pieces: [
// { value: 123, label: '123(自定义特殊颜色)', color: 'grey' }
// ]
// }
for (var i = 0; i < xData.length; i++) {
visualMapPiecesData.push({
value: yData[i],
label: xData[i],
color: colorList[i]
})
}
var option = {
title: {
text: ''
},
angleAxis: {
axisLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
show: false
},
splitLine: {
show: false
},
clockwise: true
},
radiusAxis: {
type: 'category',
data: xData,
z: 100,
//inverse: 'true',
axisLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
show: false
},
splitLine: {
show: false
}
},
polar: {
},
tooltip: {
trigger: 'item',
formatter: function (params, ticket, callback) {
return params.name + ' : ' + ' (' + params.data + '%)'
}
},
legend: {
bottom: 'center',
left: '1%',
itemGap: 20,
orient: 'vercital'
},
visualMap: {
top: 40,
x: 'left',
orient: 'vertical',
textStyle: {
color: '#000'
},
pieces: visualMapPiecesData,
outOfRange: {
color: '#999'
}
},
series: [{
type: 'bar',
data: yData,
//smooth: true,
roundCap: true,
coordinateSystem: 'polar',
barWidth: 20,
barGap: '60%',
itemStyle: {
normal: {
// 定制显示(按顺序)
color: function (params) {
return colorList[params.dataIndex]
}
},
emphasis: {
barBorderRadius: 8
},normal: {
barBorderRadius: 8,
},
}
}]
}
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
window.addEventListener("resize",function(){
myChart.resize();
});
}
});
</script>
</body>
</html>

45
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalPanelController.java

@ -1,5 +1,7 @@
package com.zdxt.code.controller;
import com.zdxt.code.domain.ComprehensiveAnalysis;
import com.zdxt.code.domain.SixAnalysisParams;
import com.zdxt.code.domain.StatisticsIndicatorPart;
import com.zdxt.code.domain.dto.StatisticalPanelDto;
import com.zdxt.code.service.StatisticalPaneService;
@ -7,11 +9,14 @@ import com.zdxt.common.ZDResponse;
import com.zdxt.common.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* 综合统计
*/
@ -101,6 +106,46 @@ public class StatisticalPanelController extends BaseController {
@GetMapping("/overall-analysis")
public String overallAnalysis(Model model)
{
return "project/code/statistical/overall-analysis";
}
@GetMapping("/single-analysis")
public String singleAnalysis(Model model)
{
return "project/code/statistical/single-analysis";
}
@GetMapping("/sixIndicators")
@ResponseBody
public ZDResponse sixIndicators(SixAnalysisParams params){
return ZDResponse.success("总数据统计", statisticalPaneService.sixIndicators(params));
}
@GetMapping("/sixIndicators_area")
@ResponseBody
public ZDResponse sixIndicators_area(SixAnalysisParams params){
return ZDResponse.success("各区数据统计", statisticalPaneService.sixIndicators_area(params));
}
@GetMapping("/staisticalRegistration_order")
@ResponseBody
public ZDResponse staisticalRegistration_order(SixAnalysisParams params){
return ZDResponse.success("被检查企业次数排行", statisticalPaneService.staisticalRegistration_order(params));
}
@GetMapping("/staisticalComplaint_order")
@ResponseBody
public ZDResponse staisticalComplaint_order(SixAnalysisParams params){
return ZDResponse.success("被检查企业次数排行", statisticalPaneService.staisticalComplaint_order(params));
}
@GetMapping("/staisticalBureau_order")
@ResponseBody
public ZDResponse staisticalBureau_order(SixAnalysisParams params){
return ZDResponse.success("被检查企业次数排行", statisticalPaneService.staisticalBureau_order(params));
}

75
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/SixAnalysis.java

@ -0,0 +1,75 @@
package com.zdxt.code.domain;
public class SixAnalysis {
/** 总数 */
private Integer num;
/** 昨日 */
private Integer yesterday_num;
/** 本月 */
private Integer current_month_num;
/** 上月 */
private Integer last_month_num;
/** 环比 */
private String ring_ratio;
/** 同比 */
private String yoy;
/** 标题 */
private String title;
public Integer getNum() {
return num;
}
public void setNum(Integer num) {
this.num = num;
}
public Integer getYesterday_num() {
return yesterday_num;
}
public void setYesterday_num(Integer yesterday_num) {
this.yesterday_num = yesterday_num;
}
public Integer getCurrent_month_num() {
return current_month_num;
}
public void setCurrent_month_num(Integer current_month_num) {
this.current_month_num = current_month_num;
}
public Integer getLast_month_num() {
return last_month_num;
}
public void setLast_month_num(Integer last_month_num) {
this.last_month_num = last_month_num;
}
public String getRing_ratio() {
return ring_ratio;
}
public void setRing_ratio(String ring_ratio) {
this.ring_ratio = ring_ratio;
}
public String getYoy() {
return yoy;
}
public void setYoy(String yoy) {
this.yoy = yoy;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}

140
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/SixAnalysisParams.java

@ -0,0 +1,140 @@
package com.zdxt.code.domain;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SixAnalysisParams {
private Long userId;
private String bureauDeptId;
private String bureauDeptName;
/** 0:联合检查, 1:单独检查, null:所有检查 */
private String uniteCheck;
/** 区域传入 字典类型 */
private String qy;
private String jd;
/** 开始时间 */
private String beginTime;
/** 接受时间 */
private String endTime;
/** 时间类型:year,quarter,month,day */
private String dateType;
private Integer year;
private Integer quarter;
private Integer month;
private Integer day;
Map<String, Object> params = new HashMap<String, Object>();
public Map<String, Object> getParams() {
return params;
}
public void setParams(Map<String, Object> params) {
this.params = params;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getBureauDeptId() {
return bureauDeptId;
}
public void setBureauDeptId(String bureauDeptId) {
this.bureauDeptId = bureauDeptId;
}
public String getBureauDeptName() {
return bureauDeptName;
}
public void setBureauDeptName(String bureauDeptName) {
this.bureauDeptName = bureauDeptName;
}
public String getUniteCheck() {
return uniteCheck;
}
public void setUniteCheck(String uniteCheck) {
this.uniteCheck = uniteCheck;
}
public String getQy() {
return qy;
}
public void setQy(String qy) {
this.qy = qy;
}
public String getJd() {
return jd;
}
public void setJd(String jd) {
this.jd = jd;
}
public String getBeginTime() {
return beginTime;
}
public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getDateType() {
return dateType;
}
public void setDateType(String dateType) {
this.dateType = dateType;
}
public Integer getYear() {
return year;
}
public void setYear(Integer year) {
this.year = year;
}
public Integer getQuarter() {
return quarter;
}
public void setQuarter(Integer quarter) {
this.quarter = quarter;
}
public Integer getMonth() {
return month;
}
public void setMonth(Integer month) {
this.month = month;
}
public Integer getDay() {
return day;
}
public void setDay(Integer day) {
this.day = day;
}
}

60
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalPanelMapper.java

@ -1,7 +1,12 @@
package com.zdxt.code.mapper;
import com.zdxt.code.domain.ComprehensiveAnalysis;
import com.zdxt.code.domain.SixAnalysisParams;
import com.zdxt.code.domain.StatisticsIndicatorPart;
import java.util.List;
import java.util.Map;
public interface StatisticalPanelMapper {
/**
@ -46,4 +51,59 @@ public interface StatisticalPanelMapper {
*/
Integer statisticalPanelProgramGroupByDept(StatisticsIndicatorPart statisticsIndicatorPart);
/**
* 获取执法记录,关联企业信息(本时段)
* @param params
* @return
* 注:企业名称使用的执法表内非企业表
*/
Integer staisticalRegistration(SixAnalysisParams params);
Double staisticalRegistration_rr(SixAnalysisParams params);
Double staisticalRegistration_yoy(SixAnalysisParams params);
/**
* 获取执法记录,关联企业信息(本时段)
* @param params
* @return
* 注:企业名称使用的执法表内非企业表
*/
Integer staisticalLawEnforcement(SixAnalysisParams params);
Double staisticalLawEnforcement_rr(SixAnalysisParams params);
Double staisticalLawEnforcement_yoy(SixAnalysisParams params);
/**
* 获取执法投诉统计表,关联企业信息(本时段)
* @param params
* @return
* 字段:企业信息、投诉类型
*/
Integer staisticalComplaint(SixAnalysisParams params);
Double staisticalComplaint_rr(SixAnalysisParams params);
Double staisticalComplaint_yoy(SixAnalysisParams params);
/**
* 获取执法预警本企业,关联企业信息(本时段)
* @param params
* @return
*/
Integer staisticalWarning(SixAnalysisParams params);
Double staisticalWarning_rr(SixAnalysisParams params);
Double staisticalWarning_yoy(SixAnalysisParams params);
/**
* 获取企业信息(本时段)
* @param params
* @return
*/
Integer staisticalEnterprise(SixAnalysisParams params);
Double staisticalEnterprise_rr(SixAnalysisParams params);
Double staisticalEnterprise_yoy(SixAnalysisParams params);
/** 排行 */
List<Map<String, Object>> staisticalRegistration_order(SixAnalysisParams params);
List<Map<String, Object>> staisticalComplaint_order(SixAnalysisParams params);
List<Map<String, Object>> staisticalBureau_order(SixAnalysisParams params);
}

16
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/StatisticalPaneService.java

@ -1,8 +1,14 @@
package com.zdxt.code.service;
import com.zdxt.code.domain.ComprehensiveAnalysis;
import com.zdxt.code.domain.SixAnalysis;
import com.zdxt.code.domain.SixAnalysisParams;
import com.zdxt.code.domain.StatisticsIndicatorPart;
import com.zdxt.code.domain.dto.StatisticalPanelDto;
import java.util.List;
import java.util.Map;
public interface StatisticalPaneService {
StatisticsIndicatorPart enterprise(StatisticsIndicatorPart statisticsIndicatorPart);
@ -40,6 +46,16 @@ public interface StatisticalPaneService {
StatisticsIndicatorPart registrationNew(StatisticsIndicatorPart statisticsIndicatorPart);
/**
* web:获取六项指标同环比
*/
List<SixAnalysis> sixIndicators(SixAnalysisParams params);
List<Map<String, Object>> sixIndicators_area(SixAnalysisParams params);
/** 排行 */
List<Map<String, Object>> staisticalRegistration_order(SixAnalysisParams params);
List<Map<String, Object>> staisticalComplaint_order(SixAnalysisParams params);
List<Map<String, Object>> staisticalBureau_order(SixAnalysisParams params);
}

250
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java

@ -10,10 +10,12 @@ import com.zdxt.auth.project.system.dict.service.IDictDataService;
import com.zdxt.auth.project.system.user.service.IUserService;
import com.zdxt.code.domain.*;
import com.zdxt.code.domain.dto.StatisticalPanelDto;
import com.zdxt.code.mapper.ComprehensiveAnalysisMapper;
import com.zdxt.code.mapper.StatisticalPanelMapper;
import com.zdxt.code.service.*;
import com.zdxt.common.annotation.DataScope;
import com.zdxt.domain.auth.Dept;
import com.zdxt.domain.auth.DictData;
import com.zdxt.domain.auth.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -22,12 +24,11 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.time.LocalDate;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
* 年度:year!==null,quarter==null,month==null
@ -65,6 +66,12 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService {
@Autowired
private IUserService userService;
@Autowired private IDictDataService iDictDataService;
@Autowired private ComprehensiveAnalysisMapper comprehensiveAnalysisMapper;
private static DecimalFormat decimalFormat = new DecimalFormat("#.00");
/**
* 企业--无权限
* @param statisticsIndicatorPart
@ -632,4 +639,241 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService {
return v;
}
/**
*
* @param params(区域需做前置处理转成字符串)
* @return
*/
@Override
public List<SixAnalysis> sixIndicators(SixAnalysisParams params) {
if (StringUtils.isNotEmpty(params.getQy())) {
String qy=iDictDataService.selectDictLabel("address_Type",params.getQy());
params.setQy(qy);
}
// 获取当前月的 今天 / 第一天
LocalDate current_day = LocalDate.now(); // 当月的今天
LocalDate current_one_day = current_day.withDayOfMonth(1); // 当月第一天
LocalDate current_finally_day = current_day.with(TemporalAdjusters.lastDayOfMonth()); // 当月最后一天
// 获取上个月的 今天 / 第一天
LocalDate last_day = current_day.minusMonths(1); // 上月的今天
LocalDate last_one_day = current_day.minusMonths(1).withDayOfMonth(1); // 上月第一天
LocalDate last_finally_day = current_day.minusMonths(1).with(TemporalAdjusters.lastDayOfMonth()); // 上月最后一天
// 如果当前日期是这个月的最后一天 or 当前月份天>上一月最后一天,则调整到上个月的最后一天
if (current_day.getDayOfMonth() > last_day.lengthOfMonth() || current_day.equals(current_finally_day)) {
last_day = last_finally_day;
}
List<SixAnalysis> all_area=new ArrayList<>();
/** -------- 总数 -------- */
// 涉企检查数量
SixAnalysis registration = new SixAnalysis();
all_area.add(registration);
registration.setTitle("涉企检查数量");
int reg_num = statisticalPanelMapper.staisticalRegistration(params);
double reg_rr_num = statisticalPanelMapper.staisticalRegistration_rr(params);
double reg_yoy_num = statisticalPanelMapper.staisticalRegistration_yoy(params);
registration.setNum(reg_num);
registration.setRing_ratio(this.calculateRingRatio(reg_rr_num, reg_num));
registration.setYoy(this.calculateYearOverYear(reg_yoy_num, reg_num));
// 联合检查数量
SixAnalysis unite_registration = new SixAnalysis();
all_area.add(unite_registration);
unite_registration.setTitle("联合检查数量");
params.setUniteCheck("0");
int unite_reg_num = statisticalPanelMapper.staisticalRegistration(params);
double unite_reg_rr_num = statisticalPanelMapper.staisticalRegistration_rr(params);
double unite_reg_yoy_num = statisticalPanelMapper.staisticalRegistration_yoy(params);
unite_registration.setNum(unite_reg_num);
unite_registration.setRing_ratio(this.calculateRingRatio(unite_reg_rr_num, unite_reg_num));
unite_registration.setYoy(this.calculateYearOverYear(unite_reg_yoy_num, unite_reg_num));
params.setUniteCheck(null);
// 行政检查预告数量
SixAnalysis lawEnforcement = new SixAnalysis();
all_area.add(lawEnforcement);
lawEnforcement.setTitle("行政检查预告数量");
int law_num = statisticalPanelMapper.staisticalLawEnforcement(params);
double law_rr_num = statisticalPanelMapper.staisticalLawEnforcement_rr(params);
double law_yoy_num = statisticalPanelMapper.staisticalLawEnforcement_yoy(params);
lawEnforcement.setNum(law_num);
lawEnforcement.setRing_ratio(this.calculateRingRatio(law_rr_num, law_num));
lawEnforcement.setYoy(this.calculateYearOverYear(law_yoy_num, law_num));
//涉企投诉数量
SixAnalysis complaint = new SixAnalysis();
all_area.add(complaint);
complaint.setTitle("涉企投诉数量");
int com_num = statisticalPanelMapper.staisticalComplaint(params);
double com_rr_num = statisticalPanelMapper.staisticalComplaint_rr(params);
double com_yoy_num = statisticalPanelMapper.staisticalComplaint_yoy(params);
complaint.setNum(com_num);
complaint.setRing_ratio(this.calculateRingRatio(com_rr_num, com_num));
complaint.setYoy(this.calculateYearOverYear(com_yoy_num, com_num));
//执法预警数量
SixAnalysis warning = new SixAnalysis();
all_area.add(warning);
warning.setTitle("执法预警数量");
int war_num = statisticalPanelMapper.staisticalWarning(params);
double war_rr_num = statisticalPanelMapper.staisticalWarning_rr(params);
double war_yoy_num = statisticalPanelMapper.staisticalWarning_yoy(params);
warning.setNum(war_num);
warning.setRing_ratio(this.calculateRingRatio(war_rr_num, war_num));
warning.setYoy(this.calculateYearOverYear(war_yoy_num, war_num));
//企业数量
SixAnalysis enterprise = new SixAnalysis();
all_area.add(enterprise);
enterprise.setTitle("企业数量");
int ent_num = statisticalPanelMapper.staisticalEnterprise(params);
double ent_rr_num = statisticalPanelMapper.staisticalEnterprise_rr(params);
double ent_yoy_num = statisticalPanelMapper.staisticalEnterprise_yoy(params);
enterprise.setNum(ent_num);
enterprise.setRing_ratio(this.calculateRingRatio(ent_rr_num, ent_num));
enterprise.setYoy(this.calculateYearOverYear(ent_yoy_num, ent_num));
params.setDateType("day");
/** -------- 本月 -------- */
params.setBeginTime(current_one_day.toString());
params.setEndTime(current_finally_day.toString());
registration.setCurrent_month_num(statisticalPanelMapper.staisticalRegistration(params));
params.setUniteCheck("0");
unite_registration.setCurrent_month_num(statisticalPanelMapper.staisticalRegistration(params));
params.setUniteCheck(null);
lawEnforcement.setCurrent_month_num(statisticalPanelMapper.staisticalLawEnforcement(params));
complaint.setCurrent_month_num(statisticalPanelMapper.staisticalComplaint(params));
warning.setCurrent_month_num(statisticalPanelMapper.staisticalWarning(params));
enterprise.setCurrent_month_num(statisticalPanelMapper.staisticalEnterprise(params));
/** -------- 昨天 -------- */
LocalDate yesterday = LocalDate.now().minusDays(1);
params.setBeginTime(yesterday.toString());
params.setEndTime(yesterday.toString());
registration.setYesterday_num(statisticalPanelMapper.staisticalRegistration(params));
params.setUniteCheck("0");
unite_registration.setYesterday_num(statisticalPanelMapper.staisticalRegistration(params));
params.setUniteCheck(null);
lawEnforcement.setYesterday_num(statisticalPanelMapper.staisticalLawEnforcement(params));
complaint.setYesterday_num(statisticalPanelMapper.staisticalComplaint(params));
warning.setYesterday_num(statisticalPanelMapper.staisticalWarning(params));
enterprise.setYesterday_num(statisticalPanelMapper.staisticalEnterprise(params));
return all_area;
}
@Override
public List<Map<String, Object>> sixIndicators_area(SixAnalysisParams params) {
List<DictData> area_list = iDictDataService.selectDictDataByType("address_Type");
List<Map<String, Object>> all_area=new ArrayList<>();
for(DictData area:area_list) {
Map<String, Object> info = new HashMap<>();
info.put("area", area.getDictLabel());
params.setQy(area.getDictLabel());
List<SixAnalysis> areas = new ArrayList<>();
/** -------- 总数 -------- */
// 涉企检查数量
SixAnalysis registration = new SixAnalysis();
areas.add(registration);
registration.setTitle("涉企检查次数");
registration.setNum(statisticalPanelMapper.staisticalRegistration(params));
// 联合检查数量
SixAnalysis unite_registration = new SixAnalysis();
areas.add(unite_registration);
unite_registration.setTitle("联合检查次数");
params.setUniteCheck("0");
unite_registration.setNum(statisticalPanelMapper.staisticalRegistration(params));
params.setUniteCheck(null);
// 行政检查预告数量
SixAnalysis lawEnforcement = new SixAnalysis();
areas.add(lawEnforcement);
lawEnforcement.setTitle("行政检查预告次数");
lawEnforcement.setNum(statisticalPanelMapper.staisticalLawEnforcement(params));
//涉企投诉数量
SixAnalysis complaint = new SixAnalysis();
areas.add(complaint);
complaint.setTitle("涉企投诉次数");
complaint.setNum(statisticalPanelMapper.staisticalComplaint(params));
//执法预警数量
SixAnalysis warning = new SixAnalysis();
areas.add(warning);
warning.setTitle("执法预警次数");
warning.setNum(statisticalPanelMapper.staisticalWarning(params));
//企业数量
SixAnalysis enterprise = new SixAnalysis();
areas.add(enterprise);
enterprise.setTitle("企业数量");
enterprise.setNum(statisticalPanelMapper.staisticalEnterprise(params));
info.put("list", areas);
all_area.add(info);
}
return all_area;
}
/** 排行 */
@Override
public List<Map<String, Object>> staisticalRegistration_order(SixAnalysisParams params) {
return statisticalPanelMapper.staisticalRegistration_order(params);
}
@Override
public List<Map<String, Object>> staisticalComplaint_order(SixAnalysisParams params) {
return statisticalPanelMapper.staisticalComplaint_order(params);
}
@Override
public List<Map<String, Object>> staisticalBureau_order(SixAnalysisParams params) {
return statisticalPanelMapper.staisticalBureau_order(params);
}
/**
* 计算环比增长率
* @param currentPeriodValue 当期数值
* @param previousPeriodValue 上期数值
* @return 环比增长率(百分比形式)
*/
private static String calculateRingRatio(double currentPeriodValue, double previousPeriodValue) {
// 如果上期数值为 0
if (previousPeriodValue == 0) {
// 如果当期数值也为 0,则环比增长率为 0%
if (currentPeriodValue == 0) {
return "0.0";
} else {
// 如果当期数值不为 0,则环比增长率可以认为是无穷大
return decimalFormat.format(Double.POSITIVE_INFINITY);
}
}
// 计算环比增长率
// double ringRatio = (currentPeriodValue - previousPeriodValue) / previousPeriodValue * 100;
double ringRatio = (currentPeriodValue - previousPeriodValue) / previousPeriodValue;
return decimalFormat.format(ringRatio);
}
/**
* 计算同比增长率
* @param currentPeriodValue 当期数值
* @param previousYearValue 去年同期数值
* @return 同比增长率(百分比形式)
*/
public static String calculateYearOverYear(double currentPeriodValue, double previousYearValue) {
// 如果去年同期数值为 0
if (previousYearValue == 0) {
// 如果当期数值也为 0,则同比增长率为 0%
if (currentPeriodValue == 0) {
return "0.0";
} else {
// 如果当期数值不为 0,则同比增长率可以认为是无穷大
return decimalFormat.format(Double.POSITIVE_INFINITY);
}
}
// 计算同比增长率
// double yearOverYear = (currentPeriodValue - previousYearValue) / previousYearValue * 100;
double yearOverYear = (currentPeriodValue - previousYearValue) / previousYearValue;
return decimalFormat.format(yearOverYear);
}
}

658
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml

@ -94,4 +94,662 @@
</select>
<!-- 执法登记 -->
<select id="staisticalRegistration" parameterType="SixAnalysisParams" resultType="integer">
select count(1) from enforcement_registration r
left join (select * from enterprise_information group by enterprise_number) e on r.enterprise_number = e.enterprise_number
<where>
and r.bureau_dept_name is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
<if test="uniteCheck == '0'.toString()"> and r.unite_check is not null</if>
<if test="uniteCheck == '1'.toString()"> and r.unite_check is null</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and r.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(r.create_time)=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(r.create_time)=#{year}
and QUARTER(r.create_time)=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(r.create_time)=#{year}
and MONTH(r.create_time)=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(r.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.create_time,'%Y-%m-%d')
</if>
</where>
</select>
<select id="staisticalRegistration_rr" parameterType="SixAnalysisParams" resultType="double">
select count(1) from enforcement_registration r
left join (select * from enterprise_information group by enterprise_number) e on r.enterprise_number = e.enterprise_number
<where>
and r.bureau_dept_name is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
<if test="uniteCheck == '0'.toString()"> and r.unite_check is not null</if>
<if test="uniteCheck == '1'.toString()"> and r.unite_check is null</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and r.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(r.create_time)+1=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(DATE_SUB(r.create_time,INTERVAL -1 quarter))=#{year}
and QUARTER(DATE_SUB(r.create_time,INTERVAL -1 quarter))=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(DATE_SUB(r.create_time,INTERVAL -1 month))=#{year}
and MONTH(DATE_SUB(r.create_time,INTERVAL -1 month))=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(r.create_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.create_time,'%Y-%m-%d')
</if>
</where>
</select>
<select id="staisticalRegistration_yoy" parameterType="SixAnalysisParams" resultType="double">
select count(1) from enforcement_registration r
left join (select * from enterprise_information group by enterprise_number) e on r.enterprise_number = e.enterprise_number
<where>
and r.bureau_dept_name is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
<if test="uniteCheck == '0'.toString()"> and r.unite_check is not null</if>
<if test="uniteCheck == '1'.toString()"> and r.unite_check is null</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and r.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(r.create_time)+1=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(DATE_SUB(r.create_time,INTERVAL -1 year))=#{year}
and QUARTER(DATE_SUB(r.create_time,INTERVAL -1 year))=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(DATE_SUB(r.create_time,INTERVAL -1 year))=#{year}
and MONTH(DATE_SUB(r.create_time,INTERVAL -1 year))=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(DATE_SUB(r.create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.create_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</where>
</select>
<!-- 执法预告 -->
<select id="staisticalLawEnforcement" parameterType="SixAnalysisParams" resultType="integer">
select count(1) from enterprise_law_enforcement n
left join (select * from enterprise_information group by enterprise_number) e on n.enterprise_number=e.enterprise_number
<where>
and n.enterprise_number is not null
<if test="userId != null and userId != '' ">and( n.law_enforcer_id=#{userId} or n.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and n.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(n.create_time)=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(n.create_time)=#{year}
and QUARTER(n.create_time)=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(n.create_time)=#{year}
and MONTH(n.create_time)=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(n.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(n.create_time,'%Y-%m-%d')
</if>
</where>
</select>
<select id="staisticalLawEnforcement_rr" parameterType="SixAnalysisParams" resultType="double">
select count(1) from enterprise_law_enforcement n
left join (select * from enterprise_information group by enterprise_number) e on n.enterprise_number=e.enterprise_number
<where>
and n.enterprise_number is not null
<if test="userId != null and userId != '' ">and( n.law_enforcer_id=#{userId} or n.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and n.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(n.create_time)+1=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(DATE_SUB(n.create_time,INTERVAL -1 quarter))=#{year}
and QUARTER(DATE_SUB(n.create_time,INTERVAL -1 quarter))=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(DATE_SUB(n.create_time,INTERVAL -1 month))=#{year}
and MONTH(DATE_SUB(n.create_time,INTERVAL -1 month))=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(n.create_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime}),"%Y-%m-%d")+1 day)>=DATE_FORMAT(n.create_time,'%Y-%m-%d')
</if>
</where>
</select>
<select id="staisticalLawEnforcement_yoy" parameterType="SixAnalysisParams" resultType="double">
select count(1) from enterprise_law_enforcement n
left join (select * from enterprise_information group by enterprise_number) e on n.enterprise_number=e.enterprise_number
<where>
and n.enterprise_number is not null
<if test="userId != null and userId != '' ">and( n.law_enforcer_id=#{userId} or n.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and n.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(n.create_time)+1=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(DATE_SUB(n.create_time,INTERVAL -1 year))=#{year}
and QUARTER(DATE_SUB(n.create_time,INTERVAL -1 year))=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(DATE_SUB(n.create_time,INTERVAL -1 year))=#{year}
and MONTH(DATE_SUB(n.create_time,INTERVAL -1 year))=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(DATE_SUB(n.create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(n.create_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</where>
</select>
<!-- 执法投诉 -->
<select id="staisticalComplaint" parameterType="SixAnalysisParams" resultType="integer">
select count(1) from complaint_statistics c
left join (select * from enterprise_information group by enterprise_number) e on c.enterprise_number=e.enterprise_number
<where>
and (c.rid is not null or c.complaint_department_id is not null)
and c.enforce_type is not null
and c.enterprise_number is not null
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and c.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(c.complaint_time)=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(c.complaint_time)=#{year}
and QUARTER(c.complaint_time)=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(c.complaint_time)=#{year}
and MONTH(c.complaint_time)=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(c.complaint_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(c.complaint_time,'%Y-%m-%d')
</if>
</where>
</select>
<select id="staisticalComplaint_rr" parameterType="SixAnalysisParams" resultType="double">
select count(1) from complaint_statistics c
left join (select * from enterprise_information group by enterprise_number) e on c.enterprise_number=e.enterprise_number
<where>
and (c.rid is not null or c.complaint_department_id is not null)
and c.enforce_type is not null
and c.enterprise_number is not null
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and c.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(c.complaint_time)+1=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(DATE_SUB(c.complaint_time,INTERVAL -1 quarter))=#{year}
and QUARTER(DATE_SUB(c.complaint_time,INTERVAL -1 quarter))=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(DATE_SUB(c.complaint_time,INTERVAL -1 month))=#{year}
and MONTH(DATE_SUB(c.complaint_time,INTERVAL -1 month))=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(c.complaint_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(c.complaint_time,'%Y-%m-%d')
</if>
</where>
</select>
<select id="staisticalComplaint_yoy" parameterType="SixAnalysisParams" resultType="double">
select count(1) from complaint_statistics c
left join (select * from enterprise_information group by enterprise_number) e on c.enterprise_number=e.enterprise_number
<where>
and (c.rid is not null or c.complaint_department_id is not null)
and c.enforce_type is not null
and c.enterprise_number is not null
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and c.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(c.complaint_time)+1=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(DATE_SUB(c.complaint_time,INTERVAL -1 year))=#{year}
and QUARTER(DATE_SUB(c.complaint_time,INTERVAL -1 year))=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(DATE_SUB(c.complaint_time,INTERVAL -1 year))=#{year}
and MONTH(DATE_SUB(c.complaint_time,INTERVAL -1 year))=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</where>
</select>
<!-- 执法预警 -->
<select id="staisticalWarning" parameterType="SixAnalysisParams" resultType="integer">
select COALESCE(SUM(w.enforcement_number), 0) from law_enforcement_warning_list w
left join (select * from enterprise_information group by enterprise_number) e on w.enterprise_number=e.enterprise_number
<where>
and w.enterprise_number is not null
and warn_type = 1
<if test="userId != null and userId != '' ">and( w.law_enforcer_id=#{userId} or w.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and w.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(w.create_time)=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(w.create_time)=#{year}
and QUARTER(w.create_time)=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(w.create_time)=#{year}
and MONTH(w.create_time)=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(w.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(w.create_time,'%Y-%m-%d')
</if>
</where>
</select>
<select id="staisticalWarning_rr" parameterType="SixAnalysisParams" resultType="double">
select COALESCE(SUM(w.enforcement_number), 0) from law_enforcement_warning_list w
left join (select * from enterprise_information group by enterprise_number) e on w.enterprise_number=e.enterprise_number
<where>
and w.enterprise_number is not null
and warn_type = 1
<if test="userId != null and userId != '' ">and( w.law_enforcer_id=#{userId} or w.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and w.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(w.create_time)+1=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(DATE_SUB(w.create_time,INTERVAL -1 quarter))=#{year}
and QUARTER(DATE_SUB(w.create_time,INTERVAL -1 quarter))=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(DATE_SUB(w.create_time,INTERVAL -1 month))=#{year}
and MONTH(DATE_SUB(w.create_time,INTERVAL -1 month))=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(w.create_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(w.create_time,'%Y-%m-%d')
</if>
</where>
</select>
<select id="staisticalWarning_yoy" parameterType="SixAnalysisParams" resultType="double">
select COALESCE(SUM(w.enforcement_number), 0) from law_enforcement_warning_list w
left join (select * from enterprise_information group by enterprise_number) e on w.enterprise_number=e.enterprise_number
<where>
and w.enterprise_number is not null
and warn_type = 1
<if test="userId != null and userId != '' ">and( w.law_enforcer_id=#{userId} or w.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and w.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(w.create_time)+1=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(DATE_SUB(w.create_time,INTERVAL -1 year))=#{year}
and QUARTER(DATE_SUB(w.create_time,INTERVAL -1 year))=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(DATE_SUB(w.create_time,INTERVAL -1 year))=#{year}
and MONTH(DATE_SUB(w.create_time,INTERVAL -1 year))=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(DATE_SUB(w.create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(w.create_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</where>
</select>
<!-- 企业 -->
<select id="staisticalEnterprise" parameterType="SixAnalysisParams" resultType="integer">
select count(1) from enterprise_information e
<where>
and e.is_unsubscribe is not null
and e.company_org_type is not null
and e.enterprise_address is not null
<if test="userId != null and userId != '' ">and( e.law_enforcer_id=#{userId} or e.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and e.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(e.create_time)=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(e.create_time)=#{year}
and QUARTER(e.create_time)=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(e.create_time)=#{year}
and MONTH(e.create_time)=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(e.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(e.create_time,'%Y-%m-%d')
</if>
</where>
</select>
<select id="staisticalEnterprise_rr" parameterType="SixAnalysisParams" resultType="double">
select count(1) from enterprise_information e
<where>
and e.is_unsubscribe is not null
and e.company_org_type is not null
and e.enterprise_address is not null
<if test="userId != null and userId != '' ">and( e.law_enforcer_id=#{userId} or e.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and e.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(e.create_time)+1=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(DATE_SUB(e.create_time,INTERVAL -1 quarter))=#{year}
and QUARTER(DATE_SUB(e.create_time,INTERVAL -1 quarter))=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(DATE_SUB(e.create_time,INTERVAL -1 month))=#{year}
and MONTH(DATE_SUB(e.create_time,INTERVAL -1 month))=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(e.create_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{e.beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{e.endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{e.beginTime},"%Y-%m-%d"))+1 day)
and DATE_SUB(STR_TO_DATE(#{e.endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{e.endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{e.beginTime}),"%Y-%m-%d")+1 day)>=DATE_FORMAT(e.create_time,'%Y-%m-%d')
</if>
</where>
</select>
<select id="staisticalEnterprise_yoy" parameterType="SixAnalysisParams" resultType="double">
select count(1) from enterprise_information e
<where>
and e.is_unsubscribe is not null
and e.company_org_type is not null
and e.enterprise_address is not null
<if test="userId != null and userId != '' ">and( e.law_enforcer_id=#{userId} or e.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and e.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(e.create_time)+1=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(DATE_SUB(e.create_time,INTERVAL -1 year))=#{year}
and QUARTER(DATE_SUB(e.create_time,INTERVAL -1 year))=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(DATE_SUB(e.create_time,INTERVAL -1 year))=#{year}
and MONTH(DATE_SUB(e.create_time,INTERVAL -1 year))=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(DATE_SUB(e.create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(e.create_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</where>
</select>
<!-- 被检查企业次数排行 -->
<select id="staisticalRegistration_order" parameterType="SixAnalysisParams" resultType="map">
select r.enterprise_name, count(1) as num from enforcement_registration r
left join (select * from enterprise_information group by enterprise_number) e on r.enterprise_number = e.enterprise_number
<where>
and r.bureau_dept_name is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
<if test="uniteCheck == '0'.toString()"> and r.unite_check is not null</if>
<if test="uniteCheck == '1'.toString()"> and r.unite_check is null</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and r.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(r.create_time)=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(r.create_time)=#{year}
and QUARTER(r.create_time)=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(r.create_time)=#{year}
and MONTH(r.create_time)=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(r.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.create_time,'%Y-%m-%d')
</if>
</where>
group by r.enterprise_number order by num desc
</select>
<!-- 被投诉单位排行 -->
<select id="staisticalComplaint_order" parameterType="SixAnalysisParams" resultType="map">
select c.complaint_department, count(1) as num from complaint_statistics c
left join (select * from enterprise_information group by enterprise_number) e on c.enterprise_number=e.enterprise_number
<where>
and (c.rid is not null or c.complaint_department_id is not null)
and c.enforce_type is not null
and c.enterprise_number is not null
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and c.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(c.complaint_time)=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(c.complaint_time)=#{year}
and QUARTER(c.complaint_time)=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(c.complaint_time)=#{year}
and MONTH(c.complaint_time)=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(c.complaint_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(c.complaint_time,'%Y-%m-%d')
</if>
</where>
group by c.complaint_department_id order by num desc;
</select>
<!-- 执法检查数量排行 -->
<select id="staisticalBureau_order" parameterType="SixAnalysisParams" resultType="map">
select r.bureau_dept_name, count(1) as num from enforcement_registration r
left join (select * from enterprise_information group by enterprise_number) e on r.enterprise_number = e.enterprise_number
<where>
and r.bureau_dept_name is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
<if test="uniteCheck == '0'.toString()"> and r.unite_check is not null</if>
<if test="uniteCheck == '1'.toString()"> and r.unite_check is null</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="bureauDeptId != null and bureauDeptId != '' ">and r.bureau_dept_id=#{bureauDeptId}</if>
<if test="qy != null and qy != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="dateType != null and dateType != '' and dateType == 'year' ">
and YEAR(r.create_time)=#{year}
</if>
<if test="dateType != null and dateType != '' and dateType == 'quarter' ">
and YEAR(r.create_time)=#{year}
and QUARTER(r.create_time)=#{quarter}
</if>
<if test="dateType != null and dateType != '' and dateType == 'month' ">
and YEAR(r.create_time)=#{year}
and MONTH(r.create_time)=#{month}
</if>
<if test="dateType != null and dateType != '' and dateType == 'day' ">
and DATE_FORMAT(r.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.create_time,'%Y-%m-%d')
</if>
</where>
group by r.bureau_dept_id order by num desc
</select>
</mapper>
Loading…
Cancel
Save