From aa29d8f4607ea115d33a003c908df197b409bede Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Tue, 9 Nov 2021 11:52:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BD=91=E6=A0=BC=E5=91=98?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E7=BB=9F=E8=AE=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/teammember/TeamMemberController.java | 10 ++++++++++ .../teammember/TeamMemberResourceController.java | 10 ++++++++++ .../service/teammember/ITeamMemberService.java | 9 +++++++++ .../service/teammember/impl/TeamMemberServiceImpl.java | 7 +++++++ .../mybatis/mapper/teammember/team-member-mapper.xml | 5 +++++ 5 files changed, 41 insertions(+) diff --git a/src/main/java/cn/com/tenlion/usercenter/controller/api/teammember/TeamMemberController.java b/src/main/java/cn/com/tenlion/usercenter/controller/api/teammember/TeamMemberController.java index 06952a3..6657b24 100644 --- a/src/main/java/cn/com/tenlion/usercenter/controller/api/teammember/TeamMemberController.java +++ b/src/main/java/cn/com/tenlion/usercenter/controller/api/teammember/TeamMemberController.java @@ -137,6 +137,16 @@ public class TeamMemberController extends DefaultBaseController { return new SuccessResultData<>(teamMemberService.count(params)); } + @ApiOperation(value = "队伍人员区域统计", notes = "队伍人员区域统计接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "areaCode", paramType = "path"), + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count/area-code/{areaCode}") + SuccessResultData countByAreaCode(@PathVariable("areaCode") String areaCode) { + return new SuccessResultData<>(teamMemberService.countByAreaCode(areaCode)); + } + @ApiOperation(value = "队伍人员列表", notes = "队伍人员列表接口") @ApiImplicitParams({ @ApiImplicitParam(name = "areaCode", value = "地区编码", paramType = "path", required = true), diff --git a/src/main/java/cn/com/tenlion/usercenter/controller/resource/teammember/TeamMemberResourceController.java b/src/main/java/cn/com/tenlion/usercenter/controller/resource/teammember/TeamMemberResourceController.java index a48db9e..d8fd3b1 100644 --- a/src/main/java/cn/com/tenlion/usercenter/controller/resource/teammember/TeamMemberResourceController.java +++ b/src/main/java/cn/com/tenlion/usercenter/controller/resource/teammember/TeamMemberResourceController.java @@ -77,6 +77,16 @@ public class TeamMemberResourceController extends DefaultBaseController { return new SuccessResultData<>(teamMemberService.count(params)); } + @ApiOperation(value = "队伍人员区域统计", notes = "队伍人员区域统计接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "areaCode", paramType = "path"), + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count/area-code/{areaCode}") + SuccessResultData countByAreaCode(@PathVariable("areaCode") String areaCode) { + return new SuccessResultData<>(teamMemberService.countByAreaCode(areaCode)); + } + @ApiOperation(value = "队伍人员列表", notes = "队伍人员列表接口") @ApiImplicitParams({ @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), diff --git a/src/main/java/cn/com/tenlion/usercenter/service/teammember/ITeamMemberService.java b/src/main/java/cn/com/tenlion/usercenter/service/teammember/ITeamMemberService.java index 6907a09..9155a9d 100644 --- a/src/main/java/cn/com/tenlion/usercenter/service/teammember/ITeamMemberService.java +++ b/src/main/java/cn/com/tenlion/usercenter/service/teammember/ITeamMemberService.java @@ -194,6 +194,14 @@ public interface ITeamMemberService { */ Integer count(Map params); + /** + * 队伍人员区域统计 + * + * @param areaCode + * @return + */ + Integer countByAreaCode(String areaCode); + /** * 队伍人员列表 * @@ -294,4 +302,5 @@ public interface ITeamMemberService { * @return */ SuccessResultList> listPageSubByAreaCodeAndSort(String areaCode, String sort, ListPage page); + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/usercenter/service/teammember/impl/TeamMemberServiceImpl.java b/src/main/java/cn/com/tenlion/usercenter/service/teammember/impl/TeamMemberServiceImpl.java index be262e0..de639e8 100644 --- a/src/main/java/cn/com/tenlion/usercenter/service/teammember/impl/TeamMemberServiceImpl.java +++ b/src/main/java/cn/com/tenlion/usercenter/service/teammember/impl/TeamMemberServiceImpl.java @@ -201,6 +201,13 @@ public class TeamMemberServiceImpl extends DefaultBaseService implements ITeamMe return count == null ? 0 : count; } + @Override + public Integer countByAreaCode(String areaCode) { + Map params = getHashMap(2); + params.put("areaCode", areaCode); + return count(params); + } + @Override public List listByTeamId(String teamId, Map params) { params.put("teamId", teamId); diff --git a/src/main/resources/mybatis/mapper/teammember/team-member-mapper.xml b/src/main/resources/mybatis/mapper/teammember/team-member-mapper.xml index 8a5686a..a9c3c18 100644 --- a/src/main/resources/mybatis/mapper/teammember/team-member-mapper.xml +++ b/src/main/resources/mybatis/mapper/teammember/team-member-mapper.xml @@ -369,6 +369,11 @@ COUNT(*) FROM city_team_member t1 + + + t1.area_code = #{areaCode} + + \ No newline at end of file