| @@ -1,17 +1,23 @@ | |||||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (646, '商户建券 ', 602, 'Y', NULL, 1, NULL, NULL, 'commercialPreferential', NULL, 0, 646); | |||||
| --加商户发卷菜单 | |||||
| INSERT INTO `mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (646, '商户建券 ', 602, 'Y', NULL, 1, NULL, NULL, 'commercialPreferential', NULL, 0, 646); | |||||
| --销售类型加权限 | |||||
| update mall_sale_type set menus = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 201, 202, 203, 204, 205, 206, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004]' where id=1; | update mall_sale_type set menus = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 201, 202, 203, 204, 205, 206, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004]' where id=1; | ||||
| update mall_sale_type set menus = '[1, 2, 4, 5, 6, 7, 8, 9, 10, 50, 101, 102, 103, 104, 105, 106, 107, 201, 202, 203, 204, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932, 951, 961]' where id=2; | update mall_sale_type set menus = '[1, 2, 4, 5, 6, 7, 8, 9, 10, 50, 101, 102, 103, 104, 105, 106, 107, 201, 202, 203, 204, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932, 951, 961]' where id=2; | ||||
| update mall_sale_type set menus = '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932]' where id=3; | update mall_sale_type set menus = '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932]' where id=3; | ||||
| --所有广场管理员角色加权限 | |||||
| INSERT INTO `mall_role_permission`(`id`, `tenant_id`, `parent_tenant_id`, `permission_id`, `role_id`) | |||||
| select CEILING(RAND()*90000000000+10000000000) ,mui.tenant_id,mui.parent_tenant_id,646,mur.role_id | |||||
| from mall_user_info mui | |||||
| left join mall_user_role mur on mui.id = mur.uid | |||||
| where mui.is_admin = 1 and mur.role_id is not null GROUP BY mur.role_id | |||||
| ALTER TABLE `wx_coupon` | |||||
| ADD COLUMN `source_type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1:A端发卷,2:B端发卷' AFTER `password_support`; | |||||
| --用户 | |||||
| ALTER TABLE `wx_c_user_basic_info` | ALTER TABLE `wx_c_user_basic_info` | ||||
| MODIFY COLUMN `tenant_id` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '租户ID' AFTER `id`; | MODIFY COLUMN `tenant_id` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '租户ID' AFTER `id`; | ||||
| ALTER TABLE `mallink`.`wx_coupon` | |||||
| ADD COLUMN `source_type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1:A端发卷,2:B端发卷' AFTER `password_support`; | |||||
| update wx_c_user_basic_info set tenant_id = concat(",",final_tenant_id,","); | |||||
| @@ -238,6 +238,10 @@ public class BaseController { | |||||
| if(byId != null && !byId.getPhone().equals(basicInfo.getPhone())){ | if(byId != null && !byId.getPhone().equals(basicInfo.getPhone())){ | ||||
| return Long.valueOf(-1); | return Long.valueOf(-1); | ||||
| } | } | ||||
| if(!basicInfo.getTenantId().contains(","+tenantEntity.getTenantId()+",")){ | |||||
| basicInfo.setTenantId(basicInfo.getTenantId()+tenantEntity.getTenantId()+","); | |||||
| wxCUserBasicInfoService.update(basicInfo); | |||||
| } | |||||
| // WxCUserBasicInfo basicInfo = list.get(0); | // WxCUserBasicInfo basicInfo = list.get(0); | ||||
| // 微信名称,统一成微信昵称 | // 微信名称,统一成微信昵称 | ||||
| // if (!Objects.equals(basicInfo.getNickName(), user.getNickName())) { | // if (!Objects.equals(basicInfo.getNickName(), user.getNickName())) { | ||||
| @@ -270,6 +274,7 @@ public class BaseController { | |||||
| basicInfo = new WxCUserBasicInfo(); | basicInfo = new WxCUserBasicInfo(); | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| basicInfo.setId(idWorker.nextId()); | basicInfo.setId(idWorker.nextId()); | ||||
| basicInfo.setTenantId(","+tenantEntity.getTenantId()+","); | |||||
| basicInfo.undateFinalTenantId(tenantEntity); | basicInfo.undateFinalTenantId(tenantEntity); | ||||
| basicInfo.setPhone(userPhone); | basicInfo.setPhone(userPhone); | ||||
| basicInfo.setNickName(userName); | basicInfo.setNickName(userName); | ||||
| @@ -22,7 +22,7 @@ import java.util.Objects; | |||||
| @Data | @Data | ||||
| @ToString(callSuper = true) | @ToString(callSuper = true) | ||||
| @EqualsAndHashCode(callSuper = true) | @EqualsAndHashCode(callSuper = true) | ||||
| public class WxCUserBasicInfo extends BaseEntity { | |||||
| public class WxCUserBasicInfo extends TenantEntity { | |||||
| protected Long id; | protected Long id; | ||||
| @@ -71,7 +71,7 @@ public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, S | |||||
| * 查找wx_c_user中不存在的用户 | * 查找wx_c_user中不存在的用户 | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| List<WxCUserBasicInfo> selectNotCUserList(); | |||||
| // List<WxCUserBasicInfo> selectNotCUserList(); | |||||
| void cuserOldToNew(@Param(value = "oldCuserId")Long oldCuserId, @Param(value = "newCuserId")Long newCuserId); | void cuserOldToNew(@Param(value = "oldCuserId")Long oldCuserId, @Param(value = "newCuserId")Long newCuserId); | ||||
| @@ -946,6 +946,9 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||||
| // } | // } | ||||
| if (oldUserBase != null) { | if (oldUserBase != null) { | ||||
| if(!oldUserBase.getTenantId().contains(","+mallUserInfo.getTenantId()+",")){ | |||||
| oldUserBase.setTenantId(oldUserBase.getTenantId()+mallUserInfo.getTenantId()+","); | |||||
| } | |||||
| oldUserBase.setName(userBase.getName()); | oldUserBase.setName(userBase.getName()); | ||||
| oldUserBase.setSex(userBase.getSex()); | oldUserBase.setSex(userBase.getSex()); | ||||
| oldUserBase.setNickName(userBase.getNickName()); | oldUserBase.setNickName(userBase.getNickName()); | ||||
| @@ -968,6 +971,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||||
| } | } | ||||
| } else { | } else { | ||||
| userBase.setId(idWorker.nextId()); | userBase.setId(idWorker.nextId()); | ||||
| userBase.setTenantId(","+mallUserInfo.getTenantId()+","); | |||||
| userBase.setUpdateDate(userBase.getUpdateDate() == null ? new Date() : userBase.getUpdateDate()); | userBase.setUpdateDate(userBase.getUpdateDate() == null ? new Date() : userBase.getUpdateDate()); | ||||
| userBase.setCreateDate(userBase.getCreateDate() == null ? new Date() : userBase.getCreateDate()); | userBase.setCreateDate(userBase.getCreateDate() == null ? new Date() : userBase.getCreateDate()); | ||||
| //新增积分 | //新增积分 | ||||
| @@ -146,10 +146,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | ||||
| and wcu.`tenant_id` = #{tenantInfo.tenantId} | |||||
| </if> | |||||
| <if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId"> | |||||
| and wcu.`parent_tenant_id` = #{tenantInfo.parentTenantId} | |||||
| and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') | |||||
| </if> | </if> | ||||
| <if test=" null != basicInfo.phone "> | <if test=" null != basicInfo.phone "> | ||||
| @@ -227,7 +224,6 @@ | |||||
| select | select | ||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||
| from wx_c_user_basic_info wcubi | from wx_c_user_basic_info wcubi | ||||
| left join wx_c_user wcu on wcu.user_id = wcubi.id | |||||
| <include refid="dynamicWhereConditions1"/> | <include refid="dynamicWhereConditions1"/> | ||||
| ) r where 1=1 | ) r where 1=1 | ||||
| @@ -270,7 +266,6 @@ | |||||
| <select id="findCountBySex1" resultType="java.lang.Long"> | <select id="findCountBySex1" resultType="java.lang.Long"> | ||||
| select count(distinct wcubi.id) from wx_c_user_basic_info wcubi | select count(distinct wcubi.id) from wx_c_user_basic_info wcubi | ||||
| left join wx_c_user wcu on wcu.user_id = wcubi.id | |||||
| where wcubi.sex =#{basicInfo.sex} | where wcubi.sex =#{basicInfo.sex} | ||||
| <if test=" null != basicInfo.startTime "> | <if test=" null != basicInfo.startTime "> | ||||
| and wcubi.create_date >= #{basicInfo.startTime} | and wcubi.create_date >= #{basicInfo.startTime} | ||||
| @@ -279,10 +274,7 @@ | |||||
| and wcubi.create_date <= #{basicInfo.endTime} | and wcubi.create_date <= #{basicInfo.endTime} | ||||
| </if> | </if> | ||||
| <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | ||||
| and wcu.`tenant_id` = #{tenantInfo.tenantId} | |||||
| </if> | |||||
| <if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId"> | |||||
| and wcu.`parent_tenant_id` = #{tenantInfo.parentTenantId} | |||||
| and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') | |||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| @@ -316,7 +308,6 @@ | |||||
| <select id="findCountByAge1" resultType="java.lang.Long"> | <select id="findCountByAge1" resultType="java.lang.Long"> | ||||
| select count(distinct wcubi.id) from wx_c_user_basic_info wcubi | select count(distinct wcubi.id) from wx_c_user_basic_info wcubi | ||||
| left join wx_c_user wcu on wcu.user_id = wcubi.id | |||||
| where 1=1 | where 1=1 | ||||
| <if test=" null != basicInfo.startTime "> | <if test=" null != basicInfo.startTime "> | ||||
| and wcubi.create_date >= #{basicInfo.startTime} | and wcubi.create_date >= #{basicInfo.startTime} | ||||
| @@ -336,12 +327,8 @@ | |||||
| <if test=" null == basicInfo.birthStartTime and null == basicInfo.birthEndTime"> | <if test=" null == basicInfo.birthStartTime and null == basicInfo.birthEndTime"> | ||||
| and wcubi.birthdate is null | and wcubi.birthdate is null | ||||
| </if> | </if> | ||||
| <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | ||||
| and wcu.`tenant_id` = #{tenantInfo.tenantId} | |||||
| </if> | |||||
| <if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId"> | |||||
| and wcu.`parent_tenant_id` = #{tenantInfo.parentTenantId} | |||||
| and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') | |||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| @@ -375,7 +362,6 @@ | |||||
| <select id="findCountByScore1" resultType="java.lang.Long"> | <select id="findCountByScore1" resultType="java.lang.Long"> | ||||
| select count(distinct wcubi.id) from wx_c_user_basic_info wcubi | select count(distinct wcubi.id) from wx_c_user_basic_info wcubi | ||||
| left join wx_c_user wcu on wcu.user_id = wcubi.id | |||||
| where 1=1 | where 1=1 | ||||
| <if test=" null != basicInfo.startTime "> | <if test=" null != basicInfo.startTime "> | ||||
| and wcubi.create_date >= #{basicInfo.startTime} | and wcubi.create_date >= #{basicInfo.startTime} | ||||
| @@ -397,10 +383,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | ||||
| and wcu.`tenant_id` = #{tenantInfo.tenantId} | |||||
| </if> | |||||
| <if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId"> | |||||
| and wcu.`parent_tenant_id` = #{tenantInfo.parentTenantId} | |||||
| and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') | |||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| @@ -434,7 +417,6 @@ | |||||
| <select id="findListByScore1" resultMap="BaseResultMap"> | <select id="findListByScore1" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumnsOfScoreList"/> | select <include refid="allColumnsOfScoreList"/> | ||||
| from wx_c_user_basic_info cub | from wx_c_user_basic_info cub | ||||
| inner join wx_c_user cu on cu.user_id = cub.id | |||||
| where cub.status=0 | where cub.status=0 | ||||
| <if test=" null != basicInfo.levelStartScore "> | <if test=" null != basicInfo.levelStartScore "> | ||||
| and cub.poins >= #{basicInfo.levelStartScore} | and cub.poins >= #{basicInfo.levelStartScore} | ||||
| @@ -448,10 +430,7 @@ | |||||
| and cub.poins is null | and cub.poins is null | ||||
| </if> | </if> | ||||
| <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | ||||
| and cu.`tenant_id` = #{tenantInfo.tenantId} | |||||
| </if> | |||||
| <if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId"> | |||||
| and cu.`parent_tenant_id` = #{tenantInfo.parentTenantId} | |||||
| and cub.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') | |||||
| </if> | </if> | ||||
| order by cub.`active_time` DESC | order by cub.`active_time` DESC | ||||
| </select> | </select> | ||||
| @@ -459,7 +438,6 @@ | |||||
| <select id="findBirthdayList" resultMap="BaseResultMap"> | <select id="findBirthdayList" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumnsOfScoreList"/> | select <include refid="allColumnsOfScoreList"/> | ||||
| from wx_c_user_basic_info cub | from wx_c_user_basic_info cub | ||||
| inner join wx_c_user cu on cu.user_id = cub.id | |||||
| where cub.status = 0 | where cub.status = 0 | ||||
| AND DATE_FORMAT(cub.birthdate,'%m-%d') >= #{begin} | AND DATE_FORMAT(cub.birthdate,'%m-%d') >= #{begin} | ||||
| AND DATE_FORMAT(cub.birthdate,'%m-%d') <= #{end} | AND DATE_FORMAT(cub.birthdate,'%m-%d') <= #{end} | ||||
| @@ -472,15 +450,11 @@ | |||||
| <select id="findBirthdayList1" resultMap="BaseResultMap"> | <select id="findBirthdayList1" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumnsOfScoreList"/> | select <include refid="allColumnsOfScoreList"/> | ||||
| from wx_c_user_basic_info cub | from wx_c_user_basic_info cub | ||||
| inner join wx_c_user cu on cu.user_id = cub.id | |||||
| where cub.status = 0 | where cub.status = 0 | ||||
| AND DATE_FORMAT(cub.birthdate,'%m-%d') >= #{begin} | AND DATE_FORMAT(cub.birthdate,'%m-%d') >= #{begin} | ||||
| AND DATE_FORMAT(cub.birthdate,'%m-%d') <= #{end} | AND DATE_FORMAT(cub.birthdate,'%m-%d') <= #{end} | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and cu.`tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and cu.`parent_tenant_id` = #{parentTenantId} | |||||
| and cub.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') | |||||
| </if> | </if> | ||||
| order by cub.`active_time` DESC | order by cub.`active_time` DESC | ||||
| </select> | </select> | ||||
| @@ -504,7 +478,6 @@ | |||||
| <select id="findCount1" resultType="java.lang.Long"> | <select id="findCount1" resultType="java.lang.Long"> | ||||
| select count(distinct wcubi.id) from wx_c_user_basic_info wcubi | select count(distinct wcubi.id) from wx_c_user_basic_info wcubi | ||||
| left join wx_c_user wcu on wcu.user_id = wcubi.id | |||||
| where 1=1 | where 1=1 | ||||
| <if test=" null != basicInfo.startTime "> | <if test=" null != basicInfo.startTime "> | ||||
| and wcubi.create_date >= #{basicInfo.startTime} | and wcubi.create_date >= #{basicInfo.startTime} | ||||
| @@ -513,11 +486,9 @@ | |||||
| and wcubi.create_date < #{basicInfo.endTime} | and wcubi.create_date < #{basicInfo.endTime} | ||||
| </if> | </if> | ||||
| <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | ||||
| and wcu.`tenant_id` = #{tenantInfo.tenantId} | |||||
| </if> | |||||
| <if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId"> | |||||
| and wcu.`parent_tenant_id` = #{tenantInfo.parentTenantId} | |||||
| and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') | |||||
| </if> | </if> | ||||
| <if test="1 == basicInfo.queryImport"> | <if test="1 == basicInfo.queryImport"> | ||||
| and wcubi.create_date like '%00:00:00' | and wcubi.create_date like '%00:00:00' | ||||
| </if> | </if> | ||||
| @@ -582,7 +553,6 @@ | |||||
| <if test="1 == basicInfo.reportType or 2 == basicInfo.reportType or 3 == basicInfo.reportType"> | <if test="1 == basicInfo.reportType or 2 == basicInfo.reportType or 3 == basicInfo.reportType"> | ||||
| (select count(distinct wcubi.id) from wx_c_user_basic_info wcubi | (select count(distinct wcubi.id) from wx_c_user_basic_info wcubi | ||||
| left join wx_c_user wcu on wcu.user_id = wcubi.id | |||||
| where | where | ||||
| <if test="1 == basicInfo.reportType "> | <if test="1 == basicInfo.reportType "> | ||||
| date_format(wcubi.create_date, '%Y-%m-%d') <= reportTime | date_format(wcubi.create_date, '%Y-%m-%d') <= reportTime | ||||
| @@ -594,21 +564,14 @@ | |||||
| date_format(wcubi.create_date, '%Y') <= reportTime | date_format(wcubi.create_date, '%Y') <= reportTime | ||||
| </if> | </if> | ||||
| <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | ||||
| and wcu.`tenant_id` = #{tenantInfo.tenantId} | |||||
| </if> | |||||
| <if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId"> | |||||
| and wcu.`parent_tenant_id` = #{tenantInfo.parentTenantId} | |||||
| and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') | |||||
| </if> | </if> | ||||
| ) as totalCount | ) as totalCount | ||||
| </if> | </if> | ||||
| from wx_c_user_basic_info wcubi | from wx_c_user_basic_info wcubi | ||||
| left join wx_c_user wcu on wcu.user_id = wcubi.id | |||||
| where 1=1 | where 1=1 | ||||
| <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | ||||
| and wcu.`tenant_id` = #{tenantInfo.tenantId} | |||||
| </if> | |||||
| <if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId"> | |||||
| and wcu.`parent_tenant_id` = #{tenantInfo.parentTenantId} | |||||
| and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') | |||||
| </if> | </if> | ||||
| <if test=" null != basicInfo.startTime "> | <if test=" null != basicInfo.startTime "> | ||||
| and wcubi.create_date >= #{basicInfo.startTime} | and wcubi.create_date >= #{basicInfo.startTime} | ||||
| @@ -729,10 +692,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | ||||
| and c.`tenant_id` = #{tenantInfo.tenantId} | |||||
| </if> | |||||
| <if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId"> | |||||
| and c.`parent_tenant_id` = #{tenantInfo.parentTenantId} | |||||
| and cu.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') | |||||
| </if> | </if> | ||||
| <if test=" null != basicInfo.phone "> | <if test=" null != basicInfo.phone "> | ||||
| @@ -809,7 +769,6 @@ | |||||
| select | select | ||||
| <include refid="allVoColumns"/> | <include refid="allVoColumns"/> | ||||
| from wx_c_user_basic_info cu | from wx_c_user_basic_info cu | ||||
| left join wx_c_user c on c.user_id = cu.id | |||||
| left join wx_c_user_tags cut on cut.`id` = cu.`tag_id` | left join wx_c_user_tags cut on cut.`id` = cu.`tag_id` | ||||
| <include refid="dynamicVoWhereConditions1"/> | <include refid="dynamicVoWhereConditions1"/> | ||||
| <if test=" null != basicInfo.begin "> | <if test=" null != basicInfo.begin "> | ||||
| @@ -828,7 +787,6 @@ | |||||
| select | select | ||||
| count(distinct cu.id) | count(distinct cu.id) | ||||
| from wx_c_user_basic_info cu | from wx_c_user_basic_info cu | ||||
| left join wx_c_user c on c.user_id = cu.id | |||||
| left join wx_c_user_tags cut on cut.`id` = cu.`tag_id` | left join wx_c_user_tags cut on cut.`id` = cu.`tag_id` | ||||
| <include refid="dynamicVoWhereConditions1"/> | <include refid="dynamicVoWhereConditions1"/> | ||||
| </select> | </select> | ||||
| @@ -910,10 +868,7 @@ | |||||
| <sql id="filterWhereConditions1"> | <sql id="filterWhereConditions1"> | ||||
| where 1=1 | where 1=1 | ||||
| <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | ||||
| and c.`tenant_id` = #{tenantInfo.tenantId} | |||||
| </if> | |||||
| <if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId"> | |||||
| and c.`parent_tenant_id` = #{tenantInfo.parentTenantId} | |||||
| and cu.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') | |||||
| </if> | </if> | ||||
| <if test=" null != basicInfo.startTime "> | <if test=" null != basicInfo.startTime "> | ||||
| @@ -989,7 +944,6 @@ | |||||
| <select id="findCountByFilter1" resultType="java.lang.Long"> | <select id="findCountByFilter1" resultType="java.lang.Long"> | ||||
| select count(distinct cu.id) from wx_c_user_basic_info cu | select count(distinct cu.id) from wx_c_user_basic_info cu | ||||
| left join wx_c_user c on c.user_id = cu.id | |||||
| <if test=" null != basicInfo.tagIds "> | <if test=" null != basicInfo.tagIds "> | ||||
| join wx_c_user_tags cut on cut.`id` = cu.`tag_id` | join wx_c_user_tags cut on cut.`id` = cu.`tag_id` | ||||
| </if> | </if> | ||||
| @@ -1008,7 +962,6 @@ | |||||
| <select id="findListByFilter1" resultMap="BaseResultMap"> | <select id="findListByFilter1" resultMap="BaseResultMap"> | ||||
| select <include refid="msgColumns"/> | select <include refid="msgColumns"/> | ||||
| from wx_c_user_basic_info cu | from wx_c_user_basic_info cu | ||||
| left join wx_c_user c on c.user_id = cu.id | |||||
| <if test=" null != basicInfo.tagIds "> | <if test=" null != basicInfo.tagIds "> | ||||
| join wx_c_user_tags cut on cut.`id` = cu.`tag_id` | join wx_c_user_tags cut on cut.`id` = cu.`tag_id` | ||||
| </if> | </if> | ||||
| @@ -1030,10 +983,7 @@ | |||||
| left join wx_c_user cu on cubi.id=cu.user_id | left join wx_c_user cu on cubi.id=cu.user_id | ||||
| where cu.id is null | where cu.id is null | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and cu.`tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and cu.`parent_tenant_id` = #{parentTenantId} | |||||
| and cubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') | |||||
| </if> | </if> | ||||
| </select> --> | </select> --> | ||||
| @@ -1051,10 +1001,7 @@ | |||||
| left join wx_c_user cu on cubi.id=cu.user_id | left join wx_c_user cu on cubi.id=cu.user_id | ||||
| where cu.id is not null | where cu.id is not null | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and cu.`tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and cu.`parent_tenant_id` = #{parentTenantId} | |||||
| and cubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%') | |||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| @@ -1062,9 +1009,9 @@ | |||||
| UPDATE wx_c_user_basic_info set act_record = act_record +1 where id = #{id} | UPDATE wx_c_user_basic_info set act_record = act_record +1 where id = #{id} | ||||
| </update> | </update> | ||||
| <select id="selectNotCUserList" resultMap="BaseResultMap"> | |||||
| <!--<select id="selectNotCUserList" resultMap="BaseResultMap"> | |||||
| select id,credit from wx_c_user_basic_info cub where not exists (select * from wx_c_user c where c.user_id=cub.id) and cub.credit is null | select id,credit from wx_c_user_basic_info cub where not exists (select * from wx_c_user c where c.user_id=cub.id) and cub.credit is null | ||||
| </select> | |||||
| </select>--> | |||||
| <update id="cuserOldToNew" statementType="CALLABLE" > | <update id="cuserOldToNew" statementType="CALLABLE" > | ||||
| {call cuser_old_to_new(#{oldCuserId},#{newCuserId})} | {call cuser_old_to_new(#{oldCuserId},#{newCuserId})} | ||||