1.部门管理(对部门curd)
sys_depart:树形结构
SELECT
id,
parent_id,
depart_name,
depart_name_en,
depart_name_abbr,
depart_order,
description,
org_type,
org_code,
mobile,
fax,
address,
memo,
STATUS,
del_flag,
create_by,
create_time,
update_by,
update_time
FROM
sys_depart
WHERE
parent_id = ?
ORDER BY
org_code DESC
2.消息
sys_announcement:系统消息表
sys_announcement_send:已读的系统消息表
select
sas.id,
sas.annt_id,
sas.user_id,
sas.read_flag,
sa.titile as titile,
sa.msg_content as msg_content,
sa.sender as sender,
sa.priority as priority,
sa.msg_category,
sa.send_time as send_time
from sys_announcement_send sas
left join sys_announcement sa ON sas.annt_id = sa.id
where sa.send_status = '1'
and sa.del_flag = '0'
and sas.user_id = ?
order by sa.send_time desc
3.我的部门
通过部门查询该部门下的人
SELECT
*
FROM
sys_user
WHERE
del_flag = '0'
AND id IN (
SELECT
user_id
FROM
sys_user_depart
WHERE
dep_id =?
)
LIMIT ?,?
4.分类字典
sys_category 为树形结构
SELECT
id,
pid,
NAME,
CODE,
create_by,
create_time,
update_by,
update_time,
sys_org_code,
has_child
FROM
sys_category
WHERE
pid = ?
ORDER BY
create_time DESC
5.数据字典
sys_dict 数据字典的键
SELECT
id,
type,
dict_name,
dict_code,
description,
del_flag,
create_by,
create_time,
update_by,
update_time
FROM
sys_dict
WHERE
del_flag = 0
ORDER BY
create_time DESC
LIMIT ?,?
sys_dict_item:数据字典的值
SELECT
id,
dict_id,
item_text,
item_value,
description,
sort_order,
STATUS,
create_by,
create_time,
update_by,
update_time
FROM
sys_dict_item
WHERE
dict_id = ?
ORDER BY
sort_order ASC
LIMIT ?,?
6.系统通告
sys_announcement:系统通告表
sys_announcement_send:当发送的为个人时 以上两个表都有数据
SQL = SELECT
id,
titile,
msg_content,
start_time,
end_time,
sender,
priority,
msg_category,
msg_type,
send_status,
send_time,
cancel_time,
del_flag,
create_by,
create_time,
update_by,
update_time,
user_ids
FROM
sys_announcement
WHERE
del_flag =?
来源:CSDN
作者:鲍春霖
链接:https://blog.csdn.net/qq_20143059/article/details/102805675