From 99fe47649aed33babe02575e98e24a0fc1738b51 Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 19 Jan 2022 17:09:08 +0800 Subject: [PATCH] =?UTF-8?q?/=E3=80=81user?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datatower/WxUserStatisticsController.java | 4 + .../controller/WxCouponChannelController.java | 1 + .../mapper/WxCUserBasicInfoMapper.java | 26 +- .../impl/WxCUserBasicInfoServiceImpl.java | 155 +--- .../mapper/WxCUserBasicInfoMapper.xml | 740 +++--------------- 5 files changed, 155 insertions(+), 771 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/datatower/WxUserStatisticsController.java b/mallinkAdmin/src/main/java/com/iformall/controller/datatower/WxUserStatisticsController.java index 920416df4..7d52eb6a6 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/datatower/WxUserStatisticsController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/datatower/WxUserStatisticsController.java @@ -219,7 +219,11 @@ public class WxUserStatisticsController extends BaseController { if (wxCountList.get(i).getTotalCount() != null && wxCountList.get(i-1).getTotalCount() != null && wxCountList.get(i).getTotalCount() < wxCountList.get(i-1).getTotalCount()){ + logger.info("修改前"+(i-1)+"=="+wxCountList.get(i-1).getTotalCount()); + logger.info("修改前"+i+"=="+wxCountList.get(i).getTotalCount()); wxCountList.get(i).setTotalCount(wxCountList.get(i-1).getTotalCount()); + logger.info("修改后"+(i-1)+"=="+wxCountList.get(i-1).getTotalCount()); + logger.info("修改后"+i+"=="+wxCountList.get(i).getTotalCount()); } } diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java index 80b3fe640..9b98b5522 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java @@ -150,6 +150,7 @@ public class WxCouponChannelController extends BaseController { wxCouponChannel.setSortColumns(BaseEntity.SortField.UpdateDate_DESC, BaseEntity.SortField.Id_DESC); List targetAds = new ArrayList<>(); targetAds.add(EnumCouponChannelType.COUPON_CHANNEL_ID_LIST.getCode()); + targetAds.add(EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN_LIST.getCode()); targetAds.add(EnumCouponChannelType.COUPON_CHANNEL_ID_TIMED.getCode()); targetAds.add(EnumCouponChannelType.COUPON_CHANNEL_ID_CARD.getCode()); targetAds.add(EnumCouponChannelType.COUPON_CHANNEL_ID_PRESS.getCode()); diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java index 1df34b105..6b497b702 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java @@ -14,13 +14,10 @@ import java.util.List; public interface WxCUserBasicInfoMapper extends CommonMapper { long findCountByFilter(WxCUserBasicInfoDto dto); - long findCountByFilter1(@Param("tenantInfo")TenantEntity tenantInfo, @Param("basicInfo")WxCUserBasicInfoDto wxCUserBasicInfo); List findListByFilter(WxCUserBasicInfoDto dto); - List findListByFilter1(@Param("tenantInfo")TenantEntity tenantInfo, @Param("basicInfo")WxCUserBasicInfoDto wxCUserBasicInfo); List findList(WxCUserBasicInfo wxCUserBasicInfo); - List findList1(@Param("tenantInfo")TenantEntity tenantInfo, @Param("basicInfo")WxCUserBasicInfo wxCUserBasicInfo); List findListPhoneAndNameByIds(WxCUserBasicInfo wxCUserBasicInfo); List findIdList(WxCUserBasicInfo wxCUserBasicInfo); @@ -35,43 +32,24 @@ public interface WxCUserBasicInfoMapper extends CommonMapper findListByScore(WxCUserBasicInfoDto dto); - List findListByScore1(@Param("tenantInfo")TenantEntity tenantInfo,@Param("basicInfo")WxCUserBasicInfoDto dto); - - List findBirthdayList(@Param("finalTenantId")String finalTenantId, @Param("begin")String begin, @Param("end")String end); - List findBirthdayList1(@Param("finalTenantId")String finalTenantId,@Param("tenantId")String tenantId,@Param("parentTenantId")String parentTenantId, @Param("begin")String begin, @Param("end")String end); + List findBirthdayList(@Param("tenantId")String tenantId,@Param("finalTenantId")String finalTenantId, @Param("begin")String begin, @Param("end")String end); long findCount(WxCUserBasicInfoDto dto); - long findCount1(@Param("tenantInfo")TenantEntity tenantInfo,@Param("basicInfo")WxCUserBasicInfoDto dto); List findCountHistory(WxCUserBasicInfoDto dto); - List findCountHistory1(@Param("tenantInfo")TenantEntity tenantInfo,@Param("basicInfo")WxCUserBasicInfoDto dto); List findVoList(WxCUserBasicInfo wxCUserBasicInfo); - List findVoIdsList(WxCUserBasicInfo wxCUserBasicInfo); - - List findVoList1(@Param("tenantInfo")TenantEntity tenantInfo, @Param("basicInfo")WxCUserBasicInfo basicInfo); - List findVoIdsList1(@Param("tenantInfo")TenantEntity tenantInfo, @Param("basicInfo")WxCUserBasicInfo basicInfo); Integer countVoList(WxCUserBasicInfo wxCUserBasicInfo); - Integer countVoList1(@Param("tenantInfo")TenantEntity tenantInfo, @Param("basicInfo")WxCUserBasicInfo basicInfo); - - - long findGrowUserCount(@Param("finalTenantId")String finalTenantId); - long findGrowUserCount1(@Param("tenantId")String tenantId,@Param("finalTenantId")String finalTenantId); - //long findImportUserCount(@Param("finalTenantId")String finalTenantId); - //long findImportUserCount1(@Param("tenantId")String tenantId,@Param("parentTenantId")String parentTenantId); + long findGrowUserCount(@Param("tenantId")String tenantId,@Param("finalTenantId")String finalTenantId); void incActRecordById(@Param("id")Long id,@Param("finalTenantId")String finalTenantId); 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 234fc07bc..00eb691a2 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java @@ -518,29 +518,19 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc @Override public long countByFilter(TenantEntity tenantEntity, List filterList) { WxCUserBasicInfoDto wxCUserBasicInfoDto = filtersToDto(tenantEntity, filterList); - if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){ - //关联微信表查询 - return wxCUserBasicInfoMapper.findCountByFilter1(tenantEntity,wxCUserBasicInfoDto); - }else{ - //直接查询本表 - wxCUserBasicInfoDto.setTenantId(tenantEntity.getFinalTenantId()); - wxCUserBasicInfoDto.setFinalTenantId(tenantEntity.getFinalTenantId()); - return wxCUserBasicInfoMapper.findCountByFilter(wxCUserBasicInfoDto); - } + + wxCUserBasicInfoDto.setTenantId(tenantEntity.getFinalTenantId()); + wxCUserBasicInfoDto.setFinalTenantId(tenantEntity.getFinalTenantId()); + return wxCUserBasicInfoMapper.findCountByFilter(wxCUserBasicInfoDto); } @Override public List listByFilter(TenantEntity tenantEntity, List filterList) { WxCUserBasicInfoDto wxCUserBasicInfoDto = filtersToDto(tenantEntity, filterList); - if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){ - //关联微信表查询 - return wxCUserBasicInfoMapper.findListByFilter1(tenantEntity,wxCUserBasicInfoDto); - }else{ - //直接查询本表 - wxCUserBasicInfoDto.setTenantId(tenantEntity.getFinalTenantId()); - wxCUserBasicInfoDto.setFinalTenantId(tenantEntity.getFinalTenantId()); - return wxCUserBasicInfoMapper.findListByFilter(wxCUserBasicInfoDto); - } + + wxCUserBasicInfoDto.setTenantId(tenantEntity.getFinalTenantId()); + wxCUserBasicInfoDto.setFinalTenantId(tenantEntity.getFinalTenantId()); + return wxCUserBasicInfoMapper.findListByFilter(wxCUserBasicInfoDto); } @Override @@ -576,14 +566,9 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc @Override public PageInfo listAsPage(TenantEntity tenantInfo, WxCUserBasicInfo wxCUserBasicInfo, Integer pageIndex, Integer pageSize) { - if(StringUtils.isNotBlank(tenantInfo.getParentTenantId())){ - //关联微信表查询 - return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserBasicInfoMapper.findList1(tenantInfo,wxCUserBasicInfo)); - }else{ - //直接查询本表 - wxCUserBasicInfo.undateFinalTenantId(tenantInfo); - return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserBasicInfoMapper.findList(wxCUserBasicInfo)); - } + wxCUserBasicInfo.setTenantId(tenantInfo.getTenantId()); + wxCUserBasicInfo.undateFinalTenantId(tenantInfo); + return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserBasicInfoMapper.findList(wxCUserBasicInfo)); } @Override @@ -784,15 +769,9 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc @Override public long findCountBySex(TenantEntity tenantInfo, WxCUserBasicInfoDto dto) { - if(StringUtils.isNotBlank(tenantInfo.getParentTenantId())){ - //关联微信表查询 - return wxCUserBasicInfoMapper.findCountBySex1(tenantInfo,dto); - }else{ - //直接查询本表 - dto.setTenantId(tenantInfo.getFinalTenantId()); - dto.setFinalTenantId(tenantInfo.getFinalTenantId()); - return wxCUserBasicInfoMapper.findCountBySex(dto); - } + dto.setTenantId(tenantInfo.getTenantId()); + dto.setFinalTenantId(tenantInfo.getFinalTenantId()); + return wxCUserBasicInfoMapper.findCountBySex(dto); } @Override @@ -802,15 +781,9 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc @Override public long findCountByAge(TenantEntity tenantInfo, WxCUserBasicInfoDto dto) { - if(StringUtils.isNotBlank(tenantInfo.getParentTenantId())){ - //关联微信表查询 - return wxCUserBasicInfoMapper.findCountByAge1(tenantInfo,dto); - }else{ - //直接查询本表 - dto.setTenantId(tenantInfo.getFinalTenantId()); - dto.setFinalTenantId(tenantInfo.getFinalTenantId()); - return wxCUserBasicInfoMapper.findCountByAge(dto); - } + dto.setTenantId(tenantInfo.getTenantId()); + dto.setFinalTenantId(tenantInfo.getFinalTenantId()); + return wxCUserBasicInfoMapper.findCountByAge(dto); } @Override @@ -820,15 +793,9 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc @Override public long findCountByScore(TenantEntity tenantInfo, WxCUserBasicInfoDto dto) { - if(StringUtils.isNotBlank(tenantInfo.getParentTenantId())){ - //关联微信表查询 - return wxCUserBasicInfoMapper.findCountByScore1(tenantInfo,dto); - }else{ - //直接查询本表 - dto.setTenantId(tenantInfo.getFinalTenantId()); - dto.setFinalTenantId(tenantInfo.getFinalTenantId()); - return wxCUserBasicInfoMapper.findCountByScore(dto); - } + dto.setTenantId(tenantInfo.getTenantId()); + dto.setFinalTenantId(tenantInfo.getFinalTenantId()); + return wxCUserBasicInfoMapper.findCountByScore(dto); } @Override @@ -838,14 +805,9 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc @Override public int exportDataCount(TenantEntity tenantInfo, WxCUserBasicInfo basicInfo) { - if(StringUtils.isNotBlank(tenantInfo.getParentTenantId())){ - //关联微信表查询 - return wxCUserBasicInfoMapper.countVoList1(tenantInfo,basicInfo); - }else{ - //直接查询本表 - basicInfo.undateFinalTenantId(tenantInfo); - return wxCUserBasicInfoMapper.countVoList(basicInfo); - } + basicInfo.setTenantId(tenantInfo.getTenantId()); + basicInfo.undateFinalTenantId(tenantInfo); + return wxCUserBasicInfoMapper.countVoList(basicInfo); } @Override @@ -1223,15 +1185,9 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc @Override public long findCount(TenantEntity tenantInfo, WxCUserBasicInfoDto dto) { - if(StringUtils.isNotBlank(tenantInfo.getParentTenantId())){ - //关联微信表查询 - return wxCUserBasicInfoMapper.findCount1(tenantInfo,dto); - }else{ - //直接查询本表 - dto.setTenantId(tenantInfo.getFinalTenantId()); - dto.setFinalTenantId(tenantInfo.getFinalTenantId()); - return wxCUserBasicInfoMapper.findCount(dto); - } + dto.setTenantId(tenantInfo.getTenantId()); + dto.setFinalTenantId(tenantInfo.getFinalTenantId()); + return wxCUserBasicInfoMapper.findCount(dto); } @Override @@ -1241,15 +1197,9 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc @Override public List findCountHistory(TenantEntity tenantInfo, WxCUserBasicInfoDto dto) { - if(StringUtils.isNotBlank(tenantInfo.getParentTenantId())){ - //关联微信表查询 - return wxCUserBasicInfoMapper.findCountHistory1(tenantInfo,dto); - }else{ - //直接查询本表 - dto.setTenantId(tenantInfo.getFinalTenantId()); - dto.setFinalTenantId(tenantInfo.getFinalTenantId()); - return wxCUserBasicInfoMapper.findCountHistory(dto); - } + dto.setTenantId(tenantInfo.getTenantId()); + dto.setFinalTenantId(tenantInfo.getFinalTenantId()); + return wxCUserBasicInfoMapper.findCountHistory(dto); } @Override @@ -1261,17 +1211,12 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc @Override public long findGrowUserCount(TenantEntity tenantEntity) { + String tenantId = tenantEntity.getTenantId(); + String finalTenantId = tenantEntity.getTenantId(); if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){ - //关联微信表查询 - return wxCUserBasicInfoMapper.findGrowUserCount1(tenantEntity.getTenantId(),tenantEntity.getFinalTenantId()); - }else{ - //直接查询本表 - String finalTenantId = tenantEntity.getTenantId(); - if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){ - finalTenantId = tenantEntity.getParentTenantId(); - } - return wxCUserBasicInfoMapper.findGrowUserCount(finalTenantId); + finalTenantId = tenantEntity.getParentTenantId(); } + return wxCUserBasicInfoMapper.findGrowUserCount(tenantId,finalTenantId); } @Override @@ -1309,30 +1254,19 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc @Override public List findListByScore(TenantEntity tenantEntity, WxCUserBasicInfoDto wxCUserBasicInfoDto) { - if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){ - //关联微信表查询 - return wxCUserBasicInfoMapper.findListByScore1(tenantEntity,wxCUserBasicInfoDto); - }else{ - //直接查询本表 - wxCUserBasicInfoDto.setTenantId(tenantEntity.getFinalTenantId()); - wxCUserBasicInfoDto.setFinalTenantId(tenantEntity.getFinalTenantId()); - return wxCUserBasicInfoMapper.findListByScore(wxCUserBasicInfoDto); - } + wxCUserBasicInfoDto.setTenantId(tenantEntity.getTenantId()); + wxCUserBasicInfoDto.setFinalTenantId(tenantEntity.getFinalTenantId()); + return wxCUserBasicInfoMapper.findListByScore(wxCUserBasicInfoDto); } @Override public List findBirthdayList(TenantEntity tenantEntity, String format, String format1) { + String tenantId = tenantEntity.getTenantId(); + String finalTenantId = tenantEntity.getTenantId(); if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){ - //关联微信表查询 - return wxCUserBasicInfoMapper.findBirthdayList1(tenantEntity.getFinalTenantId(),tenantEntity.getTenantId(),tenantEntity.getParentTenantId(),format,format1); - }else{ - //直接查询本表 - String finalTenantId = tenantEntity.getTenantId(); - if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){ - finalTenantId = tenantEntity.getParentTenantId(); - } - return wxCUserBasicInfoMapper.findBirthdayList(finalTenantId,format,format1); + finalTenantId = tenantEntity.getParentTenantId(); } + return wxCUserBasicInfoMapper.findBirthdayList(tenantId,finalTenantId,format,format1); } @Override @@ -1352,13 +1286,10 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc List list = new ArrayList(); basicInfo.setBegin((page-1)*20000); basicInfo.setLimit(20000); -// if(StringUtils.isNotBlank(tenantInfo.getParentTenantId())){ -// //list = wxCUserBasicInfoMapper.findVoList1(tenantInfo,basicInfo); -// }else{ -// basicInfo.undateFinalTenantId(tenantInfo); -// } - list = wxCUserBasicInfoMapper.findVoList1(tenantInfo,basicInfo); + basicInfo.undateFinalTenantId(tenantInfo); + basicInfo.undateFinalTenantId(tenantInfo); + list = wxCUserBasicInfoMapper.findVoList(basicInfo); if (null == list || list.size() <= 0 ) { return null; } diff --git a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml index ddbea7775..0ea686ab2 100644 --- a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml @@ -38,15 +38,13 @@ wcubi.`avatar_url`,wcubi.`credit`,wcubi.`active_time`,wcubi.`login_count`,wcubi.`act_record`, wcubi.score_date,wcubi.status - - - `id`,`phone`,`birthdate`,`education`,`sex`,`height`,`weight`,`id_card`,`email`,`address`,`poins`,`tag_id`, - `create_date`,`update_date`,`tenant_id`,`parent_tenant_id`,`name`,`nick_name`,`credit`,`active_time`,`act_record` - where wcubi.`final_tenant_id` = #{finalTenantId} + + and wcubi.`tenant_id` like concat('%,', #{tenantId},',%') + and wcubi.`id` = #{id} @@ -143,102 +141,6 @@ - - where 1 = 1 - - - and wcubi.`id` = #{basicInfo.id} - - - - and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') - - - - and wcubi.`phone` like concat('%', #{basicInfo.phone},'%') - - - - and wcubi.`birthdate` = #{basicInfo.birthdate} - - - - and wcubi.`education` like concat('%', #{basicInfo.education},'%') - - - - and wcubi.`sex` = #{basicInfo.sex} - - - - and wcubi.`email` like concat('%', #{basicInfo.email},'%') - - - - and wcubi.`address` like concat('%', #{basicInfo.address},'%') - - - - and wcubi.poins >= #{basicInfo.levelStartScore} - - - - and wcubi.poins < #{basicInfo.levelEndScore} - - - - and wcubi.`tag_id` = #{basicInfo.tagId} - - - - and wcubi.`create_date` = #{basicInfo.createDate} - - - - and wcubi.`update_date` = #{basicInfo.updateDate} - - - - and wcubi.`act_record` = #{basicInfo.actRecord} - - - - and wcubi.`name` like concat('%', #{basicInfo.name},'%') - - - and wcubi.`create_date` between #{basicInfo.startTime} and #{basicInfo.endTime} - - - - and wcubi.`active_time` between #{basicInfo.activeStartTime} and #{basicInfo.activeEndTime} - - - - and wcubi.`status` = #{basicInfo.status} - - - - and wcubi.id in (select c_user_id from wx_c_user_car - where 1=1 - - and `tenant_id` = #{tenantInfo.tenantId} - - - and `parent_tenant_id` = #{tenantInfo.parentTenantId} - - and car_number like concat('%', #{basicInfo.carNumber},'%')) - - - - and wcubi.id in - - #{idItem} - - - order by ${basicInfo.sortColumns} - - - - - update wx_c_user_basic_info set poins=#{poins} @@ -286,8 +181,9 @@ - - - - - - - cub.id,cub.phone,cub.birthdate,cub.education,cub.sex,cub.`height`,cub.`weight`,cub.`id_card`,cub.email,cub.address,cub.poins,cub.tag_id, - cub.create_date,cub.update_date,cub.name,cub.level,cub.nick_name,cub.score_date,cub.final_tenant_id + wcubi.id,wcubi.phone,wcubi.birthdate,wcubi.education,wcubi.sex,wcubi.`height`,wcubi.`weight`,wcubi.`id_card`,wcubi.email,wcubi.address,wcubi.poins,wcubi.tag_id, + wcubi.create_date,wcubi.update_date,wcubi.name,wcubi.level,wcubi.nick_name,wcubi.score_date,wcubi.final_tenant_id - - - - - - - - @@ -633,8 +364,8 @@ - - + + @@ -642,78 +373,68 @@ - - - - - cu.`id`,cu.`phone`,cu.`birthdate`,cu.`education`,cu.`sex`,cu.`height`,cu.`weight`,cu.`id_card`,cu.`email`,cu.`address`,cu.`poins`,cu.`tag_id`, - cu.`create_date`,cu.`update_date`,cu.`name`,cu.`level`,cu.`nick_name`, - cut.`tags`, - cu.`credit`,cu.`active_time`,cu.`act_record`,cu.`final_tenant_id` - - - where 1 = 1 + where wcubi.`final_tenant_id` = #{finalTenantId} - and cu.`id` = #{id} + and wcubi.`id` = #{id} - - and cu.`final_tenant_id` = #{finalTenantId} + + and wcubi.`tenant_id` like concat('%,', #{tenantId},',%') - and cu.`phone` like concat('%', #{phone},'%') + and wcubi.`phone` like concat('%', #{phone},'%') - and cu.`birthdate` = #{birthdate} + and wcubi.`birthdate` = #{birthdate} - and cu.`education` like concat('%', #{education},'%') + and wcubi.`education` like concat('%', #{education},'%') - and cu.`sex` = #{sex} + and wcubi.`sex` = #{sex} - and cu.`email` like concat('%', #{email},'%') + and wcubi.`email` like concat('%', #{email},'%') - and cu.`address` like concat('%', #{address},'%') + and wcubi.`address` like concat('%', #{address},'%') - and cu.`poins` = #{poins} + and wcubi.`poins` = #{poins} - and cu.`tag_id` = #{tagId} + and wcubi.`tag_id` = #{tagId} - and cu.`create_date` = #{createDate} + and wcubi.`create_date` = #{createDate} - and cu.`update_date` = #{updateDate} + and wcubi.`update_date` = #{updateDate} - and cu.`act_record` = #{actRecord} + and wcubi.`act_record` = #{actRecord} - and cu.`name` like concat('%', #{name},'%') + and wcubi.`name` like concat('%', #{name},'%') - and cu.`create_date` between #{startTime} and #{endTime} + and wcubi.`create_date` between #{startTime} and #{endTime} @@ -721,233 +442,97 @@ - and cu.id in + and wcubi.id in #{idItem} - order by cu.`active_time` DESC + order by wcubi.`active_time` DESC - - where 1 = 1 - - - and cu.`id` = #{basicInfo.id} - - - - and cu.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') - - - - and cu.`phone` like concat('%', #{basicInfo.phone},'%') - - - - and cu.`birthdate` = #{basicInfo.birthdate} - - - - and cu.`education` like concat('%', #{basicInfo.education},'%') - - - - and cu.`sex` = #{basicInfo.sex} - - - - and cu.`email` like concat('%', #{basicInfo.email},'%') - - - - and cu.`address` like concat('%', #{basicInfo.address},'%') - - - - and cu.`poins` = #{basicInfo.poins} - - - - and cu.`tag_id` = #{basicInfo.tagId} - - - - and cu.`create_date` = #{basicInfo.createDate} - - - - and cu.`update_date` = #{basicInfo.updateDate} - - - - and cu.`act_record` = #{basicInfo.actRecord} - - - - and cu.`name` like concat('%', #{basicInfo.name},'%') - - - and cu.`create_date` between #{basicInfo.startTime} and #{basicInfo.endTime} - - - - and wcubi.`active_time` between #{basicInfo.activeStartTime} and #{basicInfo.activeEndTime} - - - - and cu.id in - - #{idItem} - - - order by cu.`active_time` DESC - - - - - - - - - - - - - - - cu.`id`,cu.`phone`,cu.`email` - - where 1=1 - - and cu.`final_tenant_id` = #{finalTenantId} + where wcubi.`final_tenant_id` = #{finalTenantId} + + and wcubi.`tenant_id` like concat('%,', #{tenantId},',%') - - and cu.create_date >= #{startTime} + and wcubi.create_date >= #{startTime} - and cu.create_date <= #{endTime} + and wcubi.create_date <= #{endTime} - and cu.birthdate >= #{birthStartTime} + and wcubi.birthdate >= #{birthStartTime} - and cu.birthdate < #{birthEndTime} + and wcubi.birthdate < #{birthEndTime} - and cu.active_time >= #{loginStartTime} + and wcubi.active_time >= #{loginStartTime} - and cu.active_time <= #{loginEndTime} + and wcubi.active_time <= #{loginEndTime} - and 0< - (select count(*) from wx_coupon_order co - where cu.id = co.c_user_id - and co.coupon_order_status = 1 - and co.update_date >= #{verifiedStartTime} - and co.update_date <= #{verifiedEndTime}) + and 0 < + (select count(*) from wx_coupon_order wco + where wcubi.id = wco.c_user_id + and wco.coupon_order_status = 1 + and wco.update_date >= #{verifiedStartTime} + and wco.update_date <= #{verifiedEndTime}) - and cu.phone in (${phones}) + and wcubi.phone in (${phones}) - and cu.poins >= #{levelStartScore} + and wcubi.poins >= #{levelStartScore} - and cu.poins < #{levelEndScore} + and wcubi.poins < #{levelEndScore} - and (cu.poins is null or - (cu.poins >= #{levelStartScore} + and (wcubi.poins is null or + (wcubi.poins >= #{levelStartScore} - and cu.poins < #{levelEndScore} + and wcubi.poins < #{levelEndScore} )) - and JSON_CONTAINS(JSON_ARRAY(cut.tags),JSON_ARRAY + and JSON_CONTAINS(JSON_ARRAY(wcut.tags),JSON_ARRAY #{idItem} @@ -956,96 +541,20 @@ - - where 1=1 - - and cu.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') - - - - and cu.create_date >= #{basicInfo.startTime} - - - - and cu.create_date <= #{basicInfo.endTime} - - - - and cu.birthdate >= #{basicInfo.birthStartTime} - - - - and cu.birthdate < #{basicInfo.birthEndTime} - - - - and cu.active_time >= #{basicInfo.loginStartTime} - - - - and cu.active_time <= #{basicInfo.loginEndTime} - - - - and 0< - (select count(*) from wx_coupon_order co - where cu.id = co.c_user_id - and co.coupon_order_status = 1 - and co.update_date >= #{basicInfo.verifiedStartTime} - and co.update_date <= #{basicInfo.verifiedEndTime}) - - - - and cu.phone in (${basicInfo.phones}) - - - - and cu.poins >= #{basicInfo.levelStartScore} - - and cu.poins < #{basicInfo.levelEndScore} - - - - - and (cu.poins is null or - (cu.poins >= #{basicInfo.levelStartScore} - - and cu.poins < #{basicInfo.levelEndScore} - - )) - - - - and JSON_CONTAINS(JSON_ARRAY(cut.tags),JSON_ARRAY - - #{idItem} - - ) - - - - - @@ -1053,62 +562,23 @@ - - - - - - - + UPDATE wx_c_user_basic_info set act_record = act_record +1 where id = #{id} and final_tenant_id = #{finalTenantId}