ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ycl-platform/src/main/java/com/ycl/mapper/apidata/ApiDataMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ycl-platform/src/main/java/com/ycl/service/apidata/IApiDataService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ycl-platform/src/main/java/com/ycl/service/apidata/impl/IApiDataServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ycl-platform/src/main/resources/mapper/apidata/ApiDataMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java
@@ -6,6 +6,7 @@ import com.ycl.api.CommonResult; import com.ycl.entity.cockpitManage.TeamConstruction; import com.ycl.entity.cockpitManage.TeamIndex; import com.ycl.service.apidata.IApiDataService; import com.ycl.service.cockpitManage.ITeamConstructionService; import com.ycl.service.equipment.IOrgGridService; import com.ycl.service.video.impl.IVideoPointService; @@ -45,6 +46,14 @@ private ITeamConstructionService teamConstructionService; private IOrgGridService orgGridService; private IApiDataService iApiDataService; @Autowired public void setIApiDataService(IApiDataService apiDataService){ this.iApiDataService = apiDataService; } @Autowired public void setTeamConstructionService(ITeamConstructionService teamConstructionService) { @@ -147,13 +156,17 @@ @ApiOperation(value = "top10") @GetMapping("/top10") public CommonResult<List<StatisticsEventsVO.Top10VO>> top10(@Validated CockpitVO params) { checkApiUtil.cockpit(params); List<StatisticsEventsVO.Top10VO> ls = new ArrayList<>(); ls.add(new StatisticsEventsVO.Top10VO("xx中队", 100.0)); ls.add(new StatisticsEventsVO.Top10VO("xx中队", 90.0)); ls.add(new StatisticsEventsVO.Top10VO("xx中队", 80.0)); ls.add(new StatisticsEventsVO.Top10VO("xx中队", 70.0)); return CommonResult.success(ls); // checkApiUtil.cockpit(params); // List<StatisticsEventsVO.Top10VO> ls = new ArrayList<>(); // ls.add(new StatisticsEventsVO.Top10VO("xx中队", 100.0)); // ls.add(new StatisticsEventsVO.Top10VO("xx中队", 90.0)); // ls.add(new StatisticsEventsVO.Top10VO("xx中队", 80.0)); // ls.add(new StatisticsEventsVO.Top10VO("xx中队", 70.0)); // return CommonResult.success(ls); String beginTime = params.getBeginTime(); String endTime = params.getEndTime(); List<StatisticsEventsVO.Top10VO> res = iApiDataService.listTop10(beginTime, endTime); return CommonResult.success(res); } ycl-platform/src/main/java/com/ycl/mapper/apidata/ApiDataMapper.java
New file @@ -0,0 +1,9 @@ package com.ycl.mapper.apidata; import com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO; import java.util.List; public interface ApiDataMapper { List<StatisticsEventsVO.Top10VO> listTop10(String beginTime, String endTime); } ycl-platform/src/main/java/com/ycl/service/apidata/IApiDataService.java
New file @@ -0,0 +1,10 @@ package com.ycl.service.apidata; import com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO; import java.util.List; public interface IApiDataService { List<StatisticsEventsVO.Top10VO> listTop10(String beginTime, String endTime); } ycl-platform/src/main/java/com/ycl/service/apidata/impl/IApiDataServiceImpl.java
New file @@ -0,0 +1,22 @@ package com.ycl.service.apidata.impl; import com.ycl.mapper.apidata.ApiDataMapper; import com.ycl.service.apidata.IApiDataService; import com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; @Service public class IApiDataServiceImpl implements IApiDataService { @Resource private ApiDataMapper apiDataMapper; @Override public List<StatisticsEventsVO.Top10VO> listTop10(String beginTime, String endTime) { return apiDataMapper.listTop10(beginTime, endTime); } } ycl-platform/src/main/resources/mapper/apidata/ApiDataMapper.xml
New file @@ -0,0 +1,21 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ycl.mapper.apidata.ApiDataMapper"> <select id="listTop10" resultType="com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO$Top10VO"> SELECT NAME , IFNULL(month_index_number,0) month_index_number FROM ums_team_construction <where> <if test="beginTime !='' and endTime !='' and beginTime!=null and endTime !=null"> and create_time between #{beginTime} and #{endTime} </if> </where> ORDER BY month_index_number DESC LIMIT 10 </select> </mapper>