diff --git a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml index f29ed171b..6c59e1e2e 100644 --- a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml @@ -26,10 +26,10 @@ - `id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`, - `create_date`,`update_date`,`tenant_id`,`name`,`nick_name`,`credit`,`active_time`,`act_record` + cub.`id`,cub.`phone`,cub.`birthdate`,cub.`education`,cub.`sex`,cub.`email`,cub.`address`,cub.`poins`,cub.`tag_id`, + cub.`create_date`,cub.`update_date`,cub.`tenant_id`,cub.`name`,cub.`nick_name`,cub.`credit`,cub.`active_time`,cub.`act_record` ,(select level from wx_level_config - where poins >= points and tenant_id=#{tenantId} + where poins >= points and tenant_id=cub.tenant_id order by points desc limit 1 ) level,status @@ -37,74 +37,77 @@ where 1 = 1 - and `id` = #{id} + and cub.`id` = #{id} - - and `tenant_id` = #{tenantId} + + and cub.`tenant_id` = #{tenantId} + + + and cu.`parent_tenant_id` = #{parentTenantId} - and `phone` like concat('%', #{phone},'%') + and cub.`phone` like concat('%', #{phone},'%') - and `birthdate` = #{birthdate} + and cub.`birthdate` = #{birthdate} - and `education` like concat('%', #{education},'%') + and cub.`education` like concat('%', #{education},'%') - and `sex` = #{sex} + and cub.`sex` = #{sex} - and `email` like concat('%', #{email},'%') + and cub.`email` like concat('%', #{email},'%') - and `address` like concat('%', #{address},'%') + and cub.`address` like concat('%', #{address},'%') - and `poins` = #{poins} + and cub.`poins` = #{poins} - and `credit` = #{credit} + and cub.`credit` = #{credit} - and `tag_id` = #{tagId} + and cub.`tag_id` = #{tagId} - and `create_date` = #{createDate} + and cub.`create_date` = #{createDate} - and `update_date` = #{updateDate} + and cub.`update_date` = #{updateDate} - and `act_record` = #{actRecord} + and cub.`act_record` = #{actRecord} - and `name` like concat('%', #{name},'%') + and cub.`name` like concat('%', #{name},'%') - and `create_date` between #{startTime} and #{endTime} + and cub.`create_date` between #{startTime} and #{endTime} - and `status` = #{status} + and cub.`status` = #{status} - and id in + and cub.id in #{idItem} @@ -116,7 +119,8 @@ select r.* from ( select - from wx_c_user_basic_info + from wx_c_user_basic_info cub + inner join wx_c_user cu on cu.id = cub.id ) r where 1=1 @@ -132,81 +136,95 @@ update wx_c_user_basic_info set poins=#{poins} - where phone=#{phone} and tenant_id=#{tenantId} + where phone=#{phone} and id=#{id} update wx_c_user_basic_info set id=#{newId} , credit=#{credit} , poins=#{poins} - where tenant_id=#{tenantId} - and id = #{id} + where id = #{id} @@ -235,8 +253,11 @@ and cub.poins is null - - and cub.tenant_id =#{tenantId} + + and cub.`tenant_id` = #{tenantId} + + + and cu.`parent_tenant_id` = #{parentTenantId} @@ -248,29 +269,37 @@ where cub.status = 0 and cu.phone is not null AND DATE_FORMAT(cub.birthdate,'%m-%d') >= #{begin} AND DATE_FORMAT(cub.birthdate,'%m-%d') <= #{end} - - and cub.tenant_id = #{tenantId} + + and cub.`tenant_id` = #{tenantId} + + + and cu.`parent_tenant_id` = #{parentTenantId} @@ -348,9 +386,12 @@ and cu.`id` = #{id} - + and cu.`tenant_id` = #{tenantId} + + and c.`parent_tenant_id` = #{parentTenantId} + and cu.`phone` like concat('%', #{phone},'%') @@ -415,6 +456,7 @@ select from wx_c_user_basic_info cu + inner join wx_c_user c on c.id = cu.id left join wx_c_user_tags cut on cut.`id` = cu.`tag_id` @@ -423,6 +465,7 @@ select count(*) from wx_c_user_basic_info cu + inner join wx_c_user c on c.id = cu.id left join wx_c_user_tags cut on cut.`id` = cu.`tag_id` @@ -434,8 +477,12 @@ where 1=1 - - and cu.tenant_id =#{tenantId} + + + and cu.`tenant_id` = #{tenantId} + + + and c.`parent_tenant_id` = #{parentTenantId} @@ -503,6 +550,7 @@ select from wx_c_user_basic_info cu + inner join wx_c_user c on c.id = cu.id join wx_c_user_tags cut on cut.`id` = cu.`tag_id` @@ -521,15 +570,22 @@ diff --git a/mallinkService/src/main/resources/mapper/WxCUserMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserMapper.xml index 7fe31a1f7..e7f20e98d 100644 --- a/mallinkService/src/main/resources/mapper/WxCUserMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCUserMapper.xml @@ -249,8 +249,11 @@ and create_date < #{endTime} - - and tenant_id =#{tenantId} + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} @@ -277,15 +280,21 @@ date_format(create_date, '%Y') <= reportTime - - and tenant_id =#{tenantId} + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} ) as totalCount from wx_c_user where 1=1 - - and tenant_id =#{tenantId} + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} and create_date >= #{startTime} @@ -300,8 +309,11 @@ select count(id) from wx_c_user where 1=1 - - and tenant_id =#{tenantId} + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} and create_date >= #{startDate}