select a.user_id as id
,a.dept_id
,a.dept_id as company_id
,a.user_name as username
,a.nick_name as real_name
,a.phonenumber as MOBILE
,(select t2.dept_name from SYS_DEPT t2 where t2.dept_id = a.dept_id) deptName
from SYS_USER a
where a.del_flag = 0
and (a.user_name like #{username} or a.nick_name like #{username})
and a.dept_id = #{deptId}
select a.user_id as id
, a.dept_id
, a.dept_id as company_id
, '1271368584383188993' as TENANT_ID
, a.user_name as username
, a.nick_name as real_name
, a.phonenumber as MOBILE
, (select t2.dept_name from SYS_DEPT t2 where t2.dept_id = a.dept_id) deptName
from SYS_USER a
where a.del_flag = 0
and a.user_id = #{value}
limit 1
select a.user_id as id
, a.dept_id
, a.dept_id as company_id
, '1271368584383188993' as TENANT_ID
, a.user_name as username
, a.nick_name as real_name
, a.phonenumber as MOBILE
, (select t2.dept_name from SYS_DEPT t2 where t2.dept_id = a.dept_id) deptName
, a.password as password
from SYS_USER a
where a.del_flag = 0
and user_name = #{value}
limit 1
select a.*
from SYS_USER a,
sys_role_user b,
sys_role c
where b.IS_DELETE = 0
and c.IS_DELETE = 0
and a.user_id = #{userId}
and b.user_id = a.user_id
and c.id = b.role_id
and ((#{localServer} = 'jd' and c.code in ('cjbm','ztsxlbm'))
or (#{localServer} = 'cj'
and c.code in ('zlbm','tybm','ywzbm','tzbm','czbm','bzbm','dbsbm')
)
)
select
a.user_id as id
,a.dept_id
,a.dept_id as company_id
,'1271368584383188993' as TENANT_ID
,a.user_name as username
,a.nick_name as real_name
,a.phonenumber as MOBILE
,a.password
from
SYS_USER a
where del_flag = 0
and user_name = #{username}
and dept_id = #{unitid}
or dept_id in (select dept_id from SYS_DEPT where dept_code=#{code}))
and password = #{password}
select a.user_id as id
, a.dept_id
, a.dept_id as company_id
, '1271368584383188993' as TENANT_ID
, a.user_name as username
, a.nick_name as real_name
, a.phonenumber as MOBILE
, (select t2.dept_name from SYS_DEPT t2 where t2.dept_id = a.dept_id) deptName
from SYS_USER a
where a.del_flag = 0
# and a.code = #{code}
SELECT
a.nick_name as realName,
c.name as roleName,
(select dept_name from SYS_DEPT d where a.DEPT_ID = d.DEPT_ID AND d.del_flag=0 limit 1 ) as deptName
FROM
SYS_USER a,
SYS_ROLE_USER b,
SYS_ROLE c,
sys_ROLE_MENU e,
sys_MENU f
WHERE 1=1
and a.user_id = #{userId}
and a.user_name = #{username}
and a.USER_ID = b.USER_ID
AND b.ROLE_ID = c.id
and c.id = e.role_id
and e.menu_id = f.id
AND b.is_delete=0
AND c.is_delete=0
AND e.is_delete=0
AND f.is_delete=0
and f.pid = #{systemId}
limit 1
SELECT group_concat(b.role_id) AS role_id
FROM SYS_ROLE_USER b
WHERE b.is_delete = 0
AND b.user_id = #{userId}
SELECT group_concat(a.name) AS name
FROM SYS_ROLE a,
SYS_ROLE_USER b
WHERE b.is_delete = 0
AND b.user_id = #{userId}
and a.is_delete = 0
and a.id =b.role_id
update
SYS_USER
login_error_count=#{loginErrorCount},
is_locked=#{isLocked},
last_login_error_time=#{lastLoginErrorTime}
WHERE user_id=#{id}
SELECT
b.user_id as id
,b.dept_id
,b.dept_id as company_id
,'1271368584383188993' as TENANT_ID
,b.user_name as username
,b.nick_name as real_name
,b.phonenumber as MOBILE
FROM
SYS_USER b
WHERE
b.del_flag = 0
and dept_id in
#{item}
SELECT b.user_id as id
, b.dept_id
, b.dept_id as company_id
, '1271368584383188993' as TENANT_ID
, b.user_name as username
, b.nick_name as real_name
, b.phonenumber as MOBILE
FROM SYS_USER b
WHERE b.del_flag = 0
and user_id = #{id}
limit 1
select *
from sys_user
where dept_id = #{newShipTeam}
and user_id in (select user_id
from sys_role_user a,
sys_role b
where a.role_id = b.id
and b.code = 'tybm')
SELECT
count( 1 )
FROM
sys_user
WHERE
del_flag = 0
AND user_id = #{userId}
AND (
user_name IN ( 'admin', 'yszl' )
OR user_id IN (
SELECT
user_id
FROM
sys_role_user b,
sys_role c
WHERE
b.IS_DELETE = 0
AND c.IS_DELETE = 0
AND c.id = b.ROLE_ID
AND c.`CODE` IN ( 'xtglybm', 'ztsxlbm', 'dbsbm', 'zlbm', 'bzbm', 'czbm' )
)
)
select nick_name from sys_user
update
SYS_USER
set password = #{password}
WHERE user_id=#{id}