大屏接口编写

duhanyu
dongdingding 1 year ago
parent c1a5652929
commit 5f38679126

@ -111,4 +111,15 @@ public class ScreenController extends BaseController {
public AjaxResult screeDept() {
return AjaxResult.success(screenService.getScreenDept());
}
/**
*
*/
@ApiOperation(value = "举报地图", response = ScreenReportMapResponse.class)
@GetMapping("/screenreportmap")
public AjaxResult screenReportMap() {
return AjaxResult.success(screenService.getScreenReportMap());
}
}

@ -0,0 +1,27 @@
package com.ruoyi.tcZz.domain.reponse;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("举报地图")
public class ScreenReportMapResponse {
/**
*
*/
@ApiModelProperty("举报总数")
private Integer count;
/**
*
*/
@ApiModelProperty("处置率")
private double rate;
}

@ -12,6 +12,8 @@ public interface ScreenMapper {
/**
*
*
* @return
*/
ScreenSupervisionResponse getScreenSupervision();
@ -19,6 +21,8 @@ public interface ScreenMapper {
/**
*
*
* @return
*/
ScreenSourceResponse getScreenSource();
@ -31,7 +35,6 @@ public interface ScreenMapper {
ScreenOpinionReportResponse getScreenOpinionReport();
/**
*
*
@ -40,7 +43,6 @@ public interface ScreenMapper {
ScreenArticlesResponse getScreenArticles();
/**
*
*
@ -51,6 +53,7 @@ public interface ScreenMapper {
/**
*
*
* @return
*/
List<ScreenQinglangWeiguiResponse> getScreenQinglangWeigui();
@ -58,16 +61,25 @@ public interface ScreenMapper {
/**
*
*
* @return
*/
List<ScreenTerritorialResponse> getScreenTerritorial();
/**
*
*
* @return
*/
List<ScreenDeptResponse> getScreenDept();
/**
*
*
* @return
*/
ScreenReportMapResponse getScreenReportMap();
}

@ -72,4 +72,12 @@ public interface ScreenService {
* @return
*/
List<ScreenDeptResponse> getScreenDept();
/**
*
*
* @return
*/
ScreenReportMapResponse getScreenReportMap();
}

@ -59,4 +59,9 @@ public class ScreenServiceImpl implements ScreenService {
public List<ScreenDeptResponse> getScreenDept() {
return screenMapper.getScreenDept();
}
@Override
public ScreenReportMapResponse getScreenReportMap() {
return screenMapper.getScreenReportMap();
}
}

@ -54,4 +54,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getScreenDept" resultType="com.ruoyi.tcZz.domain.reponse.ScreenDeptResponse">
select COUNT(*) AS count,dep_name as depName from tc_bmtb where isStatus =1 GROUP BY dep_name
</select>
<select id="getScreenReportMap" resultType="com.ruoyi.tcZz.domain.reponse.ScreenReportMapResponse">
SELECT COUNT(*) AS count,
SUM(CASE WHEN state = 2 THEN 1 ELSE 0 END) * 100.0 / COUNT(*) AS rate
FROM
tc_jbmap;
</select>
</mapper>
Loading…
Cancel
Save