dept_id AS "deptId", pid AS "pid", pids AS "pids", simple_name AS "simpleName", full_name AS "fullName", description AS "description", version AS "version", sort AS "sort", create_time AS "createTime", update_time AS "updateTime", create_user AS "createUser", update_user AS "updateUser"
select dept_id AS id, pid as "pId", simple_name as name,
(
CASE
WHEN (pid = 0 OR pid IS NULL) THEN
'true'
ELSE
'false'
END
) as "open" from sys_dept
select dept_id AS id, pid as "pId", simple_name as name,
(
CASE
WHEN (pid = 0 OR pid IS NULL) THEN
'1'
ELSE
'0'
END
) as "open" from sys_dept
select
from sys_dept where 1 = 1
and simple_name like CONCAT('%',#{condition},'%') or full_name like CONCAT('%',#{condition},'%')
and (dept_id = #{deptId} or dept_id in ( select dept_id from sys_dept where pids like CONCAT('%$[', #{deptId}, '$]%') escape '$' ))
order by sort ASC
select
from sys_dept where 1 = 1
and simple_name like CONCAT('%',#{condition},'%') or full_name like CONCAT('%',#{condition},'%')
and (dept_id = #{deptId} or dept_id in ( select dept_id from sys_dept where pids like CONCAT('%$[', #{deptId}, '$]%') escape '$' ))
order by sort ASC
select
from sys_dept where 1 = 1
and simple_name like ('%' || #{condition} || '%') or full_name like ('%' || #{condition} || '%')
and (dept_id = #{deptId} or dept_id in ( select dept_id from sys_dept where pids like '%[' || #{deptId} || ']%' ))
order by sort ASC
select dept_id AS tags, pid as "parentId", simple_name as text from sys_dept
select
from sys_dept where 1 = 1
and pids LIKE CONCAT('%$[',#{deptId},'$]%') escape '$'
select
from sys_dept where 1 = 1
and pids LIKE '%[' || #{deptId} || ']%'