-- ----------------------------- 2024-08-01 add by zhangs--------------begin
INSERT INTO t_core_code_category (ID,CODECATEGORYNAME,CODECLASSID,REMARK,ORDERNO,VERSION,CREATEDBYID,CREATEDBYNAME,CREATEDTIME) VALUES
('taskStatus','试验状态','sys',NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO t_core_code (ID,CODENAME,CODECATEGORYID,REMARK,ORDERNO,VERSION,CREATEDBYID,CREATEDBYNAME,CREATEDTIME,LASTSUSPENDEDFLAG,LASTSUSPENDEDBYID,LASTSUSPENDEDBYNAME,LASTSUSPENDEDTIME,CODE,I18NCODE) VALUES
(202408113131,'未提交','taskStatus',NULL,10,0,'admin','系统管理员',NULL,'0',NULL,NULL,NULL,'Draft',NULL);
INSERT INTO t_core_code (ID,CODENAME,CODECATEGORYID,REMARK,ORDERNO,VERSION,CREATEDBYID,CREATEDBYNAME,CREATEDTIME,LASTSUSPENDEDFLAG,LASTSUSPENDEDBYID,LASTSUSPENDEDBYNAME,LASTSUSPENDEDTIME,CODE,I18NCODE) VALUES
(2024080115091,'待领取','taskStatus',NULL,20,0,'admin','系统管理员',NULL,'0',NULL,NULL,NULL,'待领取',NULL);
INSERT INTO t_core_code (ID,CODENAME,CODECATEGORYID,REMARK,ORDERNO,VERSION,CREATEDBYID,CREATEDBYNAME,CREATEDTIME,LASTSUSPENDEDFLAG,LASTSUSPENDEDBYID,LASTSUSPENDEDBYNAME,LASTSUSPENDEDTIME,CODE,I18NCODE) VALUES
(202408113132,'已领取','taskStatus',NULL,30,0,'admin','系统管理员',NULL,'0',NULL,NULL,NULL,'已领取',NULL);
INSERT INTO t_core_code (ID,CODENAME,CODECATEGORYID,REMARK,ORDERNO,VERSION,CREATEDBYID,CREATEDBYNAME,CREATEDTIME,LASTSUSPENDEDFLAG,LASTSUSPENDEDBYID,LASTSUSPENDEDBYNAME,LASTSUSPENDEDTIME,CODE,I18NCODE) VALUES
(2024080115092,'蓝电录入','taskStatus',NULL,40,0,'admin','系统管理员',NULL,'0',NULL,NULL,NULL,'蓝电录入',NULL);
INSERT INTO t_core_code (ID,CODENAME,CODECATEGORYID,REMARK,ORDERNO,VERSION,CREATEDBYID,CREATEDBYNAME,CREATEDTIME,LASTSUSPENDEDFLAG,LASTSUSPENDEDBYID,LASTSUSPENDEDBYNAME,LASTSUSPENDEDTIME,CODE,I18NCODE) VALUES
(202408113133,'结果复核','taskStatus',NULL,50,0,'admin','系统管理员',NULL,'0',NULL,NULL,NULL,'resultCheck',NULL);
INSERT INTO t_core_code (ID,CODENAME,CODECATEGORYID,REMARK,ORDERNO,VERSION,CREATEDBYID,CREATEDBYNAME,CREATEDTIME,LASTSUSPENDEDFLAG,LASTSUSPENDEDBYID,LASTSUSPENDEDBYNAME,LASTSUSPENDEDTIME,CODE,I18NCODE) VALUES
(202408113134,'结果二次复核','taskStatus',NULL,60,0,'admin','系统管理员',NULL,'0',NULL,NULL,NULL,'resultSecondCheck',NULL);
INSERT INTO t_core_code (ID,CODENAME,CODECATEGORYID,REMARK,ORDERNO,VERSION,CREATEDBYID,CREATEDBYNAME,CREATEDTIME,LASTSUSPENDEDFLAG,LASTSUSPENDEDBYID,LASTSUSPENDEDBYNAME,LASTSUSPENDEDTIME,CODE,I18NCODE) VALUES
(202408113135,'完成','taskStatus',NULL,70,0,'admin','系统管理员',NULL,'0',NULL,NULL,NULL,'Done',NULL);
INSERT INTO t_core_code (ID,CODENAME,CODECATEGORYID,REMARK,ORDERNO,VERSION,CREATEDBYID,CREATEDBYNAME,CREATEDTIME,LASTSUSPENDEDFLAG,LASTSUSPENDEDBYID,LASTSUSPENDEDBYNAME,LASTSUSPENDEDTIME,CODE,I18NCODE) VALUES
(202408113136,'取消','taskStatus',NULL,80,0,'admin','系统管理员',NULL,'0',NULL,NULL,NULL,'Cancel',NULL);
-- ----------------------------- 2024-08-01 add by zhangs--------------end

INSERT INTO t_core_schedule_task (ID,TASKNAME,SERVICENAME,METHODNAME,REMARK,CREATEDBYID,CREATEDBYNAME,CREATEDTIME,CREATEDBYORGID,CREATEDBYORGNAME,`TYPE`,IFEXECUTABLESERVICENAME,IFEXECUTABLEMETHODNAME) VALUES
('scheduleProcessFolderStatusDone','定时任务处理委托单状态问题','com.sunwayworld.basemodule.business.test.folder.service.LimsFolderService','scheduleProcessFolderStatusDone',NULL,NULL,NULL,NULL,NULL,NULL,'service',NULL,NULL);

-- ----------------------------- 2024-08-02 add by zhangs--------------begin

-- 建表语句

CREATE TABLE IF NOT EXISTS `T_LIMS_ORDER_CANCEL`(
     `ID` BIGINT NOT NULL COMMENT '主键',
     `FOLDERID` BIGINT DEFAULT NULL COMMENT '委托单ID',
     `ORDERID` BIGINT DEFAULT NULL COMMENT '样品ID',
     `ORDNO` VARCHAR(100)  DEFAULT NULL COMMENT '样品编号',
     `ORDNAME` VARCHAR(100)  DEFAULT NULL COMMENT '样品名称',
     `SENDSAMPLEBATCHNO` VARCHAR(100)  DEFAULT NULL COMMENT '来样批次',
     `CHECKTYPE` VARCHAR(60)  DEFAULT NULL COMMENT '检验类型',
     `FACTORYNO` VARCHAR(100)  DEFAULT NULL COMMENT '工厂编号',
     `MATERIALCODE` VARCHAR(100)  DEFAULT NULL COMMENT '材料号',
     `MATERIALNAME` VARCHAR(100)  DEFAULT NULL COMMENT '材料名称',
     `SAMPLETASKNUMBERHAND` VARCHAR(100)  DEFAULT NULL COMMENT '取样单单号',
     `PRODUCTIONLINENAME` VARCHAR(100)  DEFAULT NULL COMMENT '产线名称',
     `PROCESSES` VARCHAR(100)  DEFAULT NULL COMMENT '工序名称',
     `STATIONWORKCELLNAME` VARCHAR(100)  DEFAULT NULL COMMENT '工位',
     `REINSPECT` VARCHAR(12)  DEFAULT NULL COMMENT '是否复检',
     `CANCELREASON` VARCHAR(200)  DEFAULT NULL COMMENT '取消收样原因',
     `OBTAINTIME` DATETIME DEFAULT NULL COMMENT '取消时间',
     `OBTAINUSERID` VARCHAR(100)  DEFAULT NULL COMMENT '取消人',
     `OBTAINUSERNAME` VARCHAR(100)  DEFAULT NULL COMMENT '取消人',
      PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='样品取消记录';


CALL INSERTI18N('T_LIMS_ORDER_CANCEL.SERVICE_NAME', '样品取消记录', '样品取消记录', 'zh-CN', '样品取消记录');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.ID', '样品取消记录的主键', '主键', 'zh-CN', '主键');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.FOLDERID', '样品取消记录的委托单ID', '委托单ID', 'zh-CN', '委托单ID');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.ORDERID', '样品取消记录的样品ID', '样品ID', 'zh-CN', '样品ID');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.ORDNO', '样品取消记录的样品编号', '样品编号', 'zh-CN', '样品编号');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.ORDNAME', '样品取消记录的样品名称', '样品名称', 'zh-CN', '样品名称');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.SENDSAMPLEBATCHNO', '样品取消记录的来样批次', '来样批次', 'zh-CN', '来样批次');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.CHECKTYPE', '样品取消记录的检验类型', '检验类型', 'zh-CN', '检验类型');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.FACTORYNO', '样品取消记录的工厂编号', '工厂编号', 'zh-CN', '工厂编号');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.MATERIALCODE', '样品取消记录的材料号', '材料号', 'zh-CN', '材料号');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.MATERIALNAME', '样品取消记录的材料名称', '材料名称', 'zh-CN', '材料名称');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.SAMPLETASKNUMBERHAND', '样品取消记录的取样单单号', '取样单单号', 'zh-CN', '取样单单号');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.PRODUCTIONLINENAME', '样品取消记录的产线名称', '产线名称', 'zh-CN', '产线名称');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.PROCESSES', '样品取消记录的工序名称', '工序名称', 'zh-CN', '工序名称');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.STATIONWORKCELLNAME', '样品取消记录的工位', '工位', 'zh-CN', '工位');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.REINSPECT', '样品取消记录的是否复检', '是否复检', 'zh-CN', '是否复检');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.CANCELREASON', '样品取消记录的取消收样原因', '取消收样原因', 'zh-CN', '取消收样原因');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.OBTAINTIME', '样品取消记录的取消时间', '取消时间', 'zh-CN', '取消时间');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.OBTAINUSERID', '样品取消记录的取消人', '取消人', 'zh-CN', '取消人');
CALL INSERTI18N('T_LIMS_ORDER_CANCEL.OBTAINUSERNAME', '样品取消记录的取消人', '取消人', 'zh-CN', '取消人');
CALL INSERTI18N('BASEMODULE.BUSINESS.TEST.ORDERS.MODAL.ADD', '新增', '新增', 'zh-CN', '新增');
CALL INSERTI18N('BASEMODULE.BUSINESS.TEST.ORDERS.TAB.BASE_INFO', '基本信息', '基本信息', 'zh-CN', '基本信息');
CALL INSERTI18N('BASEMODULE.BUSINESS.TEST.ORDERS.BUTTON.BUTTON', '按钮', '按钮', 'zh-CN', '按钮');
CALL INSERTI18N('BASEMODULE.BUSINESS.TEST.ORDERS.TIP.TIP', '提示框', '提示框', 'zh-CN', '提示框');
CALL INSERTI18N('BASEMODULE.BUSINESS.TEST.ORDERS.MODAL.MODAL', '对话框', '对话框', 'zh-CN', '对话框');


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


