|
|
|
@@ -14,6 +14,7 @@ |
|
|
|
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> |
|
|
|
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> |
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> |
|
|
|
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/> |
|
|
|
<result column="name" jdbcType="VARCHAR" property="name"/> |
|
|
|
<result column="level" jdbcType="VARCHAR" property="level"/> |
|
|
|
<result column="nick_name" jdbcType="VARCHAR" property="nickName"/> |
|
|
|
@@ -27,9 +28,9 @@ |
|
|
|
|
|
|
|
<sql id="allColumns"> |
|
|
|
`id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`, |
|
|
|
`create_date`,`update_date`,`tenant_id`,`name`,`nick_name`,`credit`,`active_time`,`act_record` |
|
|
|
`create_date`,`update_date`,`tenant_id`,`parent_tenant_id`,`name`,`nick_name`,`credit`,`active_time`,`act_record` |
|
|
|
,(select level from wx_level_config |
|
|
|
where poins >= points and tenant_id=#{tenantId} |
|
|
|
where poins >= points and tenant_id=wcubi.tenant_id |
|
|
|
order by points desc limit 1 ) level,status |
|
|
|
</sql> |
|
|
|
|
|
|
|
@@ -40,9 +41,12 @@ |
|
|
|
and `id` = #{id} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != tenantId "> |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and `tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and `parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != phone "> |
|
|
|
and `phone` like concat('%', #{phone},'%') |
|
|
|
@@ -116,7 +120,7 @@ |
|
|
|
select r.* from ( |
|
|
|
select |
|
|
|
<include refid="allColumns"/> |
|
|
|
from wx_c_user_basic_info |
|
|
|
from wx_c_user_basic_info wcubi |
|
|
|
<include refid="dynamicWhereConditions"/> |
|
|
|
) r where 1=1 |
|
|
|
|
|
|
|
@@ -132,14 +136,13 @@ |
|
|
|
|
|
|
|
<update id="updateScore" parameterType="com.iformall.domain.po.WxCUserBasicInfo"> |
|
|
|
update wx_c_user_basic_info set poins=#{poins} |
|
|
|
where phone=#{phone} and tenant_id=#{tenantId} |
|
|
|
where phone=#{phone} |
|
|
|
and id=#{id} |
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="updateNewId" parameterType="com.iformall.domain.vo.CUserBaseVo"> |
|
|
|
update wx_c_user_basic_info set id=#{newId} , credit=#{credit} , poins=#{poins} |
|
|
|
where tenant_id=#{tenantId} |
|
|
|
and id = #{id} |
|
|
|
where id = #{id} |
|
|
|
</update> |
|
|
|
|
|
|
|
<select id="findCountBySex" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> |
|
|
|
@@ -151,8 +154,11 @@ |
|
|
|
<if test=" null != endTime"> |
|
|
|
and create_date <= #{endTime} |
|
|
|
</if> |
|
|
|
<if test="null != tenantId"> |
|
|
|
and tenant_id =#{tenantId} |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and `tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and `parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
@@ -178,8 +184,11 @@ |
|
|
|
and birthdate is null |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="null != tenantId"> |
|
|
|
and tenant_id =#{tenantId} |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and `tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and `parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
|
|
|
|
</select> |
|
|
|
@@ -205,8 +214,11 @@ |
|
|
|
and poins is null |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="null != tenantId"> |
|
|
|
and tenant_id =#{tenantId} |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and `tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and `parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
|
|
|
|
</select> |
|
|
|
@@ -235,8 +247,11 @@ |
|
|
|
and cub.poins is null |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="null != tenantId"> |
|
|
|
and cub.tenant_id =#{tenantId} |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and cub.`tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and cub.`parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
|
|
|
|
</select> |
|
|
|
@@ -248,8 +263,11 @@ |
|
|
|
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} |
|
|
|
<if test="null != tenantId"> |
|
|
|
and cub.tenant_id = #{tenantId} |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and cub.`tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and cub.`parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
@@ -261,8 +279,11 @@ |
|
|
|
<if test=" null != endTime"> |
|
|
|
and create_date < #{endTime} |
|
|
|
</if> |
|
|
|
<if test="null != tenantId"> |
|
|
|
and tenant_id =#{tenantId} |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and `tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and `parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
<if test="1 == queryImport"> |
|
|
|
and create_date like '%00:00:00' |
|
|
|
@@ -293,15 +314,21 @@ |
|
|
|
<if test="3 == reportType "> |
|
|
|
date_format(create_date, '%Y') <= reportTime |
|
|
|
</if> |
|
|
|
<if test="null != tenantId"> |
|
|
|
and tenant_id =#{tenantId} |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and `tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and `parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
) as totalCount |
|
|
|
</if> |
|
|
|
|
|
|
|
from wx_c_user_basic_info where 1=1 |
|
|
|
<if test="null != tenantId"> |
|
|
|
and tenant_id =#{tenantId} |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and `tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and `parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != startTime "> |
|
|
|
and create_date >= #{startTime} |
|
|
|
@@ -348,9 +375,12 @@ |
|
|
|
and cu.`id` = #{id} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != 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} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != phone "> |
|
|
|
and cu.`phone` like concat('%', #{phone},'%') |
|
|
|
@@ -434,8 +464,11 @@ |
|
|
|
|
|
|
|
<sql id="filterWhereConditions"> |
|
|
|
where 1=1 |
|
|
|
<if test="null != tenantId"> |
|
|
|
and cu.tenant_id =#{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} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != startTime "> |
|
|
|
@@ -521,15 +554,21 @@ |
|
|
|
|
|
|
|
<select id="findImportUserCount" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> |
|
|
|
SELECT count(*) FROM wx_c_user_basic_info cubi left join wx_c_user cu on cubi.id=cu.id where cu.id is null |
|
|
|
<if test="null != tenantId"> |
|
|
|
and cubi.tenant_id =#{tenantId} |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and cubi.`tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and cubi.`parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findGrowUserCount" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> |
|
|
|
SELECT count(*) FROM wx_c_user_basic_info cubi left join wx_c_user cu on cubi.id=cu.id where cu.id is not null |
|
|
|
<if test="null != tenantId"> |
|
|
|
and cubi.tenant_id =#{tenantId} |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and cubi.`tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and cubi.`parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
|