| @@ -138,19 +138,16 @@ public class WxUserStructureController extends BaseController { | |||||
| dto.setTenantId(getTenantId()); | dto.setTenantId(getTenantId()); | ||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| List<Long> 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(); | Map userWithCar = new HashMap(); | ||||
| userWithCar.put("title","已绑定车牌"); | userWithCar.put("title","已绑定车牌"); | ||||
| userWithCar.put("count",userCountWithCar); | userWithCar.put("count",userCountWithCar); | ||||
| long userCountWithoutCar = idList.size()-userCountWithCar; | |||||
| long userCountWithoutCar = total-userCountWithCar; | |||||
| Map userWithoutCar = new HashMap(); | Map userWithoutCar = new HashMap(); | ||||
| userWithoutCar.put("title","未绑定车牌"); | userWithoutCar.put("title","未绑定车牌"); | ||||
| @@ -22,7 +22,4 @@ public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, S | |||||
| long findCountByScore(WxCUserBasicInfoDto dto); | long findCountByScore(WxCUserBasicInfoDto dto); | ||||
| long findCount(WxCUserBasicInfoDto dto); | long findCount(WxCUserBasicInfoDto dto); | ||||
| List<Long> findIdList(WxCUserBasicInfoDto dto); | |||||
| } | } | ||||
| @@ -2,11 +2,12 @@ package com.iformall.mapper; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||||
| import com.iformall.domain.po.WxCUserCar; | import com.iformall.domain.po.WxCUserCar; | ||||
| public interface WxCUserCarMapper extends CommonMapper<WxCUserCar, Long> { | public interface WxCUserCarMapper extends CommonMapper<WxCUserCar, Long> { | ||||
| List<WxCUserCar> findList(WxCUserCar wxCUserCar); | List<WxCUserCar> findList(WxCUserCar wxCUserCar); | ||||
| Integer countList(WxCUserCar wxCUserCar); | Integer countList(WxCUserCar wxCUserCar); | ||||
| Integer countUser(WxCUserCar wxCUserCar); | |||||
| Integer countUser(WxCUserBasicInfoDto dto); | |||||
| } | } | ||||
| @@ -98,13 +98,6 @@ public interface WxCUserBasicInfoService { | |||||
| */ | */ | ||||
| long findCountByScore(WxCUserBasicInfoDto dto); | long findCountByScore(WxCUserBasicInfoDto dto); | ||||
| /** | |||||
| * 查找id列表 | |||||
| * | |||||
| * @param dto | |||||
| * @return | |||||
| */ | |||||
| List<Long> findIdList(WxCUserBasicInfoDto dto); | |||||
| void exportData(HttpServletRequest request, HttpServletResponse response, String tenantId); | void exportData(HttpServletRequest request, HttpServletResponse response, String tenantId); | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.iformall.service; | package com.iformall.service; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||||
| import com.iformall.domain.po.WxCUserCar; | import com.iformall.domain.po.WxCUserCar; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -36,10 +37,10 @@ public interface WxCUserCarService { | |||||
| /** | /** | ||||
| * 根据实体查询count | * 根据实体查询count | ||||
| * | * | ||||
| * @param record | |||||
| * @param dto | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| Integer countUser(WxCUserCar record); | |||||
| Integer countUser(WxCUserBasicInfoDto dto); | |||||
| /** | /** | ||||
| * 根据实体查询 | * 根据实体查询 | ||||
| * | * | ||||
| @@ -143,12 +143,6 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| return wxCUserBasicInfoMapper.findCountByScore(dto); | return wxCUserBasicInfoMapper.findCountByScore(dto); | ||||
| } | } | ||||
| @Override | |||||
| public List<Long> findIdList(WxCUserBasicInfoDto dto) | |||||
| { | |||||
| return wxCUserBasicInfoMapper.findIdList(dto); | |||||
| } | |||||
| @Override | @Override | ||||
| public void exportData(HttpServletRequest request, HttpServletResponse response, String tenantId) { | public void exportData(HttpServletRequest request, HttpServletResponse response, String tenantId) { | ||||
| @@ -3,6 +3,7 @@ package com.iformall.service.impl; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||||
| import com.iformall.domain.po.WxCUserCar; | import com.iformall.domain.po.WxCUserCar; | ||||
| import com.iformall.mapper.WxCUserCarMapper; | import com.iformall.mapper.WxCUserCarMapper; | ||||
| import com.iformall.service.WxCUserCarService; | import com.iformall.service.WxCUserCarService; | ||||
| @@ -36,8 +37,8 @@ public class WxCUserCarServiceImpl implements WxCUserCarService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public Integer countUser(WxCUserCar record) { | |||||
| return wxCUserCarMapper.countUser(record); | |||||
| public Integer countUser(WxCUserBasicInfoDto dto) { | |||||
| return wxCUserCarMapper.countUser(dto); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -87,11 +88,4 @@ public class WxCUserCarServiceImpl implements WxCUserCarService { | |||||
| wxCUserCarMapper.delete(record); | wxCUserCarMapper.delete(record); | ||||
| } | } | ||||
| } | } | ||||
| @@ -194,16 +194,4 @@ | |||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| <select id="findIdList" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> | |||||
| select id from wx_c_user_basic_info where 1=1 | |||||
| <if test=" null != startTime "> | |||||
| and create_date >= #{startTime} | |||||
| </if> | |||||
| <if test=" null != endTime"> | |||||
| and create_date < #{endTime} | |||||
| </if> | |||||
| <if test="null != tenantId"> | |||||
| and tenant_id =#{tenantId} | |||||
| </if> | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||
| @@ -77,17 +77,19 @@ | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </select> | ||||
| <select id="countUser" parameterType="com.iformall.domain.po.WxCUserCar" resultType="java.lang.Integer"> | |||||
| select count(DISTINCT c_user_id) from wx_c_user_car | |||||
| where 1=1 | |||||
| <select id="countUser" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Integer"> | |||||
| 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 | |||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` = #{tenantId} | |||||
| and uc.tenant_id = #{tenantId} | |||||
| and ubi.tenant_id = #{tenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != ids "> | |||||
| and c_user_id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| <if test=" null != startTime "> | |||||
| and ubi.create_date >= #{startTime} | |||||
| </if> | </if> | ||||
| <if test=" null != endTime"> | |||||
| and ubi.create_date < #{endTime} | |||||
| </if> | |||||
| </select> | </select> | ||||
| </mapper> | </mapper> | ||||