COMMIT;

-- ----------------------------- 2024-08-02 add by zhangs------------end

INSERT INTO t_core_menu (ID,MENUNAME,HREF,PARENTID,ORDERNO,MENUINITNAME,LASTUPDATEDBYID,LASTUPDATEDBYNAME,LASTUPDATEDTIME,ICON,TODOICON,I18NCODE) VALUES
	 ('20240802001','MOM样品取消记录','/secure/basemodule/business/test/order-cancels/page/search-list','20230922010',4,'MOM样品取消记录',NULL,NULL,NULL,'024.svg',NULL,NULL);

ALTER TABLE t_lims_test_outline ADD TESTHOUR bigint NULL COMMENT '测试时长(小时)';
CALL INSERTI18N('T_LIMS_TEST_OUTLINE.TESTHOUR', '测试时长(小时)', '测试时长(小时)', 'zh-CN', '测试时长(小时)');
ALTER TABLE t_lims_order ADD PLANDIANACQFINSHTIME datetime NULL COMMENT '蓝电采集计划完成时间';
CALL INSERTI18N('T_LIMS_ORDER.PLANDIANACQFINSHTIME', '蓝电采集计划完成时间', '蓝电采集计划完成时间', 'zh-CN', '蓝电采集计划完成时间');

ALTER TABLE t_lims_order ADD OVERTIMEDIANACQ VARCHAR(1) NULL COMMENT '蓝电数据上传是否超期';
CALL INSERTI18N('T_LIMS_ORDER.OVERTIMEDIANACQ', '蓝电数据上传是否超期', '蓝电数据上传是否超期', 'zh-CN', '蓝电数据上传是否超期');

