IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_ITEMCLASS]') AND type IN ('U'))
DROP TABLE [dbo].[JCL_ORG_ITEMCLASS]
GO

CREATE TABLE [dbo].[JCL_ORG_ITEMCLASS] (
    [fid] int  IDENTITY(1,1) NOT NULL,
    [fno] varchar(50) NOT NULL,
    [fname] varchar(50) NOT NULL,
    [fmemo] varchar(255) NULL,
    [creator] int  NULL,
    [create_time] datetime  NULL,
    [update_time] datetime  NULL
    )
GO

ALTER TABLE [dbo].[JCL_ORG_ITEMCLASS] SET (LOCK_ESCALATION = TABLE)
GO

ALTER TABLE [dbo].[JCL_ORG_ITEMCLASS] ADD CONSTRAINT [JCL_ORG_ITEMCLASS_PK] PRIMARY KEY CLUSTERED ([fid])
    WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
    ON [PRIMARY]
GO

    IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_ITEM]') AND type IN ('U'))
DROP TABLE [dbo].[JCL_ORG_ITEM]
GO

CREATE TABLE [dbo].[JCL_ORG_ITEM] (
    [fid] int  IDENTITY(1,1) NOT NULL,
    [fclassid] int NOT NULL,
    [fno] varchar(50) NOT NULL,
    [fname] varchar(255) NOT NULL,
    [fmemo] varchar(255) NULL,
    [fdelete] int NOT NULL,
    [creator] int  NULL,
    [create_time] datetime  NULL,
    [update_time] datetime  NULL
    )
GO

ALTER TABLE [dbo].[JCL_ORG_ITEM] SET (LOCK_ESCALATION = TABLE)
GO

ALTER TABLE [dbo].[JCL_ORG_ITEM] ADD CONSTRAINT [JCL_ORG_ITEM_PK] PRIMARY KEY CLUSTERED ([fid])
    WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
    ON [PRIMARY]
GO

delete from jcl_org_job where id not in ( select max(id) from jcl_org_job group by parent_comp , parent_dept, parent_job, job_name)
GO
delete from jcl_field_extendinfo where extend_type =4
GO

INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'work_code', '编号', 'varchar(60)', 1, 4, 1, 0, 1, NULL, 1, 1, 1, 1, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","60"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'last_name', '姓名', 'varchar(60)', 1, 4, 1, 1, 1, NULL, 1, 1, 1, 2, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","60"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'sex', '性别', 'int', 5, 4, 1, 1, 1, NULL, 1, 1, 1, 3, 1, 0, GETDATE(), GETDATE(), '1', '["select","select",{"datas":[{"default":"","unuse":"","id":"0","key":"0","option":"男"},{"default":"","unuse":"","id":"1","key":"1","option":"女"}],"sort":"horizontal"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'status', '状态', 'int', 5, 4, 1, 1, 1, NULL, 1, 1, 1, 4, 1, 0, GETDATE(), GETDATE(), '1', '["select","select",{"datas":[{"default":"","unuse":"","id":"0","key":"0","option":"试用"},{"default":"","unuse":"","id":"1","key":"1","option":"正式"},{"default":"","unuse":"","id":"2","key":"2","option":"临时"},{"default":"","unuse":"","id":"3","key":"3","option":"试用延期"},{"default":"","unuse":"","id":"4","key":"4","option":"解聘"},{"default":"","unuse":"","id":"5","key":"5","option":"离职"},{"default":"","unuse":"","id":"6","key":"6","option":"退休"},{"default":"","unuse":"","id":"7","key":"7","option":"无效"},{"default":"","unuse":"","id":"8","key":"8","option":"在职"}],"sort":"horizontal"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'account_type', '账号类型', 'int', 5, 4, 1, 1, 1, NULL, 1, 1, 1, 5, 1, 0, GETDATE(), GETDATE(), '1', '["select","select",{"datas":[{"default":"","unuse":"","id":"0","key":"0","option":"主账号"},{"default":"","unuse":"","id":"1","key":"1","option":"次账号"}],"sort":"horizontal"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'belong_to', '主账号', 'int', 3, 4, 1, 0, 1, NULL, 1, 1, 1, 6, 1, 0, GETDATE(), GETDATE(), '1', '["browser",{"valueSpan":"人力资源","replaceDatas":[{"name":"人力资源","id":"1"}],"value":"1"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'job_title', '岗位', 'int', 3, 4, 1, 1, 1, NULL, 1, 1, 1, 7, 1, 0, GETDATE(), GETDATE(), '666', '["browser",{"valueSpan":"聚才林岗位","replaceDatas":[{"name":"聚才林岗位","id":"666"}],"value":"666"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'job_level', '职级', 'int', 3, 4, 1, 0, 1, NULL, 0, 0, 1, 8, 1, 0, GETDATE(), GETDATE(), '161', '["browser",{"valueSpan":"自定义单选","replaceDatas":[{"name":"自定义单选","id":"161"}],"value":"161"},{"valueSpan":"职级浏览按钮","value":"gradeBrowser"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'job_group_id', '职务类别', 'int', 3, 4, 1, 1, 1, NULL, 1, 1, 1, 9, 1, 0, GETDATE(), GETDATE(), '161', '["browser",{"valueSpan":"自定义单选","replaceDatas":[{"name":"自定义单选","id":"161"}],"value":"161"},{"valueSpan":"职务分类浏览按钮","value":"postBrowser"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'job_activity', '职务', 'int', 3, 4, 1, 1, 1, NULL, 1, 1, 1, 10, 1, 0, GETDATE(), GETDATE(), '161', '["browser",{"valueSpan":"自定义单选","replaceDatas":[{"name":"自定义单选","id":"161"}],"value":"161"},{"valueSpan":"职务信息浏览按钮","value":"PostInfoBrowser"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'location_id', '办公地点', 'int', 3, 4, 1, 1, 1, NULL, 1, 1, 1, 11, 1, 0, GETDATE(), GETDATE(), '262', '["browser",{"valueSpan":"办公地点","replaceDatas":[{"name":"办公地点","id":"262"}],"value":"262"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'show_order', '显示顺序', 'int', 1, 4, 1, 0, 1, NULL, 1, 1, 1, 12, 1, 0, GETDATE(), GETDATE(), '2', '["input","int"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'ec_company', '分部', 'int', 3, 4, 1, 0, 1, NULL, 0, 0, 1, 13, 1, 0, GETDATE(), GETDATE(), '164', '["browser",{"valueSpan":"分部","replaceDatas":[{"name":"分部","id":"164"}],"value":"164"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'ec_department', '部门', 'int', 3, 4, 1, 0, 1, NULL, 0, 0, 1, 14, 1, 0, GETDATE(), GETDATE(), '4', '["browser",{"valueSpan":"部门","replaceDatas":[{"name":"部门","id":"4"}],"value":"4"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'company_start_date', '入职日期', 'char(10)', 3, 4, 1, 0, 1, NULL, 1, 1, 1, 15, 1, 0, GETDATE(), GETDATE(), '2', '["browser",{"valueSpan":"日期","replaceDatas":[{"name":"日期","id":"2"}],"value":"2"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'work_start_date', '参加工作日期', 'char(10)', 3, 4, 1, 0, 1, NULL, 1, 1, 1, 16, 1, 0, GETDATE(), GETDATE(), '2', '["browser",{"valueSpan":"日期","replaceDatas":[{"name":"日期","id":"2"}],"value":"2"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'job_activity_desc', '职责描述', 'varchar(200)', 1, 4, 1, 0, 1, NULL, 1, 1, 1, 17, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","200"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'department_id', '部门', 'int', 3, 4, 0, 0, 0, NULL, 0, 0, 1, 18, 1, 0, GETDATE(), GETDATE(), '161', '["browser",{"valueSpan":"自定义单选","replaceDatas":[{"name":"自定义单选","id":"161"}],"value":"161"},{"valueSpan":"部门浏览按钮","value":"deptBrowser"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'login_id', '登录名', 'varchar(60)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 19, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","60"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'job_call', '职称', 'int', 3, 4, 0, 0, 1, NULL, 1, 1, 1, 20, 1, 0, GETDATE(), GETDATE(), '260', '["browser",{"valueSpan":"职称","replaceDatas":[{"name":"职称","id":"260"}],"value":"260"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'system_language', '系统语言', 'int', 3, 4, 0, 0, 1, NULL, 1, 1, 1, 21, 1, 0, GETDATE(), GETDATE(), '259', '["browser",{"valueSpan":"语言","replaceDatas":[{"name":"语言","id":"259"}],"value":"259"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'resource_image_id', '照片', 'varchar(1000)', 6, 4, 1, 0, 1, NULL, 1, 1, 1, 22, 1, 0, GETDATE(), GETDATE(), '1', '["upload","file"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'messager_url', '头像', 'varchar(1000)', 6, 4, 0, 0, 1, NULL, 1, 1, 1, 23, 1, 0, GETDATE(), GETDATE(), '1', '["upload","file"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'company_id', '分部', 'int', 3, 4, 0, 0, 0, NULL, 0, 0, 1, 24, 1, 0, GETDATE(), GETDATE(), '161', '["browser",{"valueSpan":"自定义单选","replaceDatas":[{"name":"自定义单选","id":"161"}],"value":"161"},{"valueSpan":"公司分部浏览按钮","value":"compBrowser"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'pass_word', '密码', 'varchar(100)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 25, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","100"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'sec_level', '安全级别', 'int', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 26, 1, 0, GETDATE(), GETDATE(), '2', '["input","int"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'birthday', '出生日期', 'char(10)', 3, 4, 0, 0, 1, NULL, 1, 1, 1, 27, 1, 0, GETDATE(), GETDATE(), '2', '["browser",{"valueSpan":"日期","replaceDatas":[{"name":"日期","id":"2"}],"value":"2"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'folk', '民族', 'varchar(30)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 28, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","30"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'native_place', '籍贯', 'varchar(100)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 29, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","100"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'reg_resident_place', '户口', 'varchar(200)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 30, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","200"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'certificate_num', '身份证号码', 'varchar(60)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 31, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","60"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'marital_status', '婚姻状况', 'int', 5, 4, 0, 0, 1, NULL, 1, 1, 1, 32, 1, 0, GETDATE(), GETDATE(), '1', '["select","select",{"datas":[{"default":"","unuse":"","id":"0","key":"0","option":"未婚"},{"default":"","unuse":"","id":"1","key":"1","option":"已婚"},{"default":"","unuse":"","id":"2","key":"2","option":"离异"}],"sort":"horizontal"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'policy', '政治面貌', 'varchar(30)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 33, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","30"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'be_member_date', '入团日期', 'char(10)', 3, 4, 0, 0, 1, NULL, 1, 1, 1, 34, 1, 0, GETDATE(), GETDATE(), '2', '["browser",{"valueSpan":"日期","replaceDatas":[{"name":"日期","id":"2"}],"value":"2"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'start_date', '合同开始日期', 'char(10)', 3, 4, 0, 0, 1, NULL, 1, 1, 1, 35, 1, 0, GETDATE(), GETDATE(), '2', '["browser",{"valueSpan":"日期","replaceDatas":[{"name":"日期","id":"2"}],"value":"2"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'be_party_date', '入党日期', 'char(10)', 3, 4, 0, 0, 1, NULL, 1, 1, 1, 36, 1, 0, GETDATE(), GETDATE(), '2', '["browser",{"valueSpan":"日期","replaceDatas":[{"name":"日期","id":"2"}],"value":"2"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'islabouunion', '工会会员', 'int', 5, 4, 0, 0, 1, NULL, 1, 1, 1, 37, 1, 0, GETDATE(), GETDATE(), '1', '["select","select",{"datas":[{"default":"","unuse":"","id":"0","key":"0","option":"是"},{"default":"","unuse":"","id":"1","key":"1","option":"否"}],"sort":"horizontal"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'education_level', '学历', 'int', 3, 4, 0, 0, 1, NULL, 1, 1, 1, 38, 1, 0, GETDATE(), GETDATE(), '30', '["browser",{"valueSpan":"学历","replaceDatas":[{"name":"学历","id":"30"}],"value":"30"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'degree', '学位', 'varchar(30)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 39, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","30"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'health_info', '健康状况', 'int', 5, 4, 0, 0, 1, NULL, 1, 1, 1, 40, 1, 0, GETDATE(), GETDATE(), '1', '["select","select",{"datas":[{"default":"","unuse":"","id":"0","key":"0","option":"优秀"},{"default":"","unuse":"","id":"1","key":"1","option":"良好"},{"default":"","unuse":"","id":"2","key":"2","option":"一般"},{"default":"","unuse":"","id":"3","key":"3","option":"较差"}],"sort":"horizontal"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'height', '身高', 'int', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 41, 1, 0, GETDATE(), GETDATE(), '2', '["input","int"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'weight', '体重', 'int', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 42, 1, 0, GETDATE(), GETDATE(), '2', '["input","int"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'use_kind', '用工性质', 'int', 3, 4, 0, 0, 1, NULL, 1, 1, 1, 43, 1, 0, GETDATE(), GETDATE(), '31', '["browser",{"valueSpan":"用工性质","replaceDatas":[{"name":"用工性质","id":"31"}],"value":"31"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'end_date', '合同结束日期', 'char(10)', 3, 4, 0, 0, 1, NULL, 1, 1, 1, 44, 1, 0, GETDATE(), GETDATE(), '2', '["browser",{"valueSpan":"日期","replaceDatas":[{"name":"日期","id":"2"}],"value":"2"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'probation_end_date', '试用期结束日期', 'char(10)', 3, 4, 0, 0, 1, NULL, 1, 1, 1, 45, 1, 0, GETDATE(), GETDATE(), '2', '["browser",{"valueSpan":"日期","replaceDatas":[{"name":"日期","id":"2"}],"value":"2"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'resident_place', '现居住地', 'varchar(200)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 46, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","200"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'home_address', '家庭联系方式', 'varchar(100)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 47, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","100"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'temp_resident_number', '暂住证号码', 'varchar(60)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 48, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","60"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'accum_fund_account', '公积金帐户', 'varchar(30)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 49, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","30"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'account_name', '工资账号户名', 'varchar(200)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 50, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","200"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'bank_id', '工资银行', 'varchar(400)', 3, 4, 0, 0, 1, NULL, 1, 1, 1, 51, 1, 0, GETDATE(), GETDATE(), '284', '["browser",{"valueSpan":"工资银行","replaceDatas":[{"name":"工资银行","id":"284"}],"value":"284"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'account_id', '工资账号', 'varchar(100)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 52, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","100"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'classification', '人员密级', 'int', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 53, 1, 0, GETDATE(), GETDATE(), '2', '["input","int"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'work_year', '工龄', 'decimal(15,2)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 54, 1, 0, GETDATE(), GETDATE(), '3', '["input","float"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'company_work_year', '司龄', 'decimal(15,2)', 1, 4, 0, 0, 1, NULL, 1, 1, 1, 55, 1, 0, GETDATE(), GETDATE(), '3', '["input","float"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'manager_id', '直接上级', 'int', 3, 7, 0, 0, 1, NULL, 1, 1, 1, 1, 1, 0, GETDATE(), GETDATE(), '1', '["browser",{"valueSpan":"人力资源","replaceDatas":[{"name":"人力资源","id":"1"}],"value":"1"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'assistant_id', '助理', 'int', 3, 7, 0, 0, 1, NULL, 1, 1, 1, 2, 1, 0, GETDATE(), GETDATE(), '1', '["browser",{"valueSpan":"人力资源","replaceDatas":[{"name":"人力资源","id":"1"}],"value":"1"}]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'mobile', '移动电话', 'varchar(60)', 1, 8, 1, 1, 1, NULL, 1, 1, 1, 1, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","60"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'telephone', '办公室电话', 'varchar(60)', 1, 8, 1, 0, 1, NULL, 1, 1, 1, 2, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","60"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'mobile_call', '其他电话', 'varchar(60)', 1, 8, 0, 0, 1, NULL, 1, 1, 1, 3, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","60"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'fax', '传真', 'varchar(60)', 1, 8, 0, 0, 1, NULL, 1, 1, 1, 4, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","60"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'email', '电子邮件', 'varchar(60)', 1, 8, 1, 1, 1, NULL, 1, 1, 1, 5, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","60"]', 0)
INSERT INTO jcl_field_extendinfo (extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(4, 'JCL_ORG_HRMRESOURCE', 'workroom', '办公室', 'varchar(60)', 1, 8, 0, 0, 1, NULL, 1, 1, 1, 6, 1, 0, GETDATE(), GETDATE(), '1', '["input","text","60"]', 0)
GO


alter table JCL_ORG_HRMRESOURCE add ec_department int
GO
alter table JCL_ORG_HRMRESOURCE add ec_company int
GO
alter table JCL_ORG_HRMRESOURCE add uuid varchar(50)
GO


insert into jcl_org_hrmresource (work_code, last_name, sex, status, account_type, belong_to, job_title, job_level, location_id, show_order, ec_company, company_id, ec_department, department_id, company_start_date, work_start_date, job_activity_desc, resource_image_id, mobile, telephone, email, uuid, delete_type) select a.workcode , a.lastname , a.sex , a.status , a.accounttype , a.belongto , c.id, c.grade_id, a.locationid , a.dsporder , a.subcompanyid1 , c.parent_comp, a.departmentid , c.parent_dept, a.companystartdate , a.workstartdate , a.jobactivitydesc , a.resourceimageid, a.mobile , a.telephone , a.email, a.uuid, 0 from hrmresource a inner join hrmjobtitles b on a.jobtitle = b.id inner join ( select * from jcl_org_job ) c on a.subcompanyid1 = c.ec_company and a.departmentid = c.ec_department and b.jobtitlename = c.job_name
GO