role_id AS "roleId", pid AS "pid", name AS "name", description AS "description", sort AS "sort", version AS "version", create_time AS "createTime", update_time AS "updateTime", create_user AS "createUser", update_user AS "updateUser"
select
from sys_role
where name like CONCAT('%',#{condition},'%')
order by sort asc
select
from sys_role
where name like '%' || #{condition} || '%'
order by sort asc
select
from sys_role
where name like '%' || #{condition} || '%'
order by sort asc
delete from sys_relation where role_id = #{roleId}
select role_id AS id, pid as "pId",
name as name, (case when (pid = 0 or pid is null) then 'true'
else 'false' end) as "open" from sys_role
select role_id AS id, pid as "pId",
name as name, (case when (pid = 0 or pid is null) then '1'
else '0' end) as "open" from sys_role
select role_id AS id, pid as "pId",
name as name, (case when (pid = 0 or pid is null) then '1'
else '0' end) as "open" from sys_role
SELECT
r.role_id as id,
pid as "pId",
name AS "name",
(
CASE
WHEN (pid = 0 OR pid IS NULL) THEN
'true'
ELSE
'false'
END
) as "open",
(
CASE
WHEN (r1.role_id = 0 OR r1.role_id IS NULL) THEN
'false'
ELSE
'true'
END
) as "checked"
FROM
sys_role r
LEFT JOIN (
SELECT
role_id
FROM
sys_role
WHERE
role_id IN
#{i}
) r1 ON r.role_id = r1.role_id
ORDER BY pid,sort ASC
SELECT
r.role_id as id,
pid as "pId",
name AS "name",
(
CASE
WHEN (pid = 0 OR pid IS NULL) THEN
'1'
ELSE
'0'
END
) as "open",
(
CASE
WHEN (r1.role_id = 0 OR r1.role_id IS NULL) THEN
'0'
ELSE
'1'
END
) as "checked"
FROM
sys_role r
LEFT JOIN (
SELECT
role_id
FROM
sys_role
WHERE
role_id IN
#{i}
) r1 ON r.role_id = r1.role_id
ORDER BY pid,sort ASC
SELECT
r.role_id as id,
pid as "pId",
name AS "name",
(
CASE
WHEN (pid = 0 OR pid IS NULL) THEN
'1'
ELSE
'0'
END
) as "open",
(
CASE
WHEN (r1.role_id = 0 OR r1.role_id IS NULL) THEN
'0'
ELSE
'1'
END
) as "checked"
FROM
sys_role r
LEFT JOIN (
SELECT
role_id
FROM
sys_role
WHERE
role_id IN
#{i}
) r1 ON r.role_id = r1.role_id
ORDER BY pid,sort ASC
select
role_id as id,
name,
description
from sys_role
where 1=1
and name LIKE CONCAT('%', #{name},'%')
select
role_id as id,
name,
description
from sys_role
where 1=1
and name LIKE '%' || #{name} || '%'
select
role_id as "id",
name as "name",
description as "description"
from sys_role
where 1=1
and name LIKE '%' || #{name} || '%'