feat: Implement pagination and effective account validation for backdoor user login
This commit is contained in:
@@ -75,12 +75,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
u.app_user_id,
|
||||
u.lc_userid,
|
||||
d.dept_name
|
||||
from sys_user u
|
||||
from (
|
||||
select source_user.*,
|
||||
row_number() over (
|
||||
partition by source_user.user_name
|
||||
order by source_user.create_time desc nulls last, source_user.user_id desc
|
||||
) as account_rank
|
||||
from sys_user source_user
|
||||
where source_user.del_flag = '0'
|
||||
and source_user.user_name is not null
|
||||
and source_user.user_name != ''
|
||||
) u
|
||||
left join sys_dept d on d.dept_id = u.dept_id
|
||||
where u.del_flag = '0'
|
||||
where u.account_rank = 1
|
||||
and u.status = '0'
|
||||
and u.user_name is not null
|
||||
and u.user_name != ''
|
||||
<if test="keyword != null and keyword != ''">
|
||||
and (
|
||||
cast(u.user_id as varchar) like concat('%', cast(#{keyword} as varchar), '%')
|
||||
@@ -93,6 +101,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
u.user_id desc
|
||||
limit #{limit}
|
||||
</select>
|
||||
|
||||
<select id="selectBackDoorEffectiveUserId" resultType="java.lang.Long">
|
||||
select u.user_id
|
||||
from sys_user u
|
||||
where u.del_flag = '0'
|
||||
and u.user_name = #{userName}
|
||||
order by u.create_time desc nulls last, u.user_id desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
|
||||
Reference in New Issue
Block a user