You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
资产管理干事
|
|
|
|
|
装备中心
|
|
|
|
|
丁虹元 dinghongyuan 123456
|
|
|
|
|
|
|
|
|
|
校办干事
|
|
|
|
|
长春市第二中学
|
|
|
|
|
刘德华 liudehua 123456
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Q:如何设计才能让指定角色发的统计任务,让哪些指定角色接收到?
|
|
|
|
|
select * from t_base_org_type_principalship where name like '%校办干事%'
|
|
|
|
|
252,253,254
|
|
|
|
|
|
|
|
|
|
select * from t_base_org_type_principalship where name like '%资产%'
|
|
|
|
|
255
|
|
|
|
|
|
|
|
|
|
答:需要增加一个关系表,描述哪个角色发的任务,哪些角色可以接收到
|
|
|
|
|
t_importexcel_role_map
|
|
|
|
|
|
|
|
|
|
内容:
|
|
|
|
|
255 252 资产管理干事 幼儿园校办干事
|
|
|
|
|
255 253 资产管理干事 中小学校办干事
|
|
|
|
|
255 254 资产管理干事 职业学校校办干事
|
|
|
|
|
|
|
|
|
|
结论:
|
|
|
|
|
(1)发的角色可以是多个,收的角色只能是一个
|
|
|
|
|
(2)如果某人有多个发的角色,那么取第一个,如果以后反馈不方便,就修改为发现某人有多个发的角色,那么让他选择一个。
|
|
|
|
|
|
|
|
|
|
# 清库脚本
|
|
|
|
|
truncate table t_collect_job restart identity;
|
|
|
|
|
truncate table t_collect_job_sheet restart identity;
|
|
|
|
|
truncate table t_collect_job_sheet_col restart identity;
|
|
|
|
|
truncate table t_collect_mapping restart identity;
|
|
|
|
|
truncate table t_collect_job_bureau restart identity;
|
|
|
|
|
truncate table t_collect_group restart identity;
|
|
|
|
|
|
|
|
|
|
-- 删除所有以ds_job开头的表
|
|
|
|
|
DO $$
|
|
|
|
|
DECLARE
|
|
|
|
|
rec record;
|
|
|
|
|
BEGIN
|
|
|
|
|
FOR rec IN
|
|
|
|
|
SELECT table_name
|
|
|
|
|
FROM information_schema.tables
|
|
|
|
|
WHERE table_name LIKE 'ds_job%'
|
|
|
|
|
LOOP
|
|
|
|
|
EXECUTE 'DROP TABLE ' || rec.table_name || ' CASCADE';
|
|
|
|
|
END LOOP;
|
|
|
|
|
END $$;
|
|
|
|
|
|
|
|
|
|
# 处理序列
|
|
|
|
|
-- 查看所有序列
|
|
|
|
|
SELECT relname,pg_sequence_last_value(relname ::text) AS seq_last_value FROM pg_class
|
|
|
|
|
WHERE relkind = 'S' AND relowner = (SELECT usesysid FROM pg_user WHERE usename = (SELECT CURRENT_USER));
|
|
|
|
|
|
|
|
|
|
-- 修改序列名称
|
|
|
|
|
ALTER SEQUENCE t_importexcel_process_id_seq RENAME TO t_collect_process_id_seq;
|