-- ----------by zhangs 20231017-- --------
ALTER TABLE t_lims_order ADD SAMPLEGETNO varchar(100) NULL COMMENT '取样单号';
ALTER TABLE t_lims_order ADD COLLECTSAMPLETIME datetime NULL COMMENT '采样时间';

ALTER table t_lims_task ADD TESTDIRECTIONID bigint NULL COMMENT '制备工艺ID';
ALTER table T_LIMS_TEST_OUTLINE_DETAIL ADD TESTDIRECTIONID bigint NULL COMMENT '制备工艺ID';

CREATE INDEX INSTTASKID_IDX USING BTREE ON t_core_bpmn_inst_task_user (INSTTASKID);
CREATE INDEX ROLEID_IDX USING BTREE ON t_core_bpmn_inst_task_role (ROLEID);
CREATE INDEX TARGETID_IDX USING BTREE ON t_core_bpmn_inst (TARGETID);
CREATE INDEX TASKID_IDX USING BTREE ON t_core_bpmn_comment (TASKID);
CREATE INDEX INSTTASKID_IDX USING BTREE ON t_core_bpmn_inst_task_role (INSTTASKID);
CREATE INDEX INSTID_IDX USING BTREE ON t_core_bpmn_inst_task_user (INSTID);
CREATE INDEX USERID_IDX USING BTREE ON t_core_bpmn_inst_task_user (USERID);
CREATE INDEX INSTID_IDX USING BTREE ON t_core_bpmn_inst_task (INSTID);
-- ----------by zhangs 20231017-- --------



-- ----------------------------- 2022-10-18 add by chengya------------begin

CALL INSERTI18N('T_LIMS_EQUIPT_SATURATION.EQUIPTQUANTITY', '设备饱和率的设备数量', '设备数量', 'zh-CN','设备数量');
CALL INSERTI18N('T_LIMS_EQUIPT_SATURATION.QUANTITY', '设备饱和率的测试总量', '测试总量', 'zh-CN', '测试总量');
CALL INSERTI18N('T_LIMS_EQUIPT_SATURATION.COEFFICIENT', '设备饱和率的人力系数', '人力系数', 'zh-CN', '人力系数');
CALL INSERTI18N('BASEMODULE.TRM.EQUIPT.SATURATIONS.MODAL.ADD', '新增', '新增', 'zh-CN', '新增');

-- ----------------------------- 2022-10-18 add by chengya------------end


-- ----------------------------- 2022-10-19 add by chengya------------begin
delete from t_core_menu
where MENUNAME in ('设备期间核查','期间核查计划','期间核查计划审核','期间核查计划审批','期间核查计划查询','新增期间核查记录','期间核查记录审核','期间核查记录查询');

delete from t_core_menu
where MENUNAME in ('设备饱和率台账','设备饱和率');

delete from t_core_menu
where MENUNAME in ('人员饱和率','人员流失率');

delete from t_core_menu
where MENUNAME in ('实验室变更','实验室变更查询');

delete from t_core_menu where MENUNAME in ('基地管理');

delete from t_core_menu where MENUNAME in ('测试及时率');

delete from t_core_menu where MENUNAME in ('c项目维护');

CALL INSERTI18N('BIND.OPERA.SUCCESS', '操作成功', '操作成功', 'zh-CN', '操作成功');

CALL INSERTI18N('Check equipment during unplanned period!', '期间核查计划启动时数据校验失败时的提示语', '无计划期间核查设备!', 'zh-CN', '无计划期间核查设备!');


-- ----------------------------- 2022-10-19 add by chengya------------end


-- ----------------------------- 2023-10-18 add by gaozq--------------begin

-- 建表语句

