|
@@ -116,27 +116,24 @@
|
|
|
|
|
|
|
|
<select id="getByTeam" resultType="com.ydtech.modules.admin.model.dto.SysUserTeamDto">
|
|
<select id="getByTeam" resultType="com.ydtech.modules.admin.model.dto.SysUserTeamDto">
|
|
|
with recursive t1 as (select *
|
|
with recursive t1 as (select *
|
|
|
- from esm_user_referrer
|
|
|
|
|
- WHERE referrer_id = #{userId}
|
|
|
|
|
- union all
|
|
|
|
|
- select r1.*
|
|
|
|
|
- from esm_user_referrer r1
|
|
|
|
|
- INNER JOIN t1 on t1.id = r1.referrer_id
|
|
|
|
|
- WHERE r1.level < #{level})
|
|
|
|
|
- select u.id, u.name, u.mobile, u.status
|
|
|
|
|
|
|
+ from esm_user_referrer
|
|
|
|
|
+ WHERE referrer_id = #{userId}
|
|
|
|
|
+ union all
|
|
|
|
|
+ select r1.*
|
|
|
|
|
+ from esm_user_referrer r1
|
|
|
|
|
+ INNER JOIN t1 on t1.id = r1.referrer_id
|
|
|
|
|
+ WHERE r1.level < #{level})
|
|
|
|
|
+ select u.id as id , u.name as name , u.mobile as mobile, u.status as status
|
|
|
from t1
|
|
from t1
|
|
|
- LEFT JOIN sys_user u on t1.id = u.id
|
|
|
|
|
- <if test="managementQueryVo.userId != null and managementQueryVo.userId != ''">
|
|
|
|
|
- AND sd.id = #{managementQueryVo.userId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="managementQueryVo.username != null and managementQueryVo.username != ''">
|
|
|
|
|
- AND sd.id = #{managementQueryVo.username}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="managementQueryVo.phoneNumber != null and managementQueryVo.phoneNumber != ''">
|
|
|
|
|
- AND sd.id = #{managementQueryVo.phoneNumber}
|
|
|
|
|
|
|
+ LEFT JOIN sys_user u on t1.id = u.id
|
|
|
|
|
+ where 1=1
|
|
|
|
|
+ <if test="managementQueryVo.criteria != null and managementQueryVo.criteria != ''">
|
|
|
|
|
+ or u.id = #{managementQueryVo.criteria}
|
|
|
|
|
+ or u.name = #{managementQueryVo.criteria}
|
|
|
|
|
+ or u.mobile = #{managementQueryVo.criteria}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="managementQueryVo.authenticationStatus != null and managementQueryVo.authenticationStatus != ''">
|
|
<if test="managementQueryVo.authenticationStatus != null and managementQueryVo.authenticationStatus != ''">
|
|
|
- AND sd.id = #{managementQueryVo.authenticationStatus}
|
|
|
|
|
|
|
+ AND u.status = #{managementQueryVo.authenticationStatus}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|