IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SEC_USER_U20220618')
DROP TABLE T_SEC_USER_U20220618;

/**BEGIN 备份t_sec_user_u表 **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SEC_USER_U20220618')
CREATE TABLE T_SEC_USER_U20220618 (
FID BIGINT DEFAULT 0 NOT NULL,
FTYPE VARCHAR(10) DEFAULT ' ',
FISLOCKED CHAR(1) DEFAULT '0',
FISFORBIDDEN CHAR(1) DEFAULT '0',
FAUTHORSTATUS VARCHAR(10) DEFAULT ' ',
FPASSWORD VARCHAR(255) DEFAULT ' ',
FISREGISTED CHAR(1) DEFAULT '0',
FISACTIVED CHAR(1) DEFAULT '0',
FERRCOUNT INT DEFAULT 0,
FLOCKEDTIME DATETIME,
FUSERNAME VARCHAR(255) DEFAULT ' ',
FPSWHISSTR VARCHAR(2000) DEFAULT ' ',
FPSWSTRATEGYID BIGINT DEFAULT 0,
FPSWEFFECTIVEDATE DATETIME,
FEXTERNALUUID VARCHAR(255) DEFAULT ' ',
FLASTLOGINIP VARCHAR(128) DEFAULT ' ',
FLASTLOGINTIME DATETIME,
FISACCOUNT CHAR(1) DEFAULT '0',
FUSERDISABLERID BIGINT DEFAULT 0,
FUSERDISABLETIME DATETIME
);

EXEC P_ALTERPK 'PK_T_SEC_USER_U20220618', 'T_SEC_USER_U20220618', 'FID', '1';

insert into T_SEC_USER_U20220618 ( fid,ftype,fislocked,fisforbidden,fauthorstatus,fpassword,fisregisted,fisactived,fusername,fpswhisstr,fpswstrategyid,fpsweffectivedate,ferrcount,flockedtime,fexternaluuid,flastloginip,flastlogintime,fuserdisablerid,fuserdisabletime)
select fid,ftype,fislocked,fisforbidden,fauthorstatus,fpassword,fisregisted,fisactived,fusername,fpswhisstr,fpswstrategyid,fpsweffectivedate,ferrcount,flockedtime,fexternaluuid,flastloginip,flastlogintime,fuserdisablerid,fuserdisabletime from T_SEC_USER_U where fisforbidden = '1';

update t_sec_user_u set fisforbidden ='0' where fisforbidden = '1';