|
|
|
@@ -146,10 +146,7 @@ |
|
|
|
</if> |
|
|
|
|
|
|
|
<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 test=" null != basicInfo.phone "> |
|
|
|
@@ -227,7 +224,6 @@ |
|
|
|
select |
|
|
|
<include refid="allColumns"/> |
|
|
|
from wx_c_user_basic_info wcubi |
|
|
|
left join wx_c_user wcu on wcu.user_id = wcubi.id |
|
|
|
<include refid="dynamicWhereConditions1"/> |
|
|
|
) r where 1=1 |
|
|
|
|
|
|
|
@@ -270,7 +266,6 @@ |
|
|
|
|
|
|
|
<select id="findCountBySex1" resultType="java.lang.Long"> |
|
|
|
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} |
|
|
|
<if test=" null != basicInfo.startTime "> |
|
|
|
and wcubi.create_date >= #{basicInfo.startTime} |
|
|
|
@@ -279,10 +274,7 @@ |
|
|
|
and wcubi.create_date <= #{basicInfo.endTime} |
|
|
|
</if> |
|
|
|
<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> |
|
|
|
</select> |
|
|
|
|
|
|
|
@@ -316,7 +308,6 @@ |
|
|
|
|
|
|
|
<select id="findCountByAge1" resultType="java.lang.Long"> |
|
|
|
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 |
|
|
|
<if test=" null != basicInfo.startTime "> |
|
|
|
and wcubi.create_date >= #{basicInfo.startTime} |
|
|
|
@@ -336,12 +327,8 @@ |
|
|
|
<if test=" null == basicInfo.birthStartTime and null == basicInfo.birthEndTime"> |
|
|
|
and wcubi.birthdate is null |
|
|
|
</if> |
|
|
|
|
|
|
|
<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> |
|
|
|
|
|
|
|
</select> |
|
|
|
@@ -375,7 +362,6 @@ |
|
|
|
|
|
|
|
<select id="findCountByScore1" resultType="java.lang.Long"> |
|
|
|
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 |
|
|
|
<if test=" null != basicInfo.startTime "> |
|
|
|
and wcubi.create_date >= #{basicInfo.startTime} |
|
|
|
@@ -397,10 +383,7 @@ |
|
|
|
</if> |
|
|
|
|
|
|
|
<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> |
|
|
|
|
|
|
|
</select> |
|
|
|
@@ -434,7 +417,6 @@ |
|
|
|
<select id="findListByScore1" resultMap="BaseResultMap"> |
|
|
|
select <include refid="allColumnsOfScoreList"/> |
|
|
|
from wx_c_user_basic_info cub |
|
|
|
inner join wx_c_user cu on cu.user_id = cub.id |
|
|
|
where cub.status=0 |
|
|
|
<if test=" null != basicInfo.levelStartScore "> |
|
|
|
and cub.poins >= #{basicInfo.levelStartScore} |
|
|
|
@@ -448,10 +430,7 @@ |
|
|
|
and cub.poins is null |
|
|
|
</if> |
|
|
|
<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> |
|
|
|
order by cub.`active_time` DESC |
|
|
|
</select> |
|
|
|
@@ -459,7 +438,6 @@ |
|
|
|
<select id="findBirthdayList" resultMap="BaseResultMap"> |
|
|
|
select <include refid="allColumnsOfScoreList"/> |
|
|
|
from wx_c_user_basic_info cub |
|
|
|
inner join wx_c_user cu on cu.user_id = cub.id |
|
|
|
where cub.status = 0 |
|
|
|
AND DATE_FORMAT(cub.birthdate,'%m-%d') >= #{begin} |
|
|
|
AND DATE_FORMAT(cub.birthdate,'%m-%d') <= #{end} |
|
|
|
@@ -472,15 +450,11 @@ |
|
|
|
<select id="findBirthdayList1" resultMap="BaseResultMap"> |
|
|
|
select <include refid="allColumnsOfScoreList"/> |
|
|
|
from wx_c_user_basic_info cub |
|
|
|
inner join wx_c_user cu on cu.user_id = cub.id |
|
|
|
where cub.status = 0 |
|
|
|
AND DATE_FORMAT(cub.birthdate,'%m-%d') >= #{begin} |
|
|
|
AND DATE_FORMAT(cub.birthdate,'%m-%d') <= #{end} |
|
|
|
<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> |
|
|
|
order by cub.`active_time` DESC |
|
|
|
</select> |
|
|
|
@@ -504,7 +478,6 @@ |
|
|
|
|
|
|
|
<select id="findCount1" resultType="java.lang.Long"> |
|
|
|
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 |
|
|
|
<if test=" null != basicInfo.startTime "> |
|
|
|
and wcubi.create_date >= #{basicInfo.startTime} |
|
|
|
@@ -513,11 +486,9 @@ |
|
|
|
and wcubi.create_date < #{basicInfo.endTime} |
|
|
|
</if> |
|
|
|
<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 test="1 == basicInfo.queryImport"> |
|
|
|
and wcubi.create_date like '%00:00:00' |
|
|
|
</if> |
|
|
|
@@ -582,7 +553,6 @@ |
|
|
|
|
|
|
|
<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 |
|
|
|
left join wx_c_user wcu on wcu.user_id = wcubi.id |
|
|
|
where |
|
|
|
<if test="1 == basicInfo.reportType "> |
|
|
|
date_format(wcubi.create_date, '%Y-%m-%d') <= reportTime |
|
|
|
@@ -594,21 +564,14 @@ |
|
|
|
date_format(wcubi.create_date, '%Y') <= reportTime |
|
|
|
</if> |
|
|
|
<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> |
|
|
|
) as totalCount |
|
|
|
</if> |
|
|
|
from wx_c_user_basic_info wcubi |
|
|
|
left join wx_c_user wcu on wcu.user_id = wcubi.id |
|
|
|
where 1=1 |
|
|
|
<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 test=" null != basicInfo.startTime "> |
|
|
|
and wcubi.create_date >= #{basicInfo.startTime} |
|
|
|
@@ -729,10 +692,7 @@ |
|
|
|
</if> |
|
|
|
|
|
|
|
<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 test=" null != basicInfo.phone "> |
|
|
|
@@ -809,7 +769,6 @@ |
|
|
|
select |
|
|
|
<include refid="allVoColumns"/> |
|
|
|
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` |
|
|
|
<include refid="dynamicVoWhereConditions1"/> |
|
|
|
<if test=" null != basicInfo.begin "> |
|
|
|
@@ -828,7 +787,6 @@ |
|
|
|
select |
|
|
|
count(distinct cu.id) |
|
|
|
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` |
|
|
|
<include refid="dynamicVoWhereConditions1"/> |
|
|
|
</select> |
|
|
|
@@ -910,10 +868,7 @@ |
|
|
|
<sql id="filterWhereConditions1"> |
|
|
|
where 1=1 |
|
|
|
<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 test=" null != basicInfo.startTime "> |
|
|
|
@@ -989,7 +944,6 @@ |
|
|
|
|
|
|
|
<select id="findCountByFilter1" resultType="java.lang.Long"> |
|
|
|
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 "> |
|
|
|
join wx_c_user_tags cut on cut.`id` = cu.`tag_id` |
|
|
|
</if> |
|
|
|
@@ -1008,7 +962,6 @@ |
|
|
|
<select id="findListByFilter1" resultMap="BaseResultMap"> |
|
|
|
select <include refid="msgColumns"/> |
|
|
|
from wx_c_user_basic_info cu |
|
|
|
left join wx_c_user c on c.user_id = cu.id |
|
|
|
<if test=" null != basicInfo.tagIds "> |
|
|
|
join wx_c_user_tags cut on cut.`id` = cu.`tag_id` |
|
|
|
</if> |
|
|
|
@@ -1030,10 +983,7 @@ |
|
|
|
left join wx_c_user cu on cubi.id=cu.user_id |
|
|
|
where cu.id is null |
|
|
|
<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> |
|
|
|
</select> --> |
|
|
|
|
|
|
|
@@ -1051,10 +1001,7 @@ |
|
|
|
left join wx_c_user cu on cubi.id=cu.user_id |
|
|
|
where cu.id is not null |
|
|
|
<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> |
|
|
|
</select> |
|
|
|
|
|
|
|
@@ -1062,9 +1009,9 @@ |
|
|
|
UPDATE wx_c_user_basic_info set act_record = act_record +1 where id = #{id} |
|
|
|
</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> |
|
|
|
</select>--> |
|
|
|
|
|
|
|
<update id="cuserOldToNew" statementType="CALLABLE" > |
|
|
|
{call cuser_old_to_new(#{oldCuserId},#{newCuserId})} |
|
|
|
|