-- ----------------------------- 2024-08-05 add by zhangs------------begin
INSERT INTO t_core_menu (ID,MENUNAME,HREF,PARENTID,ORDERNO,MENUINITNAME,LASTUPDATEDBYID,LASTUPDATEDBYNAME,LASTUPDATEDTIME,ICON,TODOICON,I18NCODE) VALUES
	 ('20240805001','样品查询','/secure/basemodule/business/test/folders/page/edit-list?pageType=orderLabSearch','20230922010',5,'样品查询',NULL,NULL,NULL,'026.svg',NULL,NULL);
-- ----------------------------- 2024-08-05 add by zhangs------------end

-- ----------------------------- 2024-08-20 add by zhangs------------begin
INSERT INTO t_core_menu (ID,MENUNAME,HREF,PARENTID,ORDERNO,MENUINITNAME,LASTUPDATEDBYID,LASTUPDATEDBYNAME,LASTUPDATEDTIME,ICON,TODOICON,I18NCODE) VALUES
	 ('20240820001','按批查询结果数据','/secure/basemodule/business/results/page/resultSearchByBatchPage','1001',27,'按批查询结果数据',NULL,NULL,NULL,'025.svg',NULL,NULL);
-- ----------------------------- 2024-08-20 add by zhangs------------end

-- ----------------------------- 2024-08-22 add by zhangs------------begin
ALTER TABLE t_lims_folder ADD REINSPECTNUM varchar(30) NULL COMMENT '复检次数';
CALL INSERTI18N('T_LIMS_FOLDER.REINSPECTNUM', '复检次数', '复检次数', 'zh-CN', '复检次数');
-- ----------------------------- 2024-08-22 add by zhangs------------end

-- ----------------------------- 2024-08-27 add by zhangs--------------begin

-- 建表语句

CREATE TABLE IF NOT EXISTS `T_LIMS_RETAIN_ORDER`(
     `ID` BIGINT NOT NULL COMMENT '主键',
     `FOLDERNO` VARCHAR(120)  DEFAULT NULL COMMENT '委托单编号',
     `STATUS` VARCHAR(60)  DEFAULT NULL COMMENT '状态',
     `SENDSAMPLEBATCHNO` VARCHAR(60)  DEFAULT NULL COMMENT '样品编号',
     `ORDNAME` VARCHAR(120)  DEFAULT NULL COMMENT '样品名称',
     `PROCESSES` VARCHAR(120)  DEFAULT NULL COMMENT '工序',
     `MATERIALNAME` VARCHAR(120)  DEFAULT NULL COMMENT '材料名称',
     `MATERIALCODE` VARCHAR(120)  DEFAULT NULL COMMENT '材料编码',
     `PRODUCTIONLINENAME` VARCHAR(120)  DEFAULT NULL COMMENT '产线名称',
     `STATIONWORKCELLNAME` VARCHAR(60)  DEFAULT NULL COMMENT '工位',
     `SAMPLEQUALITY` VARCHAR(60)  DEFAULT NULL COMMENT '样品质量(kg)',
     `STARTKEEPTIME` DATETIME DEFAULT NULL COMMENT '开始留样时间',
     `EXPIRETIME` DATETIME DEFAULT NULL COMMENT '过期日期',
     `KEEPLOCATION` VARCHAR(120)  DEFAULT NULL COMMENT '留样位置',
     `OBTAINUSERNAME` VARCHAR(120)  DEFAULT NULL COMMENT '收样人名称',
     `OBTAINTIME` DATETIME DEFAULT NULL COMMENT '收样时间',
     `CANCELREASON` VARCHAR(240)  DEFAULT NULL COMMENT '取消原因',
     `RECEIVEREMARK` VARCHAR(240)  DEFAULT NULL COMMENT '收样备注',
      PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='留样库';


CALL INSERTI18N('T_LIMS_RETAIN_ORDER.SERVICE_NAME', '留样库', '留样库', 'zh-CN', '留样库');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.ID', '留样库的主键', '主键', 'zh-CN', '主键');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.FOLDERNO', '留样库的委托单编号', '委托单编号', 'zh-CN', '委托单编号');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.STATUS', '留样库的状态', '状态', 'zh-CN', '状态');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.SENDSAMPLEBATCHNO', '留样库的样品编号', '样品编号', 'zh-CN', '样品编号');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.ORDNAME', '留样库的样品名称', '样品名称', 'zh-CN', '样品名称');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.PROCESSES', '留样库的工序', '工序', 'zh-CN', '工序');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.MATERIALNAME', '留样库的材料名称', '材料名称', 'zh-CN', '材料名称');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.MATERIALCODE', '留样库的材料编码', '材料编码', 'zh-CN', '材料编码');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.PRODUCTIONLINENAME', '留样库的产线名称', '产线名称', 'zh-CN', '产线名称');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.STATIONWORKCELLNAME', '留样库的工位', '工位', 'zh-CN', '工位');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.SAMPLEQUALITY', '留样库的样品质量(kg)', '样品质量(kg)', 'zh-CN', '样品质量(kg)');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.STARTKEEPTIME', '留样库的开始留样时间', '开始留样时间', 'zh-CN', '开始留样时间');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.EXPIRETIME', '留样库的过期日期', '过期日期', 'zh-CN', '过期日期');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.KEEPLOCATION', '留样库的留样位置', '留样位置', 'zh-CN', '留样位置');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.OBTAINUSERNAME', '留样库的收样人名称', '收样人名称', 'zh-CN', '收样人名称');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.OBTAINTIME', '留样库的收样时间', '收样时间', 'zh-CN', '收样时间');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.CANCELREASON', '留样库的取消原因', '取消原因', 'zh-CN', '取消原因');
CALL INSERTI18N('T_LIMS_RETAIN_ORDER.RECEIVEREMARK', '留样库的收样备注', '收样备注', 'zh-CN', '收样备注');
CALL INSERTI18N('BASEMODULE.BUSINESS.TEST.ORDERS.MODAL.ADD', '新增', '新增', 'zh-CN', '新增');
CALL INSERTI18N('BASEMODULE.BUSINESS.TEST.ORDERS.TAB.BASE_INFO', '基本信息', '基本信息', 'zh-CN', '基本信息');
CALL INSERTI18N('BASEMODULE.BUSINESS.TEST.ORDERS.BUTTON.BUTTON', '按钮', '按钮', 'zh-CN', '按钮');
CALL INSERTI18N('BASEMODULE.BUSINESS.TEST.ORDERS.TIP.TIP', '提示框', '提示框', 'zh-CN', '提示框');
CALL INSERTI18N('BASEMODULE.BUSINESS.TEST.ORDERS.MODAL.MODAL', '对话框', '对话框', 'zh-CN', '对话框');


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


COMMIT;
ALTER TABLE t_lims_retain_order ADD ORDNO varchar(100) NULL COMMENT '样品编号';
INSERT INTO t_core_menu (ID,MENUNAME,HREF,PARENTID,ORDERNO,MENUINITNAME,LASTUPDATEDBYID,LASTUPDATEDBYNAME,LASTUPDATEDTIME,ICON,TODOICON,I18NCODE) VALUES
	 ('20240827001','四川留样库','/secure/basemodule/business/test/retain-orders/page/edit-list','20230922010',4,'四川留样库',NULL,NULL,NULL,'026.svg',NULL,NULL);
-- ----------------------------- 2024-08-27 add by zhangs------------end
