From aa3d45b6e3cecd90173e204f8a6975efa84da3f5 Mon Sep 17 00:00:00 2001 From: hupeng Date: Wed, 31 Oct 2018 10:11:59 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BC=9A=E5=91=98][=E4=BF=AE=E5=A4=8D]:?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=9A=E5=91=98=E7=BB=91=E8=BD=A6=E7=89=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WxUserStructureController.java | 9 +++------ .../mapper/WxCUserBasicInfoMapper.java | 3 --- .../com/iformall/mapper/WxCUserCarMapper.java | 3 ++- .../service/WxCUserBasicInfoService.java | 7 ------- .../iformall/service/WxCUserCarService.java | 5 +++-- .../impl/WxCUserBasicInfoServiceImpl.java | 6 ------ .../service/impl/WxCUserCarServiceImpl.java | 12 +++-------- .../mapper/WxCUserBasicInfoMapper.xml | 12 ----------- .../resources/mapper/WxCUserCarMapper.xml | 20 ++++++++++--------- 9 files changed, 22 insertions(+), 55 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/WxUserStructureController.java b/mallinkAdmin/src/main/java/com/iformall/controller/WxUserStructureController.java index eec416f8a..0f27f8463 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/WxUserStructureController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/WxUserStructureController.java @@ -138,19 +138,16 @@ public class WxUserStructureController extends BaseController { dto.setTenantId(getTenantId()); dto.setStartTime(startTime); dto.setEndTime(endTime); - List idList = wxCUserBasicInfoService.findIdList(dto); + long total = wxCUserBasicInfoService.findCount(dto); - WxCUserCar wxCUserCar = new WxCUserCar(); - wxCUserCar.setTenantId(getTenantId()); - wxCUserCar.setIds(idList); //注:countUser接口通过ids传递user_id list. - long userCountWithCar = wxCUserCarService.countUser(wxCUserCar); + long userCountWithCar = wxCUserCarService.countUser(dto); Map userWithCar = new HashMap(); userWithCar.put("title","已绑定车牌"); userWithCar.put("count",userCountWithCar); - long userCountWithoutCar = idList.size()-userCountWithCar; + long userCountWithoutCar = total-userCountWithCar; Map userWithoutCar = new HashMap(); userWithoutCar.put("title","未绑定车牌"); diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java index c3113e8ae..aa7919bea 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java @@ -22,7 +22,4 @@ public interface WxCUserBasicInfoMapper extends CommonMapper findIdList(WxCUserBasicInfoDto dto); - } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCUserCarMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCUserCarMapper.java index ba46a95a9..91cdb2ba8 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCUserCarMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCUserCarMapper.java @@ -2,11 +2,12 @@ package com.iformall.mapper; import java.util.*; import com.iformall.common.CommonMapper; +import com.iformall.domain.dto.WxCUserBasicInfoDto; import com.iformall.domain.po.WxCUserCar; public interface WxCUserCarMapper extends CommonMapper { List findList(WxCUserCar wxCUserCar); Integer countList(WxCUserCar wxCUserCar); - Integer countUser(WxCUserCar wxCUserCar); + Integer countUser(WxCUserBasicInfoDto dto); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java b/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java index 3872e133e..4891402e4 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java @@ -98,13 +98,6 @@ public interface WxCUserBasicInfoService { */ long findCountByScore(WxCUserBasicInfoDto dto); - /** - * 查找id列表 - * - * @param dto - * @return - */ - List findIdList(WxCUserBasicInfoDto dto); void exportData(HttpServletRequest request, HttpServletResponse response, String tenantId); diff --git a/mallinkService/src/main/java/com/iformall/service/WxCUserCarService.java b/mallinkService/src/main/java/com/iformall/service/WxCUserCarService.java index d89691cf5..64960af1a 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCUserCarService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCUserCarService.java @@ -1,6 +1,7 @@ package com.iformall.service; import com.github.pagehelper.PageInfo; +import com.iformall.domain.dto.WxCUserBasicInfoDto; import com.iformall.domain.po.WxCUserCar; import java.util.List; @@ -36,10 +37,10 @@ public interface WxCUserCarService { /** * 根据实体查询count * - * @param record + * @param dto * @return */ - Integer countUser(WxCUserCar record); + Integer countUser(WxCUserBasicInfoDto dto); /** * 根据实体查询 * diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java index cb8bfb097..a8239f896 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java @@ -143,12 +143,6 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { return wxCUserBasicInfoMapper.findCountByScore(dto); } - @Override - public List findIdList(WxCUserBasicInfoDto dto) - { - return wxCUserBasicInfoMapper.findIdList(dto); - } - @Override public void exportData(HttpServletRequest request, HttpServletResponse response, String tenantId) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserCarServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserCarServiceImpl.java index 9c7846242..f5f3a18fd 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserCarServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserCarServiceImpl.java @@ -3,6 +3,7 @@ package com.iformall.service.impl; import java.util.*; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import com.iformall.domain.dto.WxCUserBasicInfoDto; import com.iformall.domain.po.WxCUserCar; import com.iformall.mapper.WxCUserCarMapper; import com.iformall.service.WxCUserCarService; @@ -36,8 +37,8 @@ public class WxCUserCarServiceImpl implements WxCUserCarService { } @Override - public Integer countUser(WxCUserCar record) { - return wxCUserCarMapper.countUser(record); + public Integer countUser(WxCUserBasicInfoDto dto) { + return wxCUserCarMapper.countUser(dto); } @Override @@ -87,11 +88,4 @@ public class WxCUserCarServiceImpl implements WxCUserCarService { wxCUserCarMapper.delete(record); } - - - - - - - } diff --git a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml index 6290247c4..18f151397 100644 --- a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml @@ -194,16 +194,4 @@ - diff --git a/mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml index a366412b8..134b478cd 100644 --- a/mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml @@ -77,17 +77,19 @@ - + select count(DISTINCT uc.c_user_id) from wx_c_user_car uc, wx_c_user_basic_info ubi + where uc.c_user_id = ubi.id - and `tenant_id` = #{tenantId} + and uc.tenant_id = #{tenantId} + and ubi.tenant_id = #{tenantId} - - and c_user_id in - - #{idItem} - + + and ubi.create_date >= #{startTime} + + and ubi.create_date < #{endTime} + +