dongdingding 1 year ago
commit cd9020ef81

@ -86,4 +86,29 @@ public class ScreenController extends BaseController {
screenQinglangResponse.setScreenQinglangWeiguiResponse(list1); screenQinglangResponse.setScreenQinglangWeiguiResponse(list1);
return AjaxResult.success(screenQinglangResponse); return AjaxResult.success(screenQinglangResponse);
} }
/**
*
*/
@ApiOperation(value = "属地通报", response = ScreenTerritorialResponse.class)
@GetMapping("/screenterritorial")
public AjaxResult screenTerritorial() {
return AjaxResult.success(screenService.getScreenTerritorial());
}
/**
*
*/
@ApiOperation(value = "部门通报", response = ScreenDeptResponse.class)
@GetMapping("/screendept")
public AjaxResult screeDept() {
return AjaxResult.success(screenService.getScreenDept());
}
} }

@ -0,0 +1,28 @@
package com.ruoyi.tcZz.domain.reponse;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("部门通报")
public class ScreenDeptResponse {
/**
*
*/
@ApiModelProperty("统计数据")
private Integer count;
/**
*
*/
@ApiModelProperty("部门")
private String depName;
}

@ -0,0 +1,34 @@
package com.ruoyi.tcZz.domain.reponse;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@ApiModel("属地通报")
@Data
public class ScreenTerritorialResponse {
/**
*
*/
@ApiModelProperty("统计数据")
private Integer count;
/**
*
*/
@ApiModelProperty("地区")
private Integer area;
/**
*
*/
@ApiModelProperty("百分比")
private double percentage;
}

@ -54,4 +54,20 @@ public interface ScreenMapper {
* @return * @return
*/ */
List<ScreenQinglangWeiguiResponse> getScreenQinglangWeigui(); List<ScreenQinglangWeiguiResponse> getScreenQinglangWeigui();
/**
*
*/
List<ScreenTerritorialResponse> getScreenTerritorial();
/**
*
*
* @return
*/
List<ScreenDeptResponse> getScreenDept();
} }

@ -52,7 +52,24 @@ public interface ScreenService {
/** /**
* *
*
* @return * @return
*/ */
List<ScreenQinglangWeiguiResponse> getScreenQinglangWeigui(); List<ScreenQinglangWeiguiResponse> getScreenQinglangWeigui();
/**
*
*
* @return
*/
List<ScreenTerritorialResponse> getScreenTerritorial();
/**
*
*
* @return
*/
List<ScreenDeptResponse> getScreenDept();
} }

@ -49,4 +49,14 @@ public class ScreenServiceImpl implements ScreenService {
public List<ScreenQinglangWeiguiResponse> getScreenQinglangWeigui() { public List<ScreenQinglangWeiguiResponse> getScreenQinglangWeigui() {
return screenMapper.getScreenQinglangWeigui(); return screenMapper.getScreenQinglangWeigui();
} }
@Override
public List<ScreenTerritorialResponse> getScreenTerritorial() {
return screenMapper.getScreenTerritorial();
}
@Override
public List<ScreenDeptResponse> getScreenDept() {
return screenMapper.getScreenDept();
}
} }

@ -41,4 +41,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
resultType="com.ruoyi.tcZz.domain.reponse.ScreenQinglangWeiguiResponse"> resultType="com.ruoyi.tcZz.domain.reponse.ScreenQinglangWeiguiResponse">
select count2,date_time as dateTime from tc_qlzxxdsjtj order by date_time desc limit 12 select count2,date_time as dateTime from tc_qlzxxdsjtj order by date_time desc limit 12
</select> </select>
<select id="getScreenTerritorial" resultType="com.ruoyi.tcZz.domain.reponse.ScreenTerritorialResponse">
SELECT
COUNT(*) AS count,
area,
COUNT(*) * 100.0 / SUM(COUNT(*)) OVER() AS percentage
FROM
tc_sdtb where isStatus =1
GROUP BY
area;
</select>
<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>
</mapper> </mapper>
Loading…
Cancel
Save