select * from sys_user
where 1=1
and orgid = #{orgid}
and username = #{username}
and mobile = #{mobile}
and status = #{status}
ORDER BY orgid,code
LIMIT #{total},#{size}
insert into sys_role_users value (#{id},#{roleid},#{userid})
select id,roleid,userid from sys_role_users where roleid=#{roleid} and userid=#{userid}
select id,level,rolename, from sys_role where id in (select roleid from sys_role_users where userid=#{userid} )
select roleid from sys_role_users where userid=#{userid}
select min(level) from sys_role where id in (select roleid from sys_role_users where userid=#{userid})
SELECT DISTINCT
u.id,
u.usertype,
u.username,
u.nickname,
u.sex,
u.email,
u.phone,
u.avatar,
u.orgid,
u.`status`,
u.lastmodifier,
u.lastmodifydate
FROM
sys_user u
where 1=1
and u.usertype != 0
and u.orgid = #{orgid}
and u.username like concat('%', #{username},'%')
ORDER BY u.lastmodifydate DESC
SELECT DISTINCT
u.id,u.username,u.nickname,u.email,u.phone,u.avatar,o.orgname,o.id oid,
op.orgname porgname ,op.id poid
FROM
sys_user u
INNER JOIN sys_organization o ON u.orgid = o.id
INNER JOIN sys_organization op ON o.parentid = op.id
WHERE
u.id = #{id}
delete from sys_role_users where userid=#{userid}
delete from sys_role_users
where
userid=#{userid}
and roleid not in
#{roleids}
DELETE FROM sys_role_users WHERE userid IN
#{id}