-- 将管理员组功能权限中含有HR管理员查询权限项的组全部刷入HR管理员的权限项（添加用户、删除用户）和HR管理员分组的权限项（新增、修改、删除、批量授权）

INSERT INTO T_PERM_ADMINGROUPFUNPERM (FID, FUSERGROUPID, FAPPID, FENTITYNUM, FPERMITEMID) SELECT FID - 500000000000000001, FUSERGROUPID, '15NPDX/GJFOO', 'hrcs_useradmingroup', '497UB981JAGM' FROM T_PERM_ADMINGROUPFUNPERM as a WHERE FENTITYNUM = 'hrcs_useradmingroup' AND FPERMITEMID = '47150e89000000ac' AND NOT EXISTS (SELECT b.fid from T_PERM_ADMINGROUPFUNPERM as b WHERE b.FID = a.FID - 500000000000000001);

INSERT INTO T_PERM_ADMINGROUPFUNPERM (FID, FUSERGROUPID, FAPPID, FENTITYNUM, FPERMITEMID) SELECT FID - 500000000000000002, FUSERGROUPID, '15NPDX/GJFOO', 'hrcs_useradmingroup', '497UCAMO6LT9' FROM T_PERM_ADMINGROUPFUNPERM as a WHERE FENTITYNUM = 'hrcs_useradmingroup' AND FPERMITEMID = '47150e89000000ac' AND NOT EXISTS (SELECT b.fid from T_PERM_ADMINGROUPFUNPERM as b WHERE b.FID = a.FID - 500000000000000002);

INSERT INTO T_PERM_ADMINGROUPFUNPERM (FID, FUSERGROUPID, FAPPID, FENTITYNUM, FPERMITEMID) SELECT FID - 500000000000000003, FUSERGROUPID, '15NPDX/GJFOO', 'hrcs_useradmingroup', '497UJ2I+X7IV' FROM T_PERM_ADMINGROUPFUNPERM as a WHERE FENTITYNUM = 'hrcs_useradmingroup' AND FPERMITEMID = '47150e89000000ac' AND NOT EXISTS (SELECT b.fid from T_PERM_ADMINGROUPFUNPERM as b WHERE b.FID = a.FID - 500000000000000003);

INSERT INTO T_PERM_ADMINGROUPFUNPERM (FID, FUSERGROUPID, FAPPID, FENTITYNUM, FPERMITEMID) SELECT FID - 500000000000000004, FUSERGROUPID, '15NPDX/GJFOO', 'hrcs_useradmingroup', '4=MZPAI2SP/E' FROM T_PERM_ADMINGROUPFUNPERM as a WHERE FENTITYNUM = 'hrcs_useradmingroup' AND FPERMITEMID = '47150e89000000ac' AND NOT EXISTS (SELECT b.fid from T_PERM_ADMINGROUPFUNPERM as b WHERE b.FID = a.FID - 500000000000000004);

INSERT INTO T_PERM_ADMINGROUPFUNPERM (FID, FUSERGROUPID, FAPPID, FENTITYNUM, FPERMITEMID) SELECT FID - 500000000000000005, FUSERGROUPID, '15NPDX/GJFOO', 'hrcs_useradmingroup', '4=MZNUID/PQA' FROM T_PERM_ADMINGROUPFUNPERM as a WHERE FENTITYNUM = 'hrcs_useradmingroup' AND FPERMITEMID = '47150e89000000ac' AND NOT EXISTS (SELECT b.fid from T_PERM_ADMINGROUPFUNPERM as b WHERE b.FID = a.FID - 500000000000000005);

INSERT INTO T_PERM_ADMINGROUPFUNPERM (FID, FUSERGROUPID, FAPPID, FENTITYNUM, FPERMITEMID) SELECT FID - 500000000000000006, FUSERGROUPID, '15NPDX/GJFOO', 'hrcs_useradmingroup', '4=MZMF4EZ6I2' FROM T_PERM_ADMINGROUPFUNPERM as a WHERE FENTITYNUM = 'hrcs_useradmingroup' AND FPERMITEMID = '47150e89000000ac' AND NOT EXISTS (SELECT b.fid from T_PERM_ADMINGROUPFUNPERM as b WHERE b.FID = a.FID - 500000000000000006);