CREATE TABLE IF NOT EXISTS `T_LIMS_FILE_DATA_COLLECT`(
                                                         `ID` BIGINT NOT NULL COMMENT '主键',
                                                         `SAMPLECODE` VARCHAR(60)  DEFAULT NULL COMMENT '样品编码',
    `ANALYSTNAME` VARCHAR(60)  DEFAULT NULL COMMENT '分析项',
    `ORIGINALRESULT` VARCHAR(60)  DEFAULT NULL COMMENT '结果',
    `CREATEDBYID` VARCHAR(36)  DEFAULT NULL COMMENT '制单人编码',
    `CREATEDBYNAME` VARCHAR(60)  DEFAULT NULL COMMENT '制单人名称',
    `CREATEDTIME` DATETIME DEFAULT NULL COMMENT '制单时间',
    `CREATEDBYORGID` VARCHAR(36)  DEFAULT NULL COMMENT '制单人单位编码',
    `CREATEDBYORGNAME` VARCHAR(270)  DEFAULT NULL COMMENT '制单人单位名称',
    `UNIT` VARCHAR(36)  DEFAULT NULL COMMENT '单位',
    PRIMARY KEY (`ID`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='文件采集数据';


INSERT INTO T_CORE_AUDIT_CONFIG (ID, NAME, CATEGORY, AUDITABLE)
VALUES ('T_LIMS_FILE_DATA_COLLECT', '文件采集数据', 'service', '1');
CALL INSERTI18N('T_LIMS_FILE_DATA_COLLECT.SERVICE_NAME', '文件采集数据', '文件采集数据', 'zh-CN', '文件采集数据');
CALL INSERTI18N('T_LIMS_FILE_DATA_COLLECT.ID', '文件采集数据的主键', '主键', 'zh-CN', '主键');
CALL INSERTI18N('T_LIMS_FILE_DATA_COLLECT.SAMPLECODE', '文件采集数据的样品编码', '样品编码', 'zh-CN', '样品编码');
CALL INSERTI18N('T_LIMS_FILE_DATA_COLLECT.ANALYSTNAME', '文件采集数据的分析项', '分析项', 'zh-CN', '分析项');
CALL INSERTI18N('T_LIMS_FILE_DATA_COLLECT.ORIGINALRESULT', '文件采集数据的结果', '结果', 'zh-CN', '结果');
CALL INSERTI18N('T_LIMS_FILE_DATA_COLLECT.CREATEDBYID', '文件采集数据的制单人编码', '制单人编码', 'zh-CN', '制单人编码');
CALL INSERTI18N('T_LIMS_FILE_DATA_COLLECT.CREATEDBYNAME', '文件采集数据的制单人名称', '制单人名称', 'zh-CN', '制单人名称');
CALL INSERTI18N('T_LIMS_FILE_DATA_COLLECT.CREATEDTIME', '文件采集数据的制单时间', '制单时间', 'zh-CN', '制单时间');
CALL INSERTI18N('T_LIMS_FILE_DATA_COLLECT.CREATEDBYORGID', '文件采集数据的制单人单位编码', '制单人单位编码', 'zh-CN', '制单人单位编码');
CALL INSERTI18N('T_LIMS_FILE_DATA_COLLECT.CREATEDBYORGNAME', '文件采集数据的制单人单位名称', '制单人单位名称', 'zh-CN', '制单人单位名称');
CALL INSERTI18N('T_LIMS_FILE_DATA_COLLECT.UNIT', '文件采集数据的单位', '单位', 'zh-CN', '单位');
CALL INSERTI18N('BASEMODULE.TRM.EQUIPT.EQUIPTFILEACQ.FILEDATACOLLECTS.MODAL.ADD', '新增', '新增', 'zh-CN', '新增');
CALL INSERTI18N('BASEMODULE.TRM.EQUIPT.EQUIPTFILEACQ.FILEDATACOLLECTS.TAB.BASE_INFO', '基本信息', '基本信息', 'zh-CN', '基本信息');
CALL INSERTI18N('BASEMODULE.TRM.EQUIPT.EQUIPTFILEACQ.FILEDATACOLLECTS.BUTTON.BUTTON', '按钮', '按钮', 'zh-CN', '按钮');
CALL INSERTI18N('BASEMODULE.TRM.EQUIPT.EQUIPTFILEACQ.FILEDATACOLLECTS.TIP.TIP', '提示框', '提示框', 'zh-CN', '提示框');
CALL INSERTI18N('BASEMODULE.TRM.EQUIPT.EQUIPTFILEACQ.FILEDATACOLLECTS.MODAL.MODAL', '对话框', '对话框', 'zh-CN', '对话框');


INSERT INTO T_CORE_TABLE (ID, AUDITABLE, ATTACHMENT)
VALUES ('T_LIMS_FILE_DATA_COLLECT', '0', '0');


COMMIT;

-- ----------------------------- 2023-10-18 add by gaozq------------end
-- ----------------------------- 2023-10-19 add by gaozq------------begin
alter table T_LIMS_EQUIPT add column EQUIPTACCEPTSTATUS VARCHAR(36) null comment '设备验收状态';
CALL INSERTI18N('T_LIMS_EQUIPT.EQUIPTACCEPTSTATUS','设备验收状态','设备验收状态','zh-CN','设备验收状态');

CALL INSERTI18N('T_LIMS_QUALITY_SYSTEM_TEMPLATE.REMARK', '质量体系模板管理的备注', '备注', 'zh-CN', '备注');
CALL INSERTI18N('T_LIMS_BASE_CHANGE.BASE', '实验室变更的基地', '基地', 'zh-CN', '基地');
CALL INSERTI18N('T_LIMS_STAFF_TRAIN.HEAD', '培训考核表的负责人', '负责人', 'zh-CN', '负责人');
CALL INSERTI18N('T_LIMS_STAFF_TRAIN.WORKLICENSELEVEL', '培训考核表的上岗证级别', '上岗证级别', 'zh-CN', '上岗证级别');

-- ----------------------------- 2023-10-19 add by gaozq------------end


-- ----------------------------- 2022-10-20 add by chengya------------begin

CALL INSERTI18N('BASEMODULE.TRM.EQUIPT.EQUIPMAINTAINS.ALREADY_STARTED', '点检计划启用校验失败的提示语', '存在已启用的点检计划！', 'zh-CN', '存在已启用的点检计划！');
CALL INSERTI18N('BASEMODULE.TRM.EQUIPT.EQUIPVERIFICATIONS.ALREADY_STOPPED', '期间核查计划停用时数据校验失败时的提示语', '存在未启用的核查计划！', 'zh-CN', '存在未启用的核查计划！');

-- ----------------------------- 2022-10-20 add by chengya------------end


-- ----------------------------- 2022-10-23 add by chengya------------begin

insert into t_core_admin_choose_config(id, name, title, category, url, width)
VALUES (202310231456,'文件类型选择','文件类型选择','fileType','/secure/basemodule/trm/file-types/page/choose-list','80%');

CALL INSERTI18N('Please fill in the selected data first', '请先填写完选中项的数据', '请先填写完选中项的数据', 'zh-CN', '请先填写完选中项的数据');

-- ----------------------------- 2022-10-23 add by chengya------------end

-- ----------------------------- 2022-10-20 add by chengya------------end
-- ----------------------------- 2022-10-24 add by gaozq------------begin
CALL INSERTI18N('T_LIMS_DISCRIMINATORY_CRITERIA.ABBREVIATION', '判异准则表的简称', '简称', 'zh-CN', '简称');

delete from t_core_menu where MENUNAME in ('质量体系模板管理','加急维护');


INSERT INTO t_core_code (id,codename,codecategoryid,remark,orderno,version,createdbyid,createdbyname,createdtime,lastsuspendedflag,lastsuspendedbyid,lastsuspendedbyname,lastsuspendedtime,code,i18ncode) VALUES
(20231024001,'百特','acqExector',NULL,NULL,NULL,'admin','系统管理员1','2023-10-24 17:00:00.000','0',NULL,NULL,NULL,'BaiteAcqExector',NULL),
(20231024002,'MS3000','acqExector',NULL,NULL,NULL,'admin','系统管理员1','2023-10-24 17:00:00.000','0',NULL,NULL,NULL,'MS3000AcqExector',NULL),
(20231024003,'贝士德','acqExector',NULL,NULL,NULL,'admin','系统管理员1','2023-10-24 17:00:00.000','0',NULL,NULL,NULL,'BeishideAcqExector',NULL),
(20231024004,'麦克','acqExector',NULL,NULL,NULL,'admin','系统管理员1','2023-10-24 17:00:00.000','0',NULL,NULL,NULL,'MaikeAcqExector',NULL),
(20231024005,'碳硫','acqExector',NULL,NULL,NULL,'admin','系统管理员1','2023-10-24 17:00:00.000','0',NULL,NULL,NULL,'TanliuAcqExector',NULL);
delete from t_core_code where id in ('2023080913211','2023080815514');
-- ----------------------------- 2022-10-24 add by gaozq------------end

-- ----------------------------- 2022-10-25 add by chengya------------begin

alter table T_LIMS_EQUIP_MAINTAIN_PLAN modify column PLANNO varchar(16) null comment '计划编号';

alter table T_LIMS_EQUIP_CALIBRATE_PLAN modify column PLANNO varchar(16) null comment '计划编号';

update t_core_sequence set PATTERN = '[key][yyyy][nnnn]', JSONPARAM = null where id = 'T_LIMS_EQUIP_MAINTAIN_PLAN';

update t_core_sequence set PATTERN = '[key][yyyy][nnnn]', JSONPARAM = null where id = 'T_LIMS_EQUIP_CALIBRATE_PLAN';

-- ----------------------------- 2022-10-25 add by chengya------------end
-- ----------------------------- 2022-10-26 add by gaozq------------begin
CALL INSERTI18N('T_LIMS_EQUIPT.ORGNAME', '所属组别', '所属组别', 'zh-CN', '所属组别');

-- ----------------------------- 2022-10-26 add by gaozq------------end
-- ----------------------------- 2022-10-30 add by gaozq------------begin
ALTER TABLE lims_lhxny_dev.t_lims_equipt MODIFY COLUMN `PRECISION` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '设备精度';

INSERT INTO t_core_code (id,codename,codecategoryid,remark,orderno,version,createdbyid,createdbyname,createdtime,lastsuspendedflag,lastsuspendedbyid,lastsuspendedbyname,lastsuspendedtime,code,i18ncode) VALUES
(20231030001,'CS-2800','acqExector',NULL,NULL,NULL,'admin','系统管理员1','2023-10-30 17:00:00.000','0',NULL,NULL,NULL,'CS2800AcqExector',NULL),
(20231030002,'万通水分','acqExector',NULL,NULL,NULL,'admin','系统管理员1','2023-10-30 17:00:00.000','0',NULL,NULL,NULL,'WanTongShuiFenAcqExector',NULL);
-- ----------------------------- 2022-10-30 add by gaozq------------end


-- ----------------------------- 2022-10-31 add by gaozq------------begin
CALL INSERTI18N('T_LIMS_USER_UNIT_AUTHORITY.ORGSTRUCTURE', '组织架构', '组织架构', 'zh-CN', '组织架构');
CALL INSERTI18N('T_CORE_LOGIN_LOG.BROWSER', '登陆日志的客户端浏览器', '客户端浏览器', 'zh-CN', '客户端浏览器');
CALL INSERTI18N('T_LIMS_MENU_ROLE_DIMENSION.DIMENSIONTYPE', '菜单角色维度的维度类型', '维度类型', 'zh-CN', '维度类型');
CALL INSERTI18N('T_CORE_M_USER.SCHEDULEDTIME', '预约变更用户表预约执行时间', '预约执行时间', 'zh-CN', '预约执行时间');
CALL INSERTI18N('T_CORE_ATTORNEY.ENDDATE', '委托代理表的委托结束日期', '委托结束日期', 'zh-CN', '委托结束日期');
CALL INSERTI18N('CORE.MENU.MENUNAME.STATISTICAL.SEARCH', '统计查询', '统计查询', 'zh-CN', '统计查询');

-- ----------------------------- 2022-10-31 add by gaozq------------end

-- ----------------------------- 2022-10-30 add by zhangs------------begin
ALTER TABLE t_lims_test MODIFY COLUMN LABORATORYID varchar(360) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '所属实验室ID';
ALTER TABLE t_lims_test MODIFY COLUMN LABORATORYNAME varchar(360) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '所属实验室';

ALTER TABLE T_LIMS_TEST_OUTLINE MODIFY COLUMN LABORATORYID varchar(360) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '所属实验室ID';
ALTER TABLE T_LIMS_TEST_OUTLINE MODIFY COLUMN LABORATORY varchar(360) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '所属实验室';
-- ----------------------------- 2022-10-30 add by zhangs------------end


