| @@ -361,7 +361,7 @@ public class WxUserStructureController extends BaseController { | |||||
| dto.setReportType(reportType); | dto.setReportType(reportType); | ||||
| List<UserCountVo> wxCountList = new ArrayList<>();//每日新增会员数 | List<UserCountVo> wxCountList = new ArrayList<>();//每日新增会员数 | ||||
| List<UserCountVo> wxCounts = wxCUserService.findCountHistory(dto);//每日新增会员数 | |||||
| List<UserCountVo> wxCounts = wxCUserService.findCountHistory(dto,tenantEntitys);//每日新增会员数 | |||||
| List<UserCountVo> memCountList = new ArrayList<>();//每日新增会员数 | List<UserCountVo> memCountList = new ArrayList<>();//每日新增会员数 | ||||
| List<UserCountVo> memCounts = wxCUserBasicInfoService.findCountHistory(ifParentUpdateTenantInfo(),dto);//每日新增会员数 | List<UserCountVo> memCounts = wxCUserBasicInfoService.findCountHistory(ifParentUpdateTenantInfo(),dto);//每日新增会员数 | ||||
| @@ -471,6 +471,9 @@ public class WxUserStructureController extends BaseController { | |||||
| Integer pageNum, Integer pageSize) { | Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserByChannel"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserByChannel"); | ||||
| List<String> sceneList = null; | List<String> sceneList = null; | ||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| if (StringUtils.isNotBlank(wxCUser.getChannelName())) { | if (StringUtils.isNotBlank(wxCUser.getChannelName())) { | ||||
| WxUserChannel c = new WxUserChannel(); | WxUserChannel c = new WxUserChannel(); | ||||
| c.setChannelName(wxCUser.getChannelName()); | c.setChannelName(wxCUser.getChannelName()); | ||||
| @@ -483,7 +486,7 @@ public class WxUserStructureController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| wxCUser.setSceneList(sceneList); | wxCUser.setSceneList(sceneList); | ||||
| PageInfo<WxCUser> page = wxCUserService.listByChannel(wxCUser, pageNum, pageSize); | |||||
| PageInfo<WxCUser> page = wxCUserService.listByChannel(wxCUser,tenantEntitys, pageNum, pageSize); | |||||
| for (WxCUser u : page.getList()) { | for (WxCUser u : page.getList()) { | ||||
| WxUserChannel c = new WxUserChannel(); | WxUserChannel c = new WxUserChannel(); | ||||
| c.setSceneAddress(u.getSceneAddress()); | c.setSceneAddress(u.getSceneAddress()); | ||||
| @@ -508,6 +511,8 @@ public class WxUserStructureController extends BaseController { | |||||
| List<WxUserChannel> channelStructureList = new ArrayList<>(); | List<WxUserChannel> channelStructureList = new ArrayList<>(); | ||||
| List<WxUserChannel> senceStructureList = new ArrayList<>(); | List<WxUserChannel> senceStructureList = new ArrayList<>(); | ||||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(getTenantInfo()); | |||||
| List<WxUserChannel> channels = wxUserChannelService.findDistinctChannel(); | List<WxUserChannel> channels = wxUserChannelService.findDistinctChannel(); | ||||
| for (WxUserChannel w : channels) { | for (WxUserChannel w : channels) { | ||||
| WxUserChannel c = new WxUserChannel(); | WxUserChannel c = new WxUserChannel(); | ||||
| @@ -521,7 +526,7 @@ public class WxUserStructureController extends BaseController { | |||||
| wxCUser.setSceneList(scene); | wxCUser.setSceneList(scene); | ||||
| WxUserChannel senceStructure = new WxUserChannel(); | WxUserChannel senceStructure = new WxUserChannel(); | ||||
| senceStructure.setDescription(uc.getDescription()); | senceStructure.setDescription(uc.getDescription()); | ||||
| senceStructure.setCount(wxCUserService.countByChannel(wxCUser)); | |||||
| senceStructure.setCount(wxCUserService.countByChannel(tenantEntitys,wxCUser)); | |||||
| senceStructureList.add(senceStructure); | senceStructureList.add(senceStructure); | ||||
| sceneList.add(uc.getSceneAddress()); | sceneList.add(uc.getSceneAddress()); | ||||
| } | } | ||||
| @@ -529,7 +534,7 @@ public class WxUserStructureController extends BaseController { | |||||
| wxCUser.setSceneList(sceneList); | wxCUser.setSceneList(sceneList); | ||||
| WxUserChannel channelStructure = new WxUserChannel(); | WxUserChannel channelStructure = new WxUserChannel(); | ||||
| channelStructure.setChannelName(w.getChannelName()); | channelStructure.setChannelName(w.getChannelName()); | ||||
| channelStructure.setCount(wxCUserService.countByChannel(wxCUser)); | |||||
| channelStructure.setCount(wxCUserService.countByChannel(tenantEntitys,wxCUser)); | |||||
| channelStructureList.add(channelStructure); | channelStructureList.add(channelStructure); | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,12 +1,11 @@ | |||||
| package com.iformall.mapper; | package com.iformall.mapper; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | |||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | import com.iformall.domain.dto.WxCUserBasicInfoDto; | ||||
| import com.iformall.domain.po.WxCUser; | import com.iformall.domain.po.WxCUser; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.UserCountVo; | import com.iformall.domain.vo.UserCountVo; | ||||
| import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
| @@ -24,11 +23,11 @@ public interface WxCUserMapper extends CommonMapper<WxCUser, Long> { | |||||
| long findCount(WxCUserBasicInfoDto dto); | long findCount(WxCUserBasicInfoDto dto); | ||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto); | |||||
| List<UserCountVo> findCountHistory(@Param("tenantEntitys")List<TenantEntity> tenantEntitys, @Param("basicDto")WxCUserBasicInfoDto dto); | |||||
| List<WxCUser> listByChannel(WxCUser wxCUser); | |||||
| List<WxCUser> listByChannel(@Param("tenantEntitys")List<TenantEntity> tenantEntitys, @Param("wxCUser")WxCUser wxCUser); | |||||
| long countByChannel(WxCUser wxCUser); | |||||
| long countByChannel(List<TenantEntity> tenantEntitys, WxCUser wxCUser); | |||||
| //List<Map<String, Object>> checkCountByTenantOpenId(); | //List<Map<String, Object>> checkCountByTenantOpenId(); | ||||
| @@ -101,21 +101,23 @@ public interface WxCUserService { | |||||
| /** | /** | ||||
| * 统计数量 | * 统计数量 | ||||
| * @param dto | * @param dto | ||||
| * @param tenantEntitys | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto); | |||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys); | |||||
| /** | /** | ||||
| * 通过渠道获取会员信息 | * 通过渠道获取会员信息 | ||||
| * @param user | * @param user | ||||
| * @param tenantEntitys | |||||
| * @param pageIndex | * @param pageIndex | ||||
| * @param pageSize | * @param pageSize | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<WxCUser> listByChannel(WxCUser user, Integer pageIndex, Integer pageSize); | |||||
| PageInfo<WxCUser> listByChannel(WxCUser user, List<TenantEntity> tenantEntitys, Integer pageIndex, Integer pageSize); | |||||
| long countByChannel(WxCUser user); | |||||
| long countByChannel(List<TenantEntity> tenantEntitys, WxCUser user); | |||||
| /** | /** | ||||
| * 登录后发消息 | * 登录后发消息 | ||||
| @@ -233,18 +233,18 @@ public class WxCUserServiceImpl implements WxCUserService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto) { | |||||
| return wxCUserMapper.findCountHistory(dto); | |||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys) { | |||||
| return wxCUserMapper.findCountHistory(tenantEntitys,dto); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public PageInfo<WxCUser> listByChannel(WxCUser user, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserMapper.listByChannel(user)); | |||||
| public PageInfo<WxCUser> listByChannel(WxCUser user, List<TenantEntity> tenantEntitys, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserMapper.listByChannel(tenantEntitys,user)); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public long countByChannel(WxCUser user) { | |||||
| return wxCUserMapper.countByChannel(user); | |||||
| public long countByChannel(List<TenantEntity> tenantEntitys, WxCUser user) { | |||||
| return wxCUserMapper.countByChannel(tenantEntitys, user); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -1033,7 +1033,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| String oneWeekEndDate = DateUtils.getTimeBefore(1, new Date()); | String oneWeekEndDate = DateUtils.getTimeBefore(1, new Date()); | ||||
| SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||||
| WxCUserBasicInfoDto wxCUserBasicInfoDto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto wxCUserBasicInfoDto = new WxCUserBasicInfoDto(); | ||||
| wxCUserBasicInfoDto.updateTenantInfo(tenantEntity); | |||||
| // wxCUserBasicInfoDto.updateTenantInfo(tenantEntity); | |||||
| try { | try { | ||||
| wxCUserBasicInfoDto.setStartTime(sdf.parse(oneWeekStartdate)); | wxCUserBasicInfoDto.setStartTime(sdf.parse(oneWeekStartdate)); | ||||
| wxCUserBasicInfoDto.setEndTime(sdf.parse(oneWeekEndDate)); | wxCUserBasicInfoDto.setEndTime(sdf.parse(oneWeekEndDate)); | ||||
| @@ -1043,7 +1043,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| datamap.put("oneWeekNewCarUserCount", wxCUserCarService.countUser(wxCUserBasicInfoDto,tenantEntitys)); | datamap.put("oneWeekNewCarUserCount", wxCUserCarService.countUser(wxCUserBasicInfoDto,tenantEntitys)); | ||||
| //停车会员总数 | //停车会员总数 | ||||
| wxCUserBasicInfoDto = new WxCUserBasicInfoDto(); | wxCUserBasicInfoDto = new WxCUserBasicInfoDto(); | ||||
| wxCUserBasicInfoDto.updateTenantInfo(tenantEntity); | |||||
| // wxCUserBasicInfoDto.updateTenantInfo(tenantEntity); | |||||
| datamap.put("newCarUserSumCount", wxCUserCarService.countUser(wxCUserBasicInfoDto,tenantEntitys)); | datamap.put("newCarUserSumCount", wxCUserCarService.countUser(wxCUserBasicInfoDto,tenantEntitys)); | ||||
| return new ResultData(datamap); | return new ResultData(datamap); | ||||
| @@ -1056,8 +1056,10 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| private ResultData getCarNewMemberCountInWeek(TenantEntity tenantEntity) { | private ResultData getCarNewMemberCountInWeek(TenantEntity tenantEntity) { | ||||
| // List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| HashMap<String, Object> weekParams = new HashMap<>(); | HashMap<String, Object> weekParams = new HashMap<>(); | ||||
| // weekParams.put("tenantEntitys", tenantEntitys); | |||||
| weekParams.put("tenantId", tenantEntity.getTenantId()); | weekParams.put("tenantId", tenantEntity.getTenantId()); | ||||
| weekParams.put("finalTenantId", tenantEntity.getFinalTenantId()); | weekParams.put("finalTenantId", tenantEntity.getFinalTenantId()); | ||||
| if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | ||||
| @@ -1962,6 +1964,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| private ResultData getFromChannelAnalysis(TenantEntity tenantEntity) { | private ResultData getFromChannelAnalysis(TenantEntity tenantEntity) { | ||||
| List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| List<WxUserChannel> channelStructureList = new ArrayList<>(); | List<WxUserChannel> channelStructureList = new ArrayList<>(); | ||||
| WxCUser wxCUser = new WxCUser(); | WxCUser wxCUser = new WxCUser(); | ||||
| @@ -1982,7 +1985,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| wxCUser.setSceneList(sceneList); | wxCUser.setSceneList(sceneList); | ||||
| WxUserChannel channelStructure = new WxUserChannel(); | WxUserChannel channelStructure = new WxUserChannel(); | ||||
| channelStructure.setChannelName(w.getChannelName()); | channelStructure.setChannelName(w.getChannelName()); | ||||
| channelStructure.setCount(wxCUserMapper.countByChannel(wxCUser)); | |||||
| channelStructure.setCount(wxCUserMapper.countByChannel(tenantEntitys,wxCUser)); | |||||
| channelStructureList.add(channelStructure); | channelStructureList.add(channelStructure); | ||||
| } | } | ||||
| } | } | ||||
| @@ -2069,6 +2072,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| private ResultData getSceneAnalysis(TenantEntity tenantEntity) { | private ResultData getSceneAnalysis(TenantEntity tenantEntity) { | ||||
| List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| List<WxUserChannel> senceStructureList = new ArrayList<>(); | List<WxUserChannel> senceStructureList = new ArrayList<>(); | ||||
| WxCUser wxCUser = new WxCUser(); | WxCUser wxCUser = new WxCUser(); | ||||
| @@ -2085,7 +2089,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| wxCUser.setSceneList(scene); | wxCUser.setSceneList(scene); | ||||
| WxUserChannel senceStructure = new WxUserChannel(); | WxUserChannel senceStructure = new WxUserChannel(); | ||||
| senceStructure.setDescription(uc.getDescription()); | senceStructure.setDescription(uc.getDescription()); | ||||
| senceStructure.setCount(wxCUserMapper.countByChannel(wxCUser)); | |||||
| senceStructure.setCount(wxCUserMapper.countByChannel(tenantEntitys, wxCUser)); | |||||
| senceStructureList.add(senceStructure); | senceStructureList.add(senceStructure); | ||||
| } | } | ||||
| } | } | ||||
| @@ -123,7 +123,8 @@ | |||||
| <select id="queryCarCountHistory" resultType="hashmap" parameterType="hashmap"> | <select id="queryCarCountHistory" resultType="hashmap" parameterType="hashmap"> | ||||
| SELECT count(DISTINCT c.id) count, c.create_time FROM | SELECT count(DISTINCT c.id) count, c.create_time FROM | ||||
| (SELECT ubi.id as id, DATE_FORMAT(uc.create_date, '%m/%d') create_time FROM wx_c_user_car uc, wx_c_user_basic_info ubi | |||||
| (SELECT ubi.id as id, DATE_FORMAT(uc.create_date, '%m/%d') create_time | |||||
| FROM wx_c_user_car uc, wx_c_user_basic_info ubi | |||||
| WHERE uc.c_user_id = ubi.id | WHERE uc.c_user_id = ubi.id | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and uc.tenant_id = #{tenantId} | and uc.tenant_id = #{tenantId} | ||||
| @@ -268,97 +268,106 @@ | |||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| <select id="findCountHistory" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="com.iformall.domain.vo.UserCountVo"> | |||||
| <select id="findCountHistory" resultType="com.iformall.domain.vo.UserCountVo"> | |||||
| select count(id) as incCount, | select count(id) as incCount, | ||||
| <if test="1 == reportType "> | |||||
| <if test="1 == basicDto.reportType "> | |||||
| date_format(create_date, '%Y-%m-%d') as reportTime, | date_format(create_date, '%Y-%m-%d') as reportTime, | ||||
| </if> | </if> | ||||
| <if test="2 == reportType "> | |||||
| <if test="2 == basicDto.reportType "> | |||||
| date_format(create_date, '%Y-%m') as reportTime, | date_format(create_date, '%Y-%m') as reportTime, | ||||
| </if> | </if> | ||||
| <if test="3 == reportType "> | |||||
| <if test="3 == basicDto.reportType "> | |||||
| date_format(create_date, '%Y') as reportTime, | date_format(create_date, '%Y') as reportTime, | ||||
| </if> | </if> | ||||
| <if test="1 == reportType or 2 == reportType or 3 == reportType"> | |||||
| (select count(id) from wx_c_user where | |||||
| <if test="1 == reportType "> | |||||
| <if test="1 == basicDto.reportType or 2 == basicDto.reportType or 3 == basicDto.reportType"> | |||||
| (select count(id) from | |||||
| (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_c_user${tenantEntity.shardTableSuffix} | |||||
| </foreach>) wx_c_user where | |||||
| <if test="1 == basicDto.reportType "> | |||||
| date_format(create_date, '%Y-%m-%d') <= reportTime | date_format(create_date, '%Y-%m-%d') <= reportTime | ||||
| </if> | </if> | ||||
| <if test="2 == reportType "> | |||||
| <if test="2 == basicDto.reportType "> | |||||
| date_format(create_date, '%Y-%m') <= reportTime | date_format(create_date, '%Y-%m') <= reportTime | ||||
| </if> | </if> | ||||
| <if test="3 == reportType "> | |||||
| <if test="3 == basicDto.reportType "> | |||||
| date_format(create_date, '%Y') <= reportTime | date_format(create_date, '%Y') <= reportTime | ||||
| </if> | </if> | ||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| <if test=" null != basicDto.tenantId and '' != basicDto.tenantId"> | |||||
| and `tenant_id` = #{basicDto.tenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| <if test=" null != basicDto.parentTenantId and '' != basicDto.parentTenantId"> | |||||
| and `parent_tenant_id` = #{basicDto.parentTenantId} | |||||
| </if> | </if> | ||||
| ) as totalCount | ) as totalCount | ||||
| </if> | </if> | ||||
| from wx_c_user where 1=1 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_c_user${tenantEntity.shardTableSuffix} | |||||
| </foreach>) wx_c_user where 1=1 | |||||
| <if test=" null != basicDto.tenantId and '' != basicDto.tenantId"> | |||||
| and `tenant_id` = #{basicDto.tenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| <if test=" null != basicDto.parentTenantId and '' != basicDto.parentTenantId"> | |||||
| and `parent_tenant_id` = #{basicDto.parentTenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != startTime "> | |||||
| and create_date >= #{startTime} | |||||
| <if test=" null != basicDto.startTime "> | |||||
| and create_date >= #{basicDto.startTime} | |||||
| </if> | </if> | ||||
| <if test=" null != endTime"> | |||||
| and create_date < #{endTime} | |||||
| <if test=" null != basicDto.endTime"> | |||||
| and create_date < #{basicDto.endTime} | |||||
| </if> | </if> | ||||
| <if test="1 == reportType or 2 == reportType or 3 == reportType"> | |||||
| <if test="1 == basicDto.reportType or 2 == basicDto.reportType or 3 == basicDto.reportType"> | |||||
| group by reportTime | group by reportTime | ||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| <select id="listByChannel" resultMap="BaseResultMap" > | <select id="listByChannel" resultMap="BaseResultMap" > | ||||
| select id,user_id,nick_name,phone,create_date,scene_address from wx_c_user where 1=1 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| select id,user_id,nick_name,phone,create_date,scene_address from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_c_user${tenantEntity.shardTableSuffix} | |||||
| </foreach>) wx_c_user where 1=1 | |||||
| <if test=" null != wxCUser.tenantId and '' != wxCUser.tenantId"> | |||||
| and `tenant_id` = #{wxCUser.tenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| <if test=" null != wxCUser.parentTenantId and '' != wxCUser.parentTenantId"> | |||||
| and `parent_tenant_id` = #{wxCUser.parentTenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != startDate "> | |||||
| and create_date >= #{startDate} | |||||
| <if test=" null != wxCUser.startDate "> | |||||
| and create_date >= #{wxCUser.startDate} | |||||
| </if> | </if> | ||||
| <if test=" null != endDate"> | |||||
| and create_date < #{endDate} | |||||
| <if test=" null != wxCUser.endDate"> | |||||
| and create_date < #{wxCUser.endDate} | |||||
| </if> | </if> | ||||
| <if test=" sceneList!= null "> | |||||
| <if test=" wxCUser.sceneList!= null "> | |||||
| and scene_address in | and scene_address in | ||||
| <foreach collection="sceneList" index="index" item="scene" open="(" separator="," close=")"> | |||||
| <foreach collection="wxCUser.sceneList" index="index" item="scene" open="(" separator="," close=")"> | |||||
| #{scene} | #{scene} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| <if test=" null == sortColumns"> order by create_date desc </if> | |||||
| <if test=" null != wxCUser.sortColumns"> order by ${wxCUser.sortColumns} </if> | |||||
| <if test=" null == wxCUser.sortColumns"> order by create_date desc </if> | |||||
| </select> | </select> | ||||
| <select id="countByChannel" resultType="java.lang.Long" > | <select id="countByChannel" resultType="java.lang.Long" > | ||||
| select count(id) from wx_c_user where 1=1 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| select count(id) from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_c_user${tenantEntity.shardTableSuffix} | |||||
| </foreach>) wx_c_user where 1=1 | |||||
| <if test=" null != wxCUser.tenantId and '' != wxCUser.tenantId"> | |||||
| and `tenant_id` = #{wxCUser.tenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| <if test=" null != wxCUser.parentTenantId and '' != wxCUser.parentTenantId"> | |||||
| and `parent_tenant_id` = #{wxCUser.parentTenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != startDate "> | |||||
| and create_date >= #{startDate} | |||||
| <if test=" null != wxCUser.startDate "> | |||||
| and create_date >= #{wxCUser.startDate} | |||||
| </if> | </if> | ||||
| <if test=" null != endDate"> | |||||
| and create_date < #{endDate} | |||||
| <if test=" null != wxCUser.endDate"> | |||||
| and create_date < #{wxCUser.endDate} | |||||
| </if> | </if> | ||||
| <if test=" sceneList!= null "> | |||||
| <if test=" wxCUser.sceneList!= null "> | |||||
| and scene_address in | and scene_address in | ||||
| <foreach collection="sceneList" index="index" item="scene" open="(" separator="," close=")"> | |||||
| <foreach collection="wxCUser.sceneList" index="index" item="scene" open="(" separator="," close=")"> | |||||
| #{scene} | #{scene} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||