/**Begin D:\PDM_UPGRADE\PDM1\ER_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_REIMBURSELEVEL' AND KSQL_COL_NAME ='FISPRESET')
ALTER TABLE T_ER_REIMBURSELEVEL ADD (FISPRESET CHAR(1) DEFAULT '0' NOT NULL );

/**End D:\PDM_UPGRADE\PDM1\ER_table.sql **/
/**如果预置的报销级别被删了 加回去**/
IF NOT EXISTS (SELECT 1 FROM t_er_reimburselevel WHERE FID = 587648782179519488)
INSERT INTO t_er_reimburselevel(FID,FBITINDEX,FCREATEORGID,FSOURCEDATAID,FMASTERID,FORGID,FSTATUS,FCTRLSTRATEGY,FNUMBER,FCREATETIME,FSOURCEBITINDEX,FMODIFIERID,FENABLE,FISPRESET,FMODIFYTIME,FCREATORID) VALUES (587648782179519488,0,100000,0,587648782179519488,100000,'C','5','General-01',{ts'2019-03-22  00:00:00'},0,1,'1','1',{ts'2019-03-22  00:00:00'},1);
IF NOT EXISTS (SELECT 1 FROM t_er_reimburselevel_l WHERE FID = 587648782179519488)
INSERT INTO t_er_reimburselevel_l(FID,FPKID,FLOCALEID,FDESCRIPTION,FNAME) VALUES (587648782179519488,'/U5BMLKYXNB2','zh_CN','系统默认的报销级别，不允许修改','普通员工');
/**预置的报销级别 General-01，给上系统预置标识**/
UPDATE T_ER_REIMBURSELEVEL SET FISPRESET = '1' WHERE FID = 587648782179519488;