ALTER TABLE `module` MODIFY COLUMN `native_code` int(11) NULL COMMENT '区域编码' AFTER `id`; ALTER TABLE `operation` MODIFY COLUMN `native_code` int(11) NULL COMMENT '区域编码' AFTER `id`; ALTER TABLE `permission` MODIFY COLUMN `native_code` int(11) NULL COMMENT '区域编码' AFTER `id`; INSERT INTO`module` (`id`, `code`, `name`, `url`, `seq`, `index`, `shortcut`, `class`, `action`, `active`, `create_time`, `update_time`, `update_by`, `moduletype`, `p_id`) VALUES ('178', 'companyInfo', '保安服务公司信息', '', '2', '\0', '\0', '', '', '', now(), now(), 'system', '1', '142'), ('179', 'companyPerson', '保安服务公司保安员信息', '', '2', '\0', '\0', '', '', '', now(), now(), 'system', '1', '178'), ('180', 'companyOutTimePerson', '保安服务公司超时未持证保安员信息', '', '2', '\0', '\0', '', '', '', now(), now(), 'system', '1', '178'), ('181', 'trainInfo', '保安培训公司信息', '', '2', '\0', '\0', '', '', '', now(), now(), 'system', '1', '142'), ('182', 'trainPerson', '保安培训公司保安员信息', '', '2', '\0', '\0', '', '', '', now(), now(), 'system', '1', '181'), ('183', 'trainOutTimePerson', '保安培训公司超时未持证保安员信息', '', '2', '\0', '\0', '', '', '', now(), now(), 'system', '1', '181'), ('184', 'confessInfo', '自行招用保安公司信息', '', '2', '\0', '\0', '', '', '', now(), now(), 'system', '1', '142'), ('185', 'confessPerson', '自行招用保安公司保安员信息', '', '2', '\0', '\0', '', '', '', now(), now(), 'system', '1', '184'), ('186', 'confessOutTimePerson', '自行招用保安公司超时未持证保安员信息', '', '2', '\0', '\0', '', '', '', now(), now(), 'system', '1', '184'), ('187', 'personInfo', '保安员信息', '', '2', '\0', '\0', '', '', '', now(), now(), 'system', '1', '142'), ('188', 'quitPerson', '离职保安员信息', '', '2', '\0', '\0', '', '', '', now(), now(), 'system', '1', '187'), ('189', 'outTimePerson', '超时未持证保安员信息', '', '2', '\0', '\0', '', '', '', now(), now(), 'system', '1', '187'); INSERT INTO `operation` (`code`, `name`, `module_id`, `active`, `create_time`, `update_time`, `update_by`) VALUES ('query', '查询', '179', '', now(), now(), 'system'), ('query', '查询', '180', '', now(), now(), 'system'), ('query', '查询', '182', '', now(), now(), 'system'), ('query', '查询', '183', '', now(), now(), 'system'), ('query', '查询', '185', '', now(), now(), 'system'), ('query', '查询', '186', '', now(), now(), 'system'), ('query', '查询', '188', '', now(), now(), 'system'), ('query', '查询', '189', '', now(), now(), 'system'); UPDATE `module` SET p_id=142 WHERE `code`='jdManager' and moduletype=1; UPDATE `module` SET `name`='保安服务公司数据',p_id=178 WHERE `code`='companyInfoManager' and moduletype=1; UPDATE `module` SET `name`='保安培训公司数据',p_id=181 WHERE `code`='trainInfoManager' and moduletype=1; UPDATE `module` SET `name`='自行招用保安公司数据',p_id=184 WHERE `code`='confessInfoManager' and moduletype=1; UPDATE `module` SET `name`='在职保安员信息',p_id=187 WHERE `code`='personInfoManager' and moduletype=1; update permission p1,operation o1 set p1.module_id=187,o1.module_id=187 where p1.operation_id=o1.id and o1.active=true and `code`='securityPerson'; update permission p1,operation o1 set p1.module_id=187,o1.module_id=187 where p1.operation_id=o1.id and o1.active=true and `code`='securityPersonManager'; INSERT INTO`permission` (`role_id`, `module_id`, `operation_id`, `roletype`) select pr.id,o.module_id,o.id,'2' from police_role pr,police p,operation o where pr.active=true and p.active=TRUE and o.active=TRUE and pr.orgid=p.id and o.module_id in (179,180,182,183,185,186,188,189); delete from operation where `code`='securityCompanyManager'; delete from operation where `code`='trainCompanyManager'; delete from operation where `code`='confessCompanyManager'; delete from operation where `code`='securityPersonManager';