大屏接口修改

dongdingding
董丁丁 2 years ago
parent 89a21cf52b
commit c05d6c1dba

@ -97,4 +97,16 @@ public class ZongzhiScreenOpinionController {
}
/**
*
*/
@ApiOperation(value = "部门专办情况", response = ZongzhiSentimentDeptResponse.class)
@GetMapping("/sentimentdept")
private AjaxResult getSentimentDept() {
;
return AjaxResult.success(zongzhiScreenOpinionService.getSentimentDept());
}
}

@ -125,4 +125,33 @@ public class ZongzhiScreenSaftyController {
/**
*
*/
@ApiOperation(value = "通报统计属地通报", response = ZongzhiTbAreaResponse.class)
@GetMapping("/tbarea")
private AjaxResult getTbArea() {
return AjaxResult.success(zongzhiScreenSaftyService.getTbArea());
}
/**
*
*/
@ApiOperation(value = "通报统计部门通报", response = ZongzhiTbDeptResponse.class)
@GetMapping("/tbdept")
private AjaxResult getTbDept() {
return AjaxResult.success(zongzhiScreenSaftyService.getTbDept());
}
/**
*
*/
@ApiOperation(value = "通报完成情况", response = ZongzhiTbDeptCompleteResponse.class)
@GetMapping("/tbcomplete")
private AjaxResult getTbCompletet() {
return AjaxResult.success(zongzhiScreenSaftyService.getTbDeptComplet());
}
}

@ -12,12 +12,12 @@ import lombok.Data;
public class ZongzhiAttackResponse {
@ApiModelProperty(value = "数量")
private Integer count;
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "攻击源IP地址区域")
private String attackIpRegion;
@ApiModelProperty(value = "受攻击次数")
private Integer attackCount;
}

@ -18,4 +18,6 @@ public class ZongzhiSafetyResponse {
@ApiModelProperty(value = "攻击类型 1.入侵攻击 2.恶意扫描 3僵木蠕病毒 4挖矿 5网络爬虫")
private int attackType;
}

@ -0,0 +1,28 @@
package com.ruoyi.screen.domain.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("部门专办情况响应类")
public class ZongzhiSentimentDeptResponse {
/**
*
*/
@ApiModelProperty(value = "部门名称")
private String dep_name;
/**
*
*/
@ApiModelProperty(value = "数量")
private Integer count;
}

@ -24,5 +24,5 @@ public class ZongzhiSourceResponse {
* 7.
*/
@ApiModelProperty(value = "类型 1.云断监管 2APTM 3.硬探针 4.软探针 5.监管单位 6.网站监测 7.系统监测")
private int type;
private Integer type;
}

@ -0,0 +1,33 @@
package com.ruoyi.screen.domain.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("通报统计属地通报响应类")
public class ZongzhiTbAreaResponse {
/**
*
*/
@ApiModelProperty(value = " 百分比")
private double pt;
/**
*
*/
@ApiModelProperty(value = "属地")
private String locationName;
}

@ -0,0 +1,37 @@
package com.ruoyi.screen.domain.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("近一个月通报完成响应类")
public class ZongzhiTbDeptCompleteMonthResponse {
/**
*
*/
@ApiModelProperty(value = "通报数量")
private int count;
/**
*
*/
@ApiModelProperty(value = "完成期数")
private int complete;
/**
*
*/
@ApiModelProperty(value = "百分比")
private double pt;
}

@ -0,0 +1,19 @@
package com.ruoyi.screen.domain.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
*
*/
@Data
@ApiModel("通报完成情况响应类")
public class ZongzhiTbDeptCompleteResponse {
@ApiModelProperty(value = "近一个月完成情况")
List<ZongzhiTbDeptCompleteMonthResponse> getmonthList;
}

@ -0,0 +1,37 @@
package com.ruoyi.screen.domain.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("近六个月通报完成响应类")
public class ZongzhiTbDeptCompleteSixResponse {
/**
*
*/
@ApiModelProperty(value = "通报数量")
private int count;
/**
*
*/
@ApiModelProperty(value = "完成期数")
private int complete;
/**
*
*/
@ApiModelProperty(value = "百分比")
private double pt;
}

@ -0,0 +1,37 @@
package com.ruoyi.screen.domain.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("近三个月通报完成响应类")
public class ZongzhiTbDeptCompleteThirdMonthResponse {
/**
*
*/
@ApiModelProperty(value = "通报数量")
private int count;
/**
*
*/
@ApiModelProperty(value = "完成期数")
private int complete;
/**
*
*/
@ApiModelProperty(value = "百分比")
private double pt;
}

@ -0,0 +1,37 @@
package com.ruoyi.screen.domain.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("近一年通报完成响应类")
public class ZongzhiTbDeptCompleteYearResponse {
/**
*
*/
@ApiModelProperty(value = "通报数量")
private int count;
/**
*
*/
@ApiModelProperty(value = "完成期数")
private int complete;
/**
*
*/
@ApiModelProperty(value = "百分比")
private double pt;
}

@ -0,0 +1,27 @@
package com.ruoyi.screen.domain.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("@通报统计部门通报响应类")
public class ZongzhiTbDeptResponse {
/**
*
*/
@ApiModelProperty(value = "部门名称")
private String dep_name;
/**
*
*/
@ApiModelProperty(value = "通报次数")
private Integer count;
}

@ -11,6 +11,13 @@ import lombok.Data;
@ApiModel("大屏数据工作动态响应类")
public class ZongzhiWorkDynamicsResponse {
/**
* id
*/
@ApiModelProperty(value = "id")
private int id;
/**
*
*/

@ -58,4 +58,10 @@ public interface ZongzhiScreenOpinionMapper {
*
*/
public List<ZongzhiReportResponse> getSentimentReportbyReportType();
/**
*
*/
public List<ZongzhiSentimentDeptResponse> getSentimentDept();
}

@ -79,4 +79,46 @@ public interface ZongzhiScreenSaftyMapper {
*
*/
public List<ZongzhiNotificationResponse> getNotification();
/**
*
*/
public List<ZongzhiTbAreaResponse> getTbArea();
/**
*
*/
public List<ZongzhiTbDeptResponse> getTbDept();
/**
*
*/
public List<ZongzhiTbDeptCompleteMonthResponse> getmonthList();
/**
*
*/
public List<ZongzhiTbDeptCompleteThirdMonthResponse> getthirdList();
/**
*
*/
public List<ZongzhiTbDeptCompleteSixResponse> getsixList();
/**
*
*/
public List<ZongzhiTbDeptCompleteYearResponse> getyearList();
}

@ -56,4 +56,12 @@ public interface ZongzhiScreenOpinionService {
/**
*
*/
public List<ZongzhiSentimentDeptResponse> getSentimentDept();
}

@ -68,4 +68,24 @@ public interface ZongzhiScreenSaftyService {
/**
*
*/
public List<ZongzhiTbAreaResponse> getTbArea();
/**
*
*/
public List<ZongzhiTbDeptResponse> getTbDept();
/**
*
*/
public List<ZongzhiTbDeptCompleteResponse> getTbDeptComplet();
}

@ -50,4 +50,9 @@ public class ZongzhiScreenOpinionServiceImpl implements ZongzhiScreenOpinionServ
public List<ZongzhiReportResponse> getSentimentReportbyReportType() {
return zongzhiScreenOpinionMapper.getSentimentReportbyReportType();
}
@Override
public List<ZongzhiSentimentDeptResponse> getSentimentDept() {
return zongzhiScreenOpinionMapper.getSentimentDept();
}
}

@ -74,4 +74,32 @@ public class ZongzhiScreenSaftyServiceImpl implements ZongzhiScreenSaftyService
public List<ZongzhiNotificationResponse> getNotification() {
return zongzhiScreenSaftyMapper.getNotification();
}
@Override
public List<ZongzhiTbAreaResponse> getTbArea() {
return zongzhiScreenSaftyMapper.getTbArea();
}
@Override
public List<ZongzhiTbDeptResponse> getTbDept() {
return zongzhiScreenSaftyMapper.getTbDept();
}
@Override
public List<ZongzhiTbDeptCompleteResponse> getTbDeptComplet() {
List list =new ArrayList<>();
//近一个月
List<ZongzhiTbDeptCompleteMonthResponse> monthList=zongzhiScreenSaftyMapper.getmonthList();
//近三个月
List<ZongzhiTbDeptCompleteThirdMonthResponse> thirdList=zongzhiScreenSaftyMapper.getthirdList();
//近六个月
List<ZongzhiTbDeptCompleteSixResponse> sixList=zongzhiScreenSaftyMapper.getsixList();
//近一年
List<ZongzhiTbDeptCompleteYearResponse> yearList=zongzhiScreenSaftyMapper.getyearList();
list.addAll(monthList);
list.addAll(thirdList);
list.addAll(sixList);
list.addAll(yearList);
return list;
}
}

@ -6,9 +6,9 @@
<select id="getWorkDynamics" resultType="com.ruoyi.screen.domain.response.ZongzhiWorkDynamicsResponse">
SELECT type, name
FROM `tc_work_dongtai` where name is not null
GROUP BY type, name
SELECT type, materials_name as name,id
FROM `tc_work_dongtai` where materials_name is not null
GROUP BY type, materials_name
</select>
<select id="getNetworkReport" resultType="com.ruoyi.screen.domain.response.ZongzhiNetworkReportResponse">
select count(*) as count, ROUND(count(case when state=2 THEN 1 ELSE NULL END ) * 100.0/ sum(count(*)) OVER (), 1 )as handle
@ -34,7 +34,7 @@
<select id="getWorkDynamicsCount" resultType="java.lang.Integer">
SELECT count(*) as count
FROM `tc_work_dongtai`
where name is not null
where materials_name is not null
</select>

@ -45,7 +45,13 @@
<select id="getSentimentReportbyReportType"
resultType="com.ruoyi.screen.domain.response.ZongzhiReportResponse">
select count(sentiment_report_type) as count, sentiment_report_type as sentimentReportType
from tc_network_sentiment
from tc_network_sentiment where sentiment_report_type is not null
GROUP BY sentiment_report_type
</select>
<select id="getSentimentDept" resultType="com.ruoyi.screen.domain.response.ZongzhiSentimentDeptResponse">
select dep_name, count(*) as count
from tc_network_sentiment
where isturn ='1'
GROUP BY dep_name
</select>
</mapper>

@ -7,7 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getSource" resultType="com.ruoyi.screen.domain.response.ZongzhiSourceResponse">
select count(*) as count ,type
from tc_data_source
from tc_data_source where type is not null
GROUP BY type
</select>
<select id="getsafety" resultType="com.ruoyi.screen.domain.response.ZongzhiSafetyResponse">
@ -21,9 +21,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getAttack" resultType="com.ruoyi.screen.domain.response.ZongzhiAttackResponse">
SELECT COUNT(*) AS count, attack_ip_region as attackIpRegion
FROM tc_safety_detection
GROUP BY attack_ip_region;
SELECT name, attack_count as attackCount
FROM tc_attack
</select>
<select id="getUnAttackTop" resultType="com.ruoyi.screen.domain.response.ZongzhiUnAttackResponse">
select attacked_ip as attackedIp, attacked_ip_region as attackIpRegion, count(*)as count, ROUND(COUNT(*) * 100.0 / SUM(COUNT(*)) OVER (), 1) AS pt
@ -56,4 +56,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select count(*) as count, 'IDC单位' as name
from tc_idc_unit
</select>
<select id="getTbArea" resultType="com.ruoyi.screen.domain.response.ZongzhiTbAreaResponse">
SELECT ROUND(COUNT(*) * 100.0 / SUM(COUNT(*)) OVER (), 1) AS pt, location_name as locationName
from tc_tb where tb_type='1'
group by location_name
</select>
<select id="getTbDept" resultType="com.ruoyi.screen.domain.response.ZongzhiTbDeptResponse">
SELECT COUNT(*) AS count, dep_name
from tc_tb
where tb_type = '2'
group by dep_name
</select>
<select id="getmonthList" resultType="com.ruoyi.screen.domain.response.ZongzhiTbDeptCompleteMonthResponse">
SELECT COUNT(*) AS count,
count(case when state=1 then state else null end) as complete,
count(case when state=1 then state else null end) / COUNT(*) AS pt
FROM`tc_tb`WHERE DATE_FORMAT( tb_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</select>
<select id="getthirdList"
resultType="com.ruoyi.screen.domain.response.ZongzhiTbDeptCompleteThirdMonthResponse">
SELECT COUNT(*) AS count,
count(case when state=1 then state else null end) as complete,
count(case when state=1 then state else null end) / COUNT(*) AS pt
FROM `tc_tb` WHERE QUARTER(tb_time)=QUARTER(now());
</select>
<select id="getsixList"
resultType="com.ruoyi.screen.domain.response.ZongzhiTbDeptCompleteSixResponse">
SELECT COUNT(*) AS count,
count(case when state=1 then state else null end) as complete,
count(case when state=1 then state else null end) / COUNT(*) AS pt
FROM `tc_tb` WHERE DATE(tb_time) >= DATE_SUB(CURRENT_DATE(), INTERVAL 6 MONTH) and tb_time &lt;= CURRENT_DATE();;
</select>
<select id="getyearList"
resultType="com.ruoyi.screen.domain.response.ZongzhiTbDeptCompleteSixResponse">
SELECT COUNT(*) AS count,
count(case when state=1 then state else null end) as complete,
count(case when state=1 then state else null end) / COUNT(*) AS pt
FROM `tc_tb` WHERE DATE(tb_time) >= DATE_SUB(CURRENT_DATE(), INTERVAL 1 YEAR) and tb_time &lt;= CURRENT_DATE();;
</select>
</mapper>
Loading…
Cancel
Save