最近做的一个项目需要将两套Pro_Watch门禁整合在一起,以方便用户的日常使用管理。
因为Pro_Watch门禁的控制器是有分配IP地址的,客户端软件只是配置生成数据,然后将数据下载到控制器内存中,并且两套系统在同一网段中,所以只需将两套系统的数据进行整合就行了。 Pro_Watch门禁控制器型号都是PW5000,软件版本都是7456,使用的是SQL2000数据库,表结构是一样的。初步确定整合方案可行。
将两套数据放在一个服务器上,便于数据的合并操作。
以下就是需操作合并的库表及语句。
---站点一:商务中心,有3个PW5000控制器,读卡器34个,已发卡77张, 站点ID:gong
---站点二:业务中心,有2个PW5000控制器,读卡器44个,已发卡214张, 站点ID:sgant
----------------------------------ProWatch--数据合并---二个站点 5个控制器。------------------------
--插入站点数据
insert into SITE (ID,DESCRP,WRKST,SIGNATURE_TYPE,VISUAL_AUDIT_LOGGING,FREE_TEXT_ENTRY,PREDEFINED_REASON,WRKST_SEC,WRKST_PRI)
select ID,DESCRP,WRKST,SIGNATURE_TYPE,VISUAL_AUDIT_LOGGING,FREE_TEXT_ENTRY,PREDEFINED_REASON,WRKST_SEC,WRKST_PRI from PWNT.DBO.SITE WHERE ID IN ('sgant')
--插入通道数据
insert into CHANNEL (
ID,DESCRP,SITE,ADDR,CHANNEL_TYP,SPOOL_DIR,CHANNEL_STAT,UNLOAD,PAUSE,FAST_POLL,COMMBRK,INSTALLED,
PORT_TYP,PORT_TYP_SEC,COM_PORT,COM_PORT_SEC,NET_PORT,NET_PORT_SEC,TCP_PORT,TCP_PORT_SEC,
REV_PORT,REV_PORT_SEC,POOL_ID,POOL_ID_SEC,BAUD,BAUD_SEC,WORDSIZE,WORDSIZE_SEC,FLOWCNTL,
FLOWCNTL_SEC,INITSTR,RESETSTR,TIMEOUT,MINCHARS,MINCHARS_SEC,MINTIME,MINTIME_SEC,ALRMTIME,
ALRMTIME_SEC,PANEL_PHONE,PANEL_PASSWORD,PANEL_IDENT,PORT_STATUS,DELAYCON,DELAYRTY,DL_PORT,
RMTINIT,GTZ,STDINT,NEWINT,PRTYDIAL,PREFIX,DO_PORT,POOL,SCH_ID,TIMER_DIS,NEXT_ATT,ON_MSG,
OFF_MSG,LAST_CALL,CHANNEL_PHONE,CHANNEL_SITE,CHANNEL_SNO,POLL_STRING,TIMEOUT_FORCIBLE,
TIMEOUT_INACTIVE,CHANNEL_USERNAME,CHANNEL_PASSWORD,ENCRYPT_PASSWORD,ENCRYPT_PASSWORD_SEC,
CHANNEL_SITE_ID,DELAY_RETRY_TIME,DELAY_CONNECT_TIME,
PANEL_OLD_PASSWORD,PW5K_USE_ENCRYPTION,PW5K_USE_MASTERKEY,PW5K_MKEY1_PASSPHRASE,
PW5K_MKEY2_PASSPHRASE,PW5K_MKEY1_USE_PASSPHRASE,PW5K_MKEY2_USE_PASSPHRASE,PW5K_MASTERKEY_DOWNLOAD,
PW5K_MASTER_KEY1,PW5K_MASTER_KEY2,SENDTEXT)
select ID,DESCRP,SITE,ADDR,CHANNEL_TYP,SPOOL_DIR,CHANNEL_STAT,UNLOAD,PAUSE,FAST_POLL,COMMBRK,INSTALLED,
PORT_TYP,PORT_TYP_SEC,COM_PORT,COM_PORT_SEC,NET_PORT,NET_PORT_SEC,TCP_PORT,TCP_PORT_SEC,
REV_PORT,REV_PORT_SEC,POOL_ID,POOL_ID_SEC,BAUD,BAUD_SEC,WORDSIZE,WORDSIZE_SEC,FLOWCNTL,
FLOWCNTL_SEC,INITSTR,RESETSTR,TIMEOUT,MINCHARS,MINCHARS_SEC,MINTIME,MINTIME_SEC,ALRMTIME,
ALRMTIME_SEC,PANEL_PHONE,PANEL_PASSWORD,PANEL_IDENT,PORT_STATUS,DELAYCON,DELAYRTY,DL_PORT,
RMTINIT,GTZ,STDINT,NEWINT,PRTYDIAL,PREFIX,DO_PORT,POOL,SCH_ID,TIMER_DIS,NEXT_ATT,ON_MSG,
OFF_MSG,LAST_CALL,CHANNEL_PHONE,CHANNEL_SITE,CHANNEL_SNO,POLL_STRING,TIMEOUT_FORCIBLE,
TIMEOUT_INACTIVE,CHANNEL_USERNAME,CHANNEL_PASSWORD,ENCRYPT_PASSWORD,ENCRYPT_PASSWORD_SEC,
CHANNEL_SITE_ID,DELAY_RETRY_TIME,DELAY_CONNECT_TIME,
PANEL_OLD_PASSWORD,PW5K_USE_ENCRYPTION,PW5K_USE_MASTERKEY,PW5K_MKEY1_PASSPHRASE,
PW5K_MKEY2_PASSPHRASE,PW5K_MKEY1_USE_PASSPHRASE,PW5K_MKEY2_USE_PASSPHRASE,PW5K_MASTERKEY_DOWNLOAD,
PW5K_MASTER_KEY1,PW5K_MASTER_KEY2,SENDTEXT from PWNT.DBO.CHANNEL WHERE ID IN ('sgant::0501','sgant::0502')
--插入控制器数据
insert into PANEL (ID,PPID,DESCRP,SITE,PANEL_TYPE,LOCATION,ADDR,INSTALLED,INIT_CFG,UNLOAD,DLUP,DLUP_PH,
DLUP_TZ,DLUP_THR,SYSCODE,NETWORK_A,NETWORK_B,NETWORK_C,NETWORK_D)
select ID,PPID,DESCRP,SITE,PANEL_TYPE,LOCATION,ADDR,INSTALLED,INIT_CFG,UNLOAD,DLUP,DLUP_PH,
DLUP_TZ,DLUP_THR,SYSCODE,NETWORK_A,NETWORK_B,NETWORK_C,NETWORK_D from PWNT.DBO.PANEL where site='sgant'
----插入 PANEL 数据
INSERT INTO PW5000_PANEL (ID,IS_MINIPLEX,PTYPE,POLL_RETRY,POLL_DELAY,PANEL_REPLY_TIME,OFFLINE_TIME,DWNPORT_COUNT,TRANS_COUNT,
MEM_INSTALLED,TOTAL_CARDS,PIN_LEN,ISSUE_CODES,APASS_LOCATION,ACTIV_DATE,DEACT_DATE,VACAT_DATE,
UPGRADE_DATE,USER_LEVEL,USE_LIMIT,TIMED_APASS,TWOWIRE485,PRECISION_ACCESS,PW3000,PW_LED_SCHEME,
BAUD_PORT34,BAUD_PORT56,RSI_ENABLE,RSI_DEF_SCORE)
SELECT ID,IS_MINIPLEX,PTYPE,POLL_RETRY,POLL_DELAY,PANEL_REPLY_TIME,OFFLINE_TIME,DWNPORT_COUNT,TRANS_COUNT,
MEM_INSTALLED,TOTAL_CARDS,PIN_LEN,ISSUE_CODES,APASS_LOCATION,ACTIV_DATE,DEACT_DATE,VACAT_DATE,
UPGRADE_DATE,USER_LEVEL,USE_LIMIT,TIMED_APASS,TWOWIRE485,PRECISION_ACCESS,PW3000,PW_LED_SCHEME,
BAUD_PORT34,BAUD_PORT56,RSI_ENABLE,RSI_DEF_SCORE FROM PWNT.DBO.PW5000_PANEL WHERE ID IN ('sgant::050101','sgant::050200')
--插入读卡器(逻辑设备)数据 ,要先删除这两个触发器:LOGICAL_DEV_INS,INTERLOCK_TRIGGER_ADD,执行完语句后恢复。
insert into LOGICAL_DEV (ID,DESCRP,LOCATION,HW_CLASS,ALT_DESCRP,PANEL,CONFIG_TYP,DEF_MAPID,DEF_WAVFILE,DEF_AVIFILE,
DEF_INTERCOM,DEF_PAGER,DEF_EMAIL,DEF_AUTO_CCTV_VIEW,DEF_AUTO_CCTV_CMD,DEF_SEL_CCTV_VIEW,
DEF_SEL_CCTV_CMD,SITE,ELV_UNL_CC)
select ID,DESCRP,LOCATION,HW_CLASS,ALT_DESCRP,PANEL,CONFIG_TYP,DEF_MAPID,DEF_WAVFILE,DEF_AVIFILE,
DEF_INTERCOM,DEF_PAGER,DEF_EMAIL,DEF_AUTO_CCTV_VIEW,DEF_AUTO_CCTV_CMD,DEF_SEL_CCTV_VIEW,
DEF_SEL_CCTV_CMD,SITE,ELV_UNL_CC from PWNT.DBO.LOGICAL_DEV WHERE SITE='SGANT'
--插入 访问码 和 逻辑设备 关联数据
insert into LOGICAL_DEV_D (ID,DETAIL_ID,DEVICE_TYP,HARDWARE_ID,HARDWARE_TYPE,INSTALLED)
select ID, DETAIL_ID , DEVICE_TYP,HARDWARE_ID,HARDWARE_TYPE,INSTALLED from PWNT.DBO.LOGICAL_DEV_D
WHERE HARDWARE_ID LIKE 'sgant%'
--插入公司信息数据
insert into company (ID,NAM,ADDS1,ADDS2,CITY,ST,ZIP,C1_NM,C1_PH,C1_TITLE,C2_NM,SYSTEM)
select ID,NAM,ADDS1,ADDS2,CITY,ST,ZIP,C1_NM,C1_PH,C1_TITLE,C2_NM,SYSTEM from PWNT.DBO.company
where id not in (0x0048729E6EB48D9311D4A45600508BC86902,0x00488A1872D040A54A3882E897327E7955A0)
--插入卡证人员信息数据
insert into BADGE (ID,LNAME,FNAME,MI,BADGE_STATUS,BADGE_TYPE,ISSUE_DATE,EXPIRE_DATE)
select ID,LNAME,FNAME,MI,BADGE_STATUS,BADGE_TYPE,ISSUE_DATE,EXPIRE_DATE from PWNT.DBO.BADGE
----插入卡证人员信息关联表数据
insert into BADGE_V (ID,BADGE_DISPPHOTO, BADGE_DISPSIGNATURE,BADGE_WEIGHT)
select ID,BADGE_DISPPHOTO, BADGE_DISPSIGNATURE,BADGE_WEIGHT from PWNT.DBO.BADGE_V
----插入人员卡 信息数据
insert into BADGE_C
(ID,CARDNO,STAT_COD,COMPANY_ID,EXEC_P,OVERRIDE,DOWNLOAD_N,DOWNLOAD_S,EVENT_LEV,ISSUE_LEV,THREAT_LEV,
INXIT,PINCODE,ISSUE_DATE,EXPIRE_DATE,LAST_DOOR,LAST_ACC,PAR_TEXT,TRACE,TYP,ADDTYPE,DISARM_RDR,
ARM_RDR,AUTO_DISABLE_DAYS,ADA,USER_LEVEL,PRIVILEGED,PIN_EXEMPT,FLAG1030,GUARD,ESCORT,VISITOR,
USE_COUNT,USE_ATTEMPTS_COUNT,NEVER_EXPIRE,GROUPACCESS_DOWNLOAD_FLAG,GROUPACCESS_ID,MATRIX_ARM,MATRIX_GUARD)
select ID,CARDNO,STAT_COD,COMPANY_ID,EXEC_P,OVERRIDE,DOWNLOAD_N,DOWNLOAD_S,EVENT_LEV,ISSUE_LEV,THREAT_LEV,
INXIT,PINCODE,ISSUE_DATE,EXPIRE_DATE,LAST_DOOR,LAST_ACC,PAR_TEXT,TRACE,TYP,ADDTYPE,DISARM_RDR,
ARM_RDR,AUTO_DISABLE_DAYS,ADA,USER_LEVEL,PRIVILEGED,PIN_EXEMPT,FLAG1030,GUARD,ESCORT,VISITOR,
USE_COUNT,USE_ATTEMPTS_COUNT,NEVER_EXPIRE,GROUPACCESS_DOWNLOAD_FLAG,GROUPACCESS_ID,MATRIX_ARM,MATRIX_GUARD from PWNT.DBO.BADGE_C
----插入人员 卡 关联表数据
insert into BADGE_CC (ID, CARDNO,CLEAR_COD,CUSTOM_CLEARANCE )
select ID, CARDNO,CLEAR_COD,CUSTOM_CLEARANCE from PWNT.DBO.BADGE_CC
--插入 关联 数据 --
insert into BADGE_CL (ID,CARDNO,LOGICALDEV_ID,GR_FLG,TZ_ID,TEMPACCESS,TEMPACCESS_START_TIME,TEMPACCESS_END_TIME,TEMPACCESS_DOWNLOAD,ALT_TZ_ID)
select ID,CARDNO,LOGICALDEV_ID,GR_FLG,TZ_ID,TEMPACCESS,TEMPACCESS_START_TIME,TEMPACCESS_END_TIME,TEMPACCESS_DOWNLOAD,ALT_TZ_ID from PWNT.DBO.BADGE_CL
--插入 关联 数据 --
insert into HI_QUEUE (ID,CMD,CPAR1,CPAR2,CPAR3,CPAR4,CPAR5,FLAG)
select ID,CMD,CPAR1,CPAR2,CPAR3,CPAR4,CPAR5,FLAG from PWNT.DBO.HI_QUEUE
--插入 关联 数据 --
insert into CHANNEL_DOWNLOAD (HIQ_GUID,CHANNEL_ID,PRI,PATHNAME,DTE_FORMATTED,DTE_DOWNLOAD,TOTAL_RECS,RECS_DOWN,ERRORS,STATUS,MASTER_WRKST,FILE_DESCRP )
select HIQ_GUID,CHANNEL_ID,PRI,PATHNAME,DTE_FORMATTED,DTE_DOWNLOAD,TOTAL_RECS,RECS_DOWN,ERRORS,STATUS,MASTER_WRKST,FILE_DESCRP from PWNT.DBO.CHANNEL_DOWNLOAD
--插入 关联 数据 --
insert into PANEL_ACCLEV (PANEL_ID,CLEAR_ID,SEQ,TZ0,TZ1,TZ2,TZ3,TZ4,TZ5,TZ6,TZ7,TZ8,TZ9,TZA,TZB,TZC,TZD,TZE,TZF,TZ10,TZ11,TZ12,TZ13,TZ14,TZ15,TZ16,TZ17,TZ18,TZ19,
TZ1A,TZ1B,TZ1C,TZ1D,TZ1E,TZ1F,TZ20,TZ21,TZ22,TZ23,TZ24,TZ25,TZ26,TZ27,TZ28,TZ29,TZ2A,TZ2B,TZ2C,TZ2D,TZ2E,TZ2F,TZ30,TZ31,TZ32,TZ33,
TZ34,TZ35,TZ36,TZ37,TZ38,TZ39,TZ3A,TZ3B,TZ3C,TZ3D,TZ3E,TZ3F,TZ40,TZ41,TZ42,TZ43,TZ44,TZ45,TZ46,TZ47,TZ48,TZ49,TZ4A,TZ4B,TZ4C,TZ4D,
TZ4E,TZ4F,TZ50,TZ51,TZ52,TZ53,TZ54,TZ55,TZ56,TZ57,TZ58,TZ59,TZ5A,TZ5B,TZ5C,TZ5D,TZ5E,TZ5F,TZ60,TZ61,TZ62,TZ63,TZ64,TZ65,TZ66,TZ67,
TZ68,TZ69,TZ6A,TZ6B,TZ6C,TZ6D,TZ6E,TZ6F,TZ70,TZ71,TZ72,TZ73,TZ74,TZ75,TZ76,TZ77,TZ78,TZ79,TZ7A,TZ7B,TZ7C,TZ7D,TZ7E,TZ7F)
select PANEL_ID,CLEAR_ID,SEQ,TZ0,TZ1,TZ2,TZ3,TZ4,TZ5,TZ6,TZ7,TZ8,TZ9,TZA,TZB,TZC,TZD,TZE,TZF,TZ10,TZ11,TZ12,TZ13,TZ14,TZ15,TZ16,TZ17,TZ18,TZ19,
TZ1A,TZ1B,TZ1C,TZ1D,TZ1E,TZ1F,TZ20,TZ21,TZ22,TZ23,TZ24,TZ25,TZ26,TZ27,TZ28,TZ29,TZ2A,TZ2B,TZ2C,TZ2D,TZ2E,TZ2F,TZ30,TZ31,TZ32,TZ33,
TZ34,TZ35,TZ36,TZ37,TZ38,TZ39,TZ3A,TZ3B,TZ3C,TZ3D,TZ3E,TZ3F,TZ40,TZ41,TZ42,TZ43,TZ44,TZ45,TZ46,TZ47,TZ48,TZ49,TZ4A,TZ4B,TZ4C,TZ4D,
TZ4E,TZ4F,TZ50,TZ51,TZ52,TZ53,TZ54,TZ55,TZ56,TZ57,TZ58,TZ59,TZ5A,TZ5B,TZ5C,TZ5D,TZ5E,TZ5F,TZ60,TZ61,TZ62,TZ63,TZ64,TZ65,TZ66,TZ67,
TZ68,TZ69,TZ6A,TZ6B,TZ6C,TZ6D,TZ6E,TZ6F,TZ70,TZ71,TZ72,TZ73,TZ74,TZ75,TZ76,TZ77,TZ78,TZ79,TZ7A,TZ7B,TZ7C,TZ7D,TZ7E,TZ7F from PWNT.DBO.PANEL_ACCLEV
where panel_id like 'sgant%'
----插入访问码(权限组)数据
insert into CLEAR (ID,DESCRP,DEF_TZ,EXPIRE,DURATION,DUR_TYPE,ENROLL_RDR,DENROLL_RDR,USE_ELEVATOR,TEMPACCESS,
TEMPACCESS_START_TIME,TEMPACCESS_END_TIME,VISITOR_ENABLE,SYSTEM,ALL_ACCESS)
select ID,DESCRP,DEF_TZ,EXPIRE,DURATION,DUR_TYPE,ENROLL_RDR,DENROLL_RDR,USE_ELEVATOR,TEMPACCESS,
TEMPACCESS_START_TIME,TEMPACCESS_END_TIME,VISITOR_ENABLE,SYSTEM,ALL_ACCESS from PWNT.DBO.CLEAR
where id not in ( 0x004730D686E40D8B4E928C760440EF75745B,0x0047729E6EB68D9311D4A45600508BC86902 )
----插入 访问码 和 逻辑设备 关联数据
insert into CLEAR_L (ID ,LOGICALDEV_ID,TZ_ID)
SELECT ID ,LOGICALDEV_ID,TZ_ID FROM PWNT.DBO.CLEAR_L
----插入 读卡器详细信息 数据
insert into READER (ID,HWDESCRP,PPID,PPTYPE,LOCATION,ADDR,PANEL_ID,INSTALLED,RDR_OVER,LAST_BADGE,LAST_ACC,MON_ACC,CARD_TYP,
RDR_TYPE,LOCK_STATUS,LAST_CARD,USEPIN,LAST_BADGE_NAME,SECURE_MODE,SECURE_MODE_TIMEZONE)
select ID,HWDESCRP,PPID,PPTYPE,LOCATION,ADDR,PANEL_ID,INSTALLED,RDR_OVER,LAST_BADGE,LAST_ACC,MON_ACC,CARD_TYP,
RDR_TYPE,LOCK_STATUS,LAST_CARD,USEPIN,LAST_BADGE_NAME,SECURE_MODE,SECURE_MODE_TIMEZONE
from PWNT.DBO.READER WHERE ID LIKE 'sgant%'
----插入 读卡器配置信息 数据
insert into PW5000_PANEL_R (ID,DATA_FORMAT,KEYPAD_MODE,LED_DRIVE_MODE,STRIKE_MODE,STRIKE_MIN_TIME,STRIKE_MAX_TIME,HELD_OPEN_TIME,
ADA_STRIKE,ADA_HELD_TIME,REX0_TZMASK,REX1_TZMASK,VALID_FORMATS,APB_MODE,APB_IN,APB_OUT,APB_DELAY,
CTL_FLAGS,OFFLINE_MODE,DEFAULT_MODE,ELEVATOR,TRACK_FLOOR,FLOOR_CNT,SUBP_OUTPUT,SUBP_INPUT,PRE_ALARM,
USER_FUNCTIONS,PIN_SUPPRESSION,MASK_HELD_OPEN,MASK_FORCED_OPEN,OVERRIDE_TZ,PIN_RETRIES,BIO_CHANNEL,
BIO_SUPPRESS_TZ,CYPHER_TZ)
SELECT ID,DATA_FORMAT,KEYPAD_MODE,LED_DRIVE_MODE,STRIKE_MODE,STRIKE_MIN_TIME,STRIKE_MAX_TIME,HELD_OPEN_TIME,
ADA_STRIKE,ADA_HELD_TIME,REX0_TZMASK,REX1_TZMASK,VALID_FORMATS,APB_MODE,APB_IN,APB_OUT,APB_DELAY,
CTL_FLAGS,OFFLINE_MODE,DEFAULT_MODE,ELEVATOR,TRACK_FLOOR,FLOOR_CNT,SUBP_OUTPUT,SUBP_INPUT,PRE_ALARM,
USER_FUNCTIONS,PIN_SUPPRESSION,MASK_HELD_OPEN,MASK_FORCED_OPEN,OVERRIDE_TZ,PIN_RETRIES,BIO_CHANNEL,
BIO_SUPPRESS_TZ,CYPHER_TZ FROM PWNT.DBO.PW5000_PANEL_R where id like 'sgant%'
--插入关联数据,
insert into PW5000_PANEL_CFG (PANEL_ID,CF_NUMBER ,CF_ID, FACILITY_CODE )
select PANEL_ID,CF_NUMBER ,CF_ID, FACILITY_CODE from PWNT.DBO.PW5000_PANEL_CFG
WHERE PANEL_ID LIKE 'sgant%'
--插入关联数据,
insert into SPANEL (ID,HWDESCRP,PPID,PPTYPE,SPANEL_TYPE,LOCATION,ADDR,INSTALLED,UNLOAD)
SELECT ID,HWDESCRP,PPID,PPTYPE,SPANEL_TYPE,LOCATION,ADDR,INSTALLED,UNLOAD FROM PWNT.DBO.SPANEL
WHERE ID LIKE 'sgant%'
--插入 卡格式 数据,
insert into CARD_FORMAT (ID,DESCRP,IS_SYSTEM,ID_OFFSET,FUNC,FLAGS,BITS,MIN_DIGITS,MAX_DIGITS,PE_LOC,PE_LEN,PO_LOC,PO_LEN,FC_LOC,
FC_LEN,CH_LOC,CH_LEN,IC_LOC,IC_LEN,CARD_A_LOC,CARD_A_LEN,CARD_B_LOC,CARD_B_LEN,CARD_C_LOC,CARD_C_LEN,
CARD_D_LOC,CARD_D_LEN,COMPANY_CODE_LOC,COMPANY_CODE_LEN,COMPANY_CODE_A_LOC,COMPANY_CODE_A_LEN,COMPANY_CODE_B_LOC,
COMPANY_CODE_B_LEN,EXP_DATE_LOC,EXP_DATE_LEN,SEEP_FC_LOC,SEEP_FC_LEN,SITE_CODE_LOC,SITE_CODE_LEN,
SITE_CODE_A_LOC,SITE_CODE_A_LEN,SITE_CODE_B_LOC,SITE_CODE_B_LEN,PE_COLOR,PO_COLOR,FC_COLOR,CH_COLOR,
IC_COLOR,CARD_A_COLOR,CARD_B_COLOR,CARD_C_COLOR,CARD_D_COLOR,COMPANY_COLOR,COMPANY_A_COLOR,COMPANY_B_COLOR,
EXP_DATE_COLOR,SEEP_FC_COLOR,SITE_COLOR,SITE_A_COLOR,SITE_B_COLOR,EMPTY_COLOR,CURRENT_FIELD,CHIP_PARITY_LEN,
CHIP_START_PARITY,CHIP_END_PARITY,PW2K_FORMAT_STRING,IS_PW5K_DEFAULT)
SELECT ID,DESCRP,IS_SYSTEM,ID_OFFSET,FUNC,FLAGS,BITS,MIN_DIGITS,MAX_DIGITS,PE_LOC,PE_LEN,PO_LOC,PO_LEN,FC_LOC,
FC_LEN,CH_LOC,CH_LEN,IC_LOC,IC_LEN,CARD_A_LOC,CARD_A_LEN,CARD_B_LOC,CARD_B_LEN,CARD_C_LOC,CARD_C_LEN,
CARD_D_LOC,CARD_D_LEN,COMPANY_CODE_LOC,COMPANY_CODE_LEN,COMPANY_CODE_A_LOC,COMPANY_CODE_A_LEN,COMPANY_CODE_B_LOC,
COMPANY_CODE_B_LEN,EXP_DATE_LOC,EXP_DATE_LEN,SEEP_FC_LOC,SEEP_FC_LEN,SITE_CODE_LOC,SITE_CODE_LEN,
SITE_CODE_A_LOC,SITE_CODE_A_LEN,SITE_CODE_B_LOC,SITE_CODE_B_LEN,PE_COLOR,PO_COLOR,FC_COLOR,CH_COLOR,
IC_COLOR,CARD_A_COLOR,CARD_B_COLOR,CARD_C_COLOR,CARD_D_COLOR,COMPANY_COLOR,COMPANY_A_COLOR,COMPANY_B_COLOR,
EXP_DATE_COLOR,SEEP_FC_COLOR,SITE_COLOR,SITE_A_COLOR,SITE_B_COLOR,EMPTY_COLOR,CURRENT_FIELD,CHIP_PARITY_LEN,
CHIP_START_PARITY,CHIP_END_PARITY,PW2K_FORMAT_STRING,IS_PW5K_DEFAULT FROM PWNT.DBO.CARD_FORMAT
where id in ( 0x007CC5429947D5174940A93AECD450483B0A,0x007CD89614842D364957BFEEDFDBFC237705)
--插入 逻辑设备输出点 数据
insert into OUTPUT (ID, HWDESCRP,PPID,PPTYPE,LOCATION,PT_NBR,PANEL_ID, INSTALLED)
SELECT ID, HWDESCRP,PPID,PPTYPE,LOCATION,PT_NBR,PANEL_ID, INSTALLED FROM PWNT.DBO.OUTPUT
WHERE ID LIKE 'sgant%'
--插入 逻辑设备输入点 数据
insert into INPUT ( ID, HWDESCRP,PPID,PPTYPE,LOCATION,INPUT_TYP,PT_NBR,PANEL_ID,SHUNT,ENABLE_FLG )
select ID, HWDESCRP,PPID,PPTYPE,LOCATION,INPUT_TYP,PT_NBR,PANEL_ID,SHUNT,ENABLE_FLG from PWNT.DBO.INPUT
WHERE ID LIKE 'sgant%'
--插入 点 数据, ADDR会重复,所以加上1000
insert into POINT ( ID,DESCRP,DESCRP_R,PPID,PPTYPE,ADDR,ALTYP_ID,ALTYP_ID_R,SHUNT,SHUNT_R,PRI,PRI_R,PRI_CCTV_VIEW,PRI_CCTV_VIEW_R,
SEC_CCTV_VIEW,SEC_CCTV_VIEW_R,PRI_CCTV,PRI_CCTV_R,SEC_CCTV,SEC_CCTV_R,TZ_SUPP,TZ_SUPP_R,WAVE_FIL_A,WAVE_FIL_R,
ANNUN,ANNUN_R,STAT,STAT_R,PAGER,PAGER_R,MAP_ID,MAP_ID_R,PTTXT,PTTXT2,PTTXT_R,PTTXT2_R,EVNT_ID,EVNT_ID_R,RTN,
EMAIL,AVI_FILE,EXT_INSTR,EXT_INSTR_R,ACK_EVNT_ID,CLEAR_EVNT_ID,ACK_EVNT_ID_R,CLEAR_EVNT_ID_R,CID_REC_LINE,
CID_ACCOUNT,CID_USER_EVENT,CID_POINT_USER_ID,CID_GROUP,CID_EVENT_CODE,CID_CS_SEND_RESET )
select ID,DESCRP,DESCRP_R,PPID,PPTYPE,'1000'+ADDR,ALTYP_ID,ALTYP_ID_R,SHUNT,SHUNT_R,PRI,PRI_R,PRI_CCTV_VIEW,PRI_CCTV_VIEW_R,
SEC_CCTV_VIEW,SEC_CCTV_VIEW_R,PRI_CCTV,PRI_CCTV_R,SEC_CCTV,SEC_CCTV_R,TZ_SUPP,TZ_SUPP_R,WAVE_FIL_A,WAVE_FIL_R,
ANNUN,ANNUN_R,STAT,STAT_R,PAGER,PAGER_R,MAP_ID,MAP_ID_R,PTTXT,PTTXT2,PTTXT_R,PTTXT2_R,EVNT_ID,EVNT_ID_R,RTN,
EMAIL,AVI_FILE,EXT_INSTR,EXT_INSTR_R,ACK_EVNT_ID,CLEAR_EVNT_ID,ACK_EVNT_ID_R,CLEAR_EVNT_ID_R,CID_REC_LINE,
CID_ACCOUNT,CID_USER_EVENT,CID_POINT_USER_ID,CID_GROUP,CID_EVENT_CODE,CID_CS_SEND_RESET from PWNT.DBO.POINT
WHERE PPID LIKE 'sgant%'
--插入 数据
insert into TIMECD_T ( ID,SEQ,STARTTIM,STOPTIM,DAYS,IN_USE )
select ID,SEQ,STARTTIM,STOPTIM,DAYS,IN_USE from PWNT.DBO.TIMECD_T where id=0x000EC4612E70A1D14B0E9D8DA25184D86438
--插入 数据
insert into HW_CLASS (ID,DESCRP)
SELECT ID,DESCRP FROM PWNT.DBO.HW_CLASS where id=0x006E1E84B968382546608F6D690F4920A7F7
--插入 时区 数据
insert into PANEL_T ( PPID,TIME_ID,SEQ, SYSTEM_ZONE )
select PPID,TIME_ID,SEQ, SYSTEM_ZONE from PWNT.DBO.PANEL_T WHERE PPID LIKE 'sgant%'
----插入 时区 数据
insert into TIMECD (ID,DESCRP,SYSTEM_ZONE,ALL_ACCESS)
select ID,DESCRP,SYSTEM_ZONE,ALL_ACCESS from PWNT.DBO.TIMECD WHERE ID=0x000EC4612E70A1D14B0E9D8DA25184D86438
--插入 逻辑设备输出点数据
insert into PW5000_PANEL_O (ID,DRIVE_MODE ,DEFAULT_PULSE,TZ_MASK, SHUNTED )
select ID,DRIVE_MODE ,DEFAULT_PULSE,TZ_MASK, SHUNTED from PWNT.DBO.PW5000_PANEL_O
WHERE ID LIKE 'sgant%'
--插入 逻辑设备输入点数据
insert into PW5000_PANEL_I (ID,SUPERVISED ,DEBOUNCE ,HOLD_TIME, LOG_TRX, MODE_, ENTRY_DELAY ,EXIT_DELAY,TZ_MASK )
select ID,SUPERVISED ,DEBOUNCE ,HOLD_TIME, LOG_TRX, MODE_, ENTRY_DELAY ,EXIT_DELAY,TZ_MASK from PWNT.DBO.PW5000_PANEL_I
WHERE ID LIKE 'sgant%'
----插入 逻辑设备IO数据
insert into PW5000_PANEL_M ( ID,FE_SPANEL_TYPE,PORT,COMMAND_CODE,PIN_RETRIES,EXT_SHUNT_MAX )
select ID,FE_SPANEL_TYPE,PORT,COMMAND_CODE,PIN_RETRIES,EXT_SHUNT_MAX from PWNT.DBO.PW5000_PANEL_M
WHERE ID LIKE 'sgant%'
----插入 数据
INSERT INTO STATUS_GROUP_L (ID,LOGICALDEV_ID)
SELECT ID,LOGICALDEV_ID FROM PWNT.DBO.STATUS_GROUP_L WHERE ID =0x00542B473F85D90943988BDC938136008740
----插入 数据
INSERT INTO STATUS_GROUP_H (ID,HARDWARE_ID)
SELECT ID,HARDWARE_ID FROM PWNT.DBO.STATUS_GROUP_H
----插入 数据 ---
INSERT INTO CLASS_W (ID,WRKSTN_ID)
SELECT ID,WRKSTN_ID FROM PWNT.DBO.CLASS_W WHERE WRKSTN_ID=0x001241454332323637372D444443372D3439
----插入 数据 ---
INSERT INTO COMPANYC (ID,CLEAR_ID)
SELECT ID,CLEAR_ID from PWNT.DBO.COMPANYC WHERE ID NOT IN ( 0x0048729E6EB48D9311D4A45600508BC86902, 0x00488A1872D040A54A3882E897327E7955A0 )
----插入 数据 ---
--以下表中是存的站点Generic 的数据,可以不用合并。
select * from dbo.LOGICAL_DEV_INTERLOCK_PW5000
select * from PWNT.DBO.LOGICAL_DEV_INTERLOCK_PW5000
----插入 数据 --
INSERT INTO MAP (ID,DESCRP,FILENAME, MAPTYPE,MAPDEFAULT , ZOOMLEVEL )
SELECT ID,DESCRP,FILENAME, MAPTYPE,MAPDEFAULT , ZOOMLEVEL FROM PWNT.DBO.MAP
----插入 数据 ---
INSERT INTO MAP_D (ID, SEQ, RESOURCE_ID, DX1,DY1, DX2, DY2, INIT_COLOR, HIGH_METH, FILENAME )
SELECT ID, SEQ, RESOURCE_ID, DX1,DY1, DX2, DY2, INIT_COLOR, HIGH_METH, FILENAME FROM PWNT.DBO.MAP_D
----插入 数据 ---
INSERT INTO MAP_DG ( MAP_ID,RESOURCE_ID,EFFECTIVE_ID )
SELECT MAP_ID,RESOURCE_ID,EFFECTIVE_ID FROM PWNT.DBO.MAP_DG
----插入 数据 ---
--可能还要处理一下
INSERT INTO PANEL_TZACTIVE ( ID,TIME_ID )
SELECT ID,TIME_ID FROM PWNT.DBO.PANEL_TZACTIVE WHERE ID like 'sgant%'
----插入 数据 --- 注意WHERE条件,
INSERT INTO PW5000_PANEL_PROC ( PANEL_ID,PROC_NO,DESCR,PROC_TYPE )
SELECT PANEL_ID,PROC_NO,DESCR,PROC_TYPE FROM PWNT.DBO.PW5000_PANEL_PROC WHERE PANEL_ID like 'sgant%'
----插入 数据 ---
INSERT INTO PW5000_PANEL_PROC_TZ ( PANEL_ID, TZ_ID,ENTRY_PROC,EXIT_PROC,ENTRY_TRIG,EXIT_TRIG )
SELECT PANEL_ID, TZ_ID,ENTRY_PROC,EXIT_PROC,ENTRY_TRIG,EXIT_TRIG FROM PWNT.DBO.PW5000_PANEL_PROC_TZ WHERE PANEL_ID LIKE 'sgant%'
----插入 数据 ---
delete PW5000_PANEL_TG WHERE PANEL_ID LIKE 'sgant%'
INSERT INTO PW5000_PANEL_TG (PANEL_ID,TRG_NO,DESCRP,PROC_NO,PROC_EXISTS,PROC_CMD,SRC_TYPE,SRC_NUM_PANEL,SRC_NUM_HWID,SRC_NUM_TZID,TRAN_TYPE,CODE,TZ,TRIG_TYPE,
TRIG_VAR1,TRIG_VAR2,TRIG_VAR3,TRIG_VAR4,USER_ARG1,USER_ARG2,USER_ARG3,USER_ARG4,DOOR_ALARM_TYPE,PREVIOUS_DOOR_STATE)
SELECT PANEL_ID,TRG_NO,DESCRP,PROC_NO,PROC_EXISTS,PROC_CMD,SRC_TYPE,SRC_NUM_PANEL,SRC_NUM_HWID,SRC_NUM_TZID,TRAN_TYPE,CODE,TZ,TRIG_TYPE,
TRIG_VAR1,TRIG_VAR2,TRIG_VAR3,TRIG_VAR4,USER_ARG1,USER_ARG2,USER_ARG3,USER_ARG4,DOOR_ALARM_TYPE,PREVIOUS_DOOR_STATE FROM PWNT.DBO.PW5000_PANEL_TG WHERE PANEL_ID LIKE 'sgant%'
----------两套门禁系统合并,CHANNEL_SNO不能重复,分别改为2和3,按实际做修改,CHANNEL_SNO都要唯一-------------
----------这很重要,不然将导致控制器处于离线状态。
UPDATE CHANNEL SET CHANNEL_SNO='2' WHERE ID='sgant::0501'
UPDATE CHANNEL SET CHANNEL_SNO='3' WHERE ID='sgant::0502'
---处理完数据后,就选择新加入的站点,右键点属性,重新设置一下主站点,不然设备的状态不能被轮循更新。
---处理完数据后,选择新加入的通道,右键点属性,重新保存一下。
--整合完毕,两个站点,5个控制器,状态都是绿色,都正常,搞定! OK!
因为Pro_Watch门禁的控制器是有分配IP地址的,客户端软件只是配置生成数据,然后将数据下载到控制器内存中,并且两套系统在同一网段中,所以只需将两套系统的数据进行整合就行了。 Pro_Watch门禁控制器型号都是PW5000,软件版本都是7456,使用的是SQL2000数据库,表结构是一样的。初步确定整合方案可行。
将两套数据放在一个服务器上,便于数据的合并操作。
以下就是需操作合并的库表及语句。
---站点一:商务中心,有3个PW5000控制器,读卡器34个,已发卡77张, 站点ID:gong
---站点二:业务中心,有2个PW5000控制器,读卡器44个,已发卡214张, 站点ID:sgant
----------------------------------ProWatch--数据合并---二个站点 5个控制器。------------------------
--插入站点数据
insert into SITE (ID,DESCRP,WRKST,SIGNATURE_TYPE,VISUAL_AUDIT_LOGGING,FREE_TEXT_ENTRY,PREDEFINED_REASON,WRKST_SEC,WRKST_PRI)
select ID,DESCRP,WRKST,SIGNATURE_TYPE,VISUAL_AUDIT_LOGGING,FREE_TEXT_ENTRY,PREDEFINED_REASON,WRKST_SEC,WRKST_PRI from PWNT.DBO.SITE WHERE ID IN ('sgant')
--插入通道数据
insert into CHANNEL (
ID,DESCRP,SITE,ADDR,CHANNEL_TYP,SPOOL_DIR,CHANNEL_STAT,UNLOAD,PAUSE,FAST_POLL,COMMBRK,INSTALLED,
PORT_TYP,PORT_TYP_SEC,COM_PORT,COM_PORT_SEC,NET_PORT,NET_PORT_SEC,TCP_PORT,TCP_PORT_SEC,
REV_PORT,REV_PORT_SEC,POOL_ID,POOL_ID_SEC,BAUD,BAUD_SEC,WORDSIZE,WORDSIZE_SEC,FLOWCNTL,
FLOWCNTL_SEC,INITSTR,RESETSTR,TIMEOUT,MINCHARS,MINCHARS_SEC,MINTIME,MINTIME_SEC,ALRMTIME,
ALRMTIME_SEC,PANEL_PHONE,PANEL_PASSWORD,PANEL_IDENT,PORT_STATUS,DELAYCON,DELAYRTY,DL_PORT,
RMTINIT,GTZ,STDINT,NEWINT,PRTYDIAL,PREFIX,DO_PORT,POOL,SCH_ID,TIMER_DIS,NEXT_ATT,ON_MSG,
OFF_MSG,LAST_CALL,CHANNEL_PHONE,CHANNEL_SITE,CHANNEL_SNO,POLL_STRING,TIMEOUT_FORCIBLE,
TIMEOUT_INACTIVE,CHANNEL_USERNAME,CHANNEL_PASSWORD,ENCRYPT_PASSWORD,ENCRYPT_PASSWORD_SEC,
CHANNEL_SITE_ID,DELAY_RETRY_TIME,DELAY_CONNECT_TIME,
PANEL_OLD_PASSWORD,PW5K_USE_ENCRYPTION,PW5K_USE_MASTERKEY,PW5K_MKEY1_PASSPHRASE,
PW5K_MKEY2_PASSPHRASE,PW5K_MKEY1_USE_PASSPHRASE,PW5K_MKEY2_USE_PASSPHRASE,PW5K_MASTERKEY_DOWNLOAD,
PW5K_MASTER_KEY1,PW5K_MASTER_KEY2,SENDTEXT)
select ID,DESCRP,SITE,ADDR,CHANNEL_TYP,SPOOL_DIR,CHANNEL_STAT,UNLOAD,PAUSE,FAST_POLL,COMMBRK,INSTALLED,
PORT_TYP,PORT_TYP_SEC,COM_PORT,COM_PORT_SEC,NET_PORT,NET_PORT_SEC,TCP_PORT,TCP_PORT_SEC,
REV_PORT,REV_PORT_SEC,POOL_ID,POOL_ID_SEC,BAUD,BAUD_SEC,WORDSIZE,WORDSIZE_SEC,FLOWCNTL,
FLOWCNTL_SEC,INITSTR,RESETSTR,TIMEOUT,MINCHARS,MINCHARS_SEC,MINTIME,MINTIME_SEC,ALRMTIME,
ALRMTIME_SEC,PANEL_PHONE,PANEL_PASSWORD,PANEL_IDENT,PORT_STATUS,DELAYCON,DELAYRTY,DL_PORT,
RMTINIT,GTZ,STDINT,NEWINT,PRTYDIAL,PREFIX,DO_PORT,POOL,SCH_ID,TIMER_DIS,NEXT_ATT,ON_MSG,
OFF_MSG,LAST_CALL,CHANNEL_PHONE,CHANNEL_SITE,CHANNEL_SNO,POLL_STRING,TIMEOUT_FORCIBLE,
TIMEOUT_INACTIVE,CHANNEL_USERNAME,CHANNEL_PASSWORD,ENCRYPT_PASSWORD,ENCRYPT_PASSWORD_SEC,
CHANNEL_SITE_ID,DELAY_RETRY_TIME,DELAY_CONNECT_TIME,
PANEL_OLD_PASSWORD,PW5K_USE_ENCRYPTION,PW5K_USE_MASTERKEY,PW5K_MKEY1_PASSPHRASE,
PW5K_MKEY2_PASSPHRASE,PW5K_MKEY1_USE_PASSPHRASE,PW5K_MKEY2_USE_PASSPHRASE,PW5K_MASTERKEY_DOWNLOAD,
PW5K_MASTER_KEY1,PW5K_MASTER_KEY2,SENDTEXT from PWNT.DBO.CHANNEL WHERE ID IN ('sgant::0501','sgant::0502')
--插入控制器数据
insert into PANEL (ID,PPID,DESCRP,SITE,PANEL_TYPE,LOCATION,ADDR,INSTALLED,INIT_CFG,UNLOAD,DLUP,DLUP_PH,
DLUP_TZ,DLUP_THR,SYSCODE,NETWORK_A,NETWORK_B,NETWORK_C,NETWORK_D)
select ID,PPID,DESCRP,SITE,PANEL_TYPE,LOCATION,ADDR,INSTALLED,INIT_CFG,UNLOAD,DLUP,DLUP_PH,
DLUP_TZ,DLUP_THR,SYSCODE,NETWORK_A,NETWORK_B,NETWORK_C,NETWORK_D from PWNT.DBO.PANEL where site='sgant'
----插入 PANEL 数据
INSERT INTO PW5000_PANEL (ID,IS_MINIPLEX,PTYPE,POLL_RETRY,POLL_DELAY,PANEL_REPLY_TIME,OFFLINE_TIME,DWNPORT_COUNT,TRANS_COUNT,
MEM_INSTALLED,TOTAL_CARDS,PIN_LEN,ISSUE_CODES,APASS_LOCATION,ACTIV_DATE,DEACT_DATE,VACAT_DATE,
UPGRADE_DATE,USER_LEVEL,USE_LIMIT,TIMED_APASS,TWOWIRE485,PRECISION_ACCESS,PW3000,PW_LED_SCHEME,
BAUD_PORT34,BAUD_PORT56,RSI_ENABLE,RSI_DEF_SCORE)
SELECT ID,IS_MINIPLEX,PTYPE,POLL_RETRY,POLL_DELAY,PANEL_REPLY_TIME,OFFLINE_TIME,DWNPORT_COUNT,TRANS_COUNT,
MEM_INSTALLED,TOTAL_CARDS,PIN_LEN,ISSUE_CODES,APASS_LOCATION,ACTIV_DATE,DEACT_DATE,VACAT_DATE,
UPGRADE_DATE,USER_LEVEL,USE_LIMIT,TIMED_APASS,TWOWIRE485,PRECISION_ACCESS,PW3000,PW_LED_SCHEME,
BAUD_PORT34,BAUD_PORT56,RSI_ENABLE,RSI_DEF_SCORE FROM PWNT.DBO.PW5000_PANEL WHERE ID IN ('sgant::050101','sgant::050200')
--插入读卡器(逻辑设备)数据 ,要先删除这两个触发器:LOGICAL_DEV_INS,INTERLOCK_TRIGGER_ADD,执行完语句后恢复。
insert into LOGICAL_DEV (ID,DESCRP,LOCATION,HW_CLASS,ALT_DESCRP,PANEL,CONFIG_TYP,DEF_MAPID,DEF_WAVFILE,DEF_AVIFILE,
DEF_INTERCOM,DEF_PAGER,DEF_EMAIL,DEF_AUTO_CCTV_VIEW,DEF_AUTO_CCTV_CMD,DEF_SEL_CCTV_VIEW,
DEF_SEL_CCTV_CMD,SITE,ELV_UNL_CC)
select ID,DESCRP,LOCATION,HW_CLASS,ALT_DESCRP,PANEL,CONFIG_TYP,DEF_MAPID,DEF_WAVFILE,DEF_AVIFILE,
DEF_INTERCOM,DEF_PAGER,DEF_EMAIL,DEF_AUTO_CCTV_VIEW,DEF_AUTO_CCTV_CMD,DEF_SEL_CCTV_VIEW,
DEF_SEL_CCTV_CMD,SITE,ELV_UNL_CC from PWNT.DBO.LOGICAL_DEV WHERE SITE='SGANT'
--插入 访问码 和 逻辑设备 关联数据
insert into LOGICAL_DEV_D (ID,DETAIL_ID,DEVICE_TYP,HARDWARE_ID,HARDWARE_TYPE,INSTALLED)
select ID, DETAIL_ID , DEVICE_TYP,HARDWARE_ID,HARDWARE_TYPE,INSTALLED from PWNT.DBO.LOGICAL_DEV_D
WHERE HARDWARE_ID LIKE 'sgant%'
--插入公司信息数据
insert into company (ID,NAM,ADDS1,ADDS2,CITY,ST,ZIP,C1_NM,C1_PH,C1_TITLE,C2_NM,SYSTEM)
select ID,NAM,ADDS1,ADDS2,CITY,ST,ZIP,C1_NM,C1_PH,C1_TITLE,C2_NM,SYSTEM from PWNT.DBO.company
where id not in (0x0048729E6EB48D9311D4A45600508BC86902,0x00488A1872D040A54A3882E897327E7955A0)
--插入卡证人员信息数据
insert into BADGE (ID,LNAME,FNAME,MI,BADGE_STATUS,BADGE_TYPE,ISSUE_DATE,EXPIRE_DATE)
select ID,LNAME,FNAME,MI,BADGE_STATUS,BADGE_TYPE,ISSUE_DATE,EXPIRE_DATE from PWNT.DBO.BADGE
----插入卡证人员信息关联表数据
insert into BADGE_V (ID,BADGE_DISPPHOTO, BADGE_DISPSIGNATURE,BADGE_WEIGHT)
select ID,BADGE_DISPPHOTO, BADGE_DISPSIGNATURE,BADGE_WEIGHT from PWNT.DBO.BADGE_V
----插入人员卡 信息数据
insert into BADGE_C
(ID,CARDNO,STAT_COD,COMPANY_ID,EXEC_P,OVERRIDE,DOWNLOAD_N,DOWNLOAD_S,EVENT_LEV,ISSUE_LEV,THREAT_LEV,
INXIT,PINCODE,ISSUE_DATE,EXPIRE_DATE,LAST_DOOR,LAST_ACC,PAR_TEXT,TRACE,TYP,ADDTYPE,DISARM_RDR,
ARM_RDR,AUTO_DISABLE_DAYS,ADA,USER_LEVEL,PRIVILEGED,PIN_EXEMPT,FLAG1030,GUARD,ESCORT,VISITOR,
USE_COUNT,USE_ATTEMPTS_COUNT,NEVER_EXPIRE,GROUPACCESS_DOWNLOAD_FLAG,GROUPACCESS_ID,MATRIX_ARM,MATRIX_GUARD)
select ID,CARDNO,STAT_COD,COMPANY_ID,EXEC_P,OVERRIDE,DOWNLOAD_N,DOWNLOAD_S,EVENT_LEV,ISSUE_LEV,THREAT_LEV,
INXIT,PINCODE,ISSUE_DATE,EXPIRE_DATE,LAST_DOOR,LAST_ACC,PAR_TEXT,TRACE,TYP,ADDTYPE,DISARM_RDR,
ARM_RDR,AUTO_DISABLE_DAYS,ADA,USER_LEVEL,PRIVILEGED,PIN_EXEMPT,FLAG1030,GUARD,ESCORT,VISITOR,
USE_COUNT,USE_ATTEMPTS_COUNT,NEVER_EXPIRE,GROUPACCESS_DOWNLOAD_FLAG,GROUPACCESS_ID,MATRIX_ARM,MATRIX_GUARD from PWNT.DBO.BADGE_C
----插入人员 卡 关联表数据
insert into BADGE_CC (ID, CARDNO,CLEAR_COD,CUSTOM_CLEARANCE )
select ID, CARDNO,CLEAR_COD,CUSTOM_CLEARANCE from PWNT.DBO.BADGE_CC
--插入 关联 数据 --
insert into BADGE_CL (ID,CARDNO,LOGICALDEV_ID,GR_FLG,TZ_ID,TEMPACCESS,TEMPACCESS_START_TIME,TEMPACCESS_END_TIME,TEMPACCESS_DOWNLOAD,ALT_TZ_ID)
select ID,CARDNO,LOGICALDEV_ID,GR_FLG,TZ_ID,TEMPACCESS,TEMPACCESS_START_TIME,TEMPACCESS_END_TIME,TEMPACCESS_DOWNLOAD,ALT_TZ_ID from PWNT.DBO.BADGE_CL
--插入 关联 数据 --
insert into HI_QUEUE (ID,CMD,CPAR1,CPAR2,CPAR3,CPAR4,CPAR5,FLAG)
select ID,CMD,CPAR1,CPAR2,CPAR3,CPAR4,CPAR5,FLAG from PWNT.DBO.HI_QUEUE
--插入 关联 数据 --
insert into CHANNEL_DOWNLOAD (HIQ_GUID,CHANNEL_ID,PRI,PATHNAME,DTE_FORMATTED,DTE_DOWNLOAD,TOTAL_RECS,RECS_DOWN,ERRORS,STATUS,MASTER_WRKST,FILE_DESCRP )
select HIQ_GUID,CHANNEL_ID,PRI,PATHNAME,DTE_FORMATTED,DTE_DOWNLOAD,TOTAL_RECS,RECS_DOWN,ERRORS,STATUS,MASTER_WRKST,FILE_DESCRP from PWNT.DBO.CHANNEL_DOWNLOAD
--插入 关联 数据 --
insert into PANEL_ACCLEV (PANEL_ID,CLEAR_ID,SEQ,TZ0,TZ1,TZ2,TZ3,TZ4,TZ5,TZ6,TZ7,TZ8,TZ9,TZA,TZB,TZC,TZD,TZE,TZF,TZ10,TZ11,TZ12,TZ13,TZ14,TZ15,TZ16,TZ17,TZ18,TZ19,
TZ1A,TZ1B,TZ1C,TZ1D,TZ1E,TZ1F,TZ20,TZ21,TZ22,TZ23,TZ24,TZ25,TZ26,TZ27,TZ28,TZ29,TZ2A,TZ2B,TZ2C,TZ2D,TZ2E,TZ2F,TZ30,TZ31,TZ32,TZ33,
TZ34,TZ35,TZ36,TZ37,TZ38,TZ39,TZ3A,TZ3B,TZ3C,TZ3D,TZ3E,TZ3F,TZ40,TZ41,TZ42,TZ43,TZ44,TZ45,TZ46,TZ47,TZ48,TZ49,TZ4A,TZ4B,TZ4C,TZ4D,
TZ4E,TZ4F,TZ50,TZ51,TZ52,TZ53,TZ54,TZ55,TZ56,TZ57,TZ58,TZ59,TZ5A,TZ5B,TZ5C,TZ5D,TZ5E,TZ5F,TZ60,TZ61,TZ62,TZ63,TZ64,TZ65,TZ66,TZ67,
TZ68,TZ69,TZ6A,TZ6B,TZ6C,TZ6D,TZ6E,TZ6F,TZ70,TZ71,TZ72,TZ73,TZ74,TZ75,TZ76,TZ77,TZ78,TZ79,TZ7A,TZ7B,TZ7C,TZ7D,TZ7E,TZ7F)
select PANEL_ID,CLEAR_ID,SEQ,TZ0,TZ1,TZ2,TZ3,TZ4,TZ5,TZ6,TZ7,TZ8,TZ9,TZA,TZB,TZC,TZD,TZE,TZF,TZ10,TZ11,TZ12,TZ13,TZ14,TZ15,TZ16,TZ17,TZ18,TZ19,
TZ1A,TZ1B,TZ1C,TZ1D,TZ1E,TZ1F,TZ20,TZ21,TZ22,TZ23,TZ24,TZ25,TZ26,TZ27,TZ28,TZ29,TZ2A,TZ2B,TZ2C,TZ2D,TZ2E,TZ2F,TZ30,TZ31,TZ32,TZ33,
TZ34,TZ35,TZ36,TZ37,TZ38,TZ39,TZ3A,TZ3B,TZ3C,TZ3D,TZ3E,TZ3F,TZ40,TZ41,TZ42,TZ43,TZ44,TZ45,TZ46,TZ47,TZ48,TZ49,TZ4A,TZ4B,TZ4C,TZ4D,
TZ4E,TZ4F,TZ50,TZ51,TZ52,TZ53,TZ54,TZ55,TZ56,TZ57,TZ58,TZ59,TZ5A,TZ5B,TZ5C,TZ5D,TZ5E,TZ5F,TZ60,TZ61,TZ62,TZ63,TZ64,TZ65,TZ66,TZ67,
TZ68,TZ69,TZ6A,TZ6B,TZ6C,TZ6D,TZ6E,TZ6F,TZ70,TZ71,TZ72,TZ73,TZ74,TZ75,TZ76,TZ77,TZ78,TZ79,TZ7A,TZ7B,TZ7C,TZ7D,TZ7E,TZ7F from PWNT.DBO.PANEL_ACCLEV
where panel_id like 'sgant%'
----插入访问码(权限组)数据
insert into CLEAR (ID,DESCRP,DEF_TZ,EXPIRE,DURATION,DUR_TYPE,ENROLL_RDR,DENROLL_RDR,USE_ELEVATOR,TEMPACCESS,
TEMPACCESS_START_TIME,TEMPACCESS_END_TIME,VISITOR_ENABLE,SYSTEM,ALL_ACCESS)
select ID,DESCRP,DEF_TZ,EXPIRE,DURATION,DUR_TYPE,ENROLL_RDR,DENROLL_RDR,USE_ELEVATOR,TEMPACCESS,
TEMPACCESS_START_TIME,TEMPACCESS_END_TIME,VISITOR_ENABLE,SYSTEM,ALL_ACCESS from PWNT.DBO.CLEAR
where id not in ( 0x004730D686E40D8B4E928C760440EF75745B,0x0047729E6EB68D9311D4A45600508BC86902 )
----插入 访问码 和 逻辑设备 关联数据
insert into CLEAR_L (ID ,LOGICALDEV_ID,TZ_ID)
SELECT ID ,LOGICALDEV_ID,TZ_ID FROM PWNT.DBO.CLEAR_L
----插入 读卡器详细信息 数据
insert into READER (ID,HWDESCRP,PPID,PPTYPE,LOCATION,ADDR,PANEL_ID,INSTALLED,RDR_OVER,LAST_BADGE,LAST_ACC,MON_ACC,CARD_TYP,
RDR_TYPE,LOCK_STATUS,LAST_CARD,USEPIN,LAST_BADGE_NAME,SECURE_MODE,SECURE_MODE_TIMEZONE)
select ID,HWDESCRP,PPID,PPTYPE,LOCATION,ADDR,PANEL_ID,INSTALLED,RDR_OVER,LAST_BADGE,LAST_ACC,MON_ACC,CARD_TYP,
RDR_TYPE,LOCK_STATUS,LAST_CARD,USEPIN,LAST_BADGE_NAME,SECURE_MODE,SECURE_MODE_TIMEZONE
from PWNT.DBO.READER WHERE ID LIKE 'sgant%'
----插入 读卡器配置信息 数据
insert into PW5000_PANEL_R (ID,DATA_FORMAT,KEYPAD_MODE,LED_DRIVE_MODE,STRIKE_MODE,STRIKE_MIN_TIME,STRIKE_MAX_TIME,HELD_OPEN_TIME,
ADA_STRIKE,ADA_HELD_TIME,REX0_TZMASK,REX1_TZMASK,VALID_FORMATS,APB_MODE,APB_IN,APB_OUT,APB_DELAY,
CTL_FLAGS,OFFLINE_MODE,DEFAULT_MODE,ELEVATOR,TRACK_FLOOR,FLOOR_CNT,SUBP_OUTPUT,SUBP_INPUT,PRE_ALARM,
USER_FUNCTIONS,PIN_SUPPRESSION,MASK_HELD_OPEN,MASK_FORCED_OPEN,OVERRIDE_TZ,PIN_RETRIES,BIO_CHANNEL,
BIO_SUPPRESS_TZ,CYPHER_TZ)
SELECT ID,DATA_FORMAT,KEYPAD_MODE,LED_DRIVE_MODE,STRIKE_MODE,STRIKE_MIN_TIME,STRIKE_MAX_TIME,HELD_OPEN_TIME,
ADA_STRIKE,ADA_HELD_TIME,REX0_TZMASK,REX1_TZMASK,VALID_FORMATS,APB_MODE,APB_IN,APB_OUT,APB_DELAY,
CTL_FLAGS,OFFLINE_MODE,DEFAULT_MODE,ELEVATOR,TRACK_FLOOR,FLOOR_CNT,SUBP_OUTPUT,SUBP_INPUT,PRE_ALARM,
USER_FUNCTIONS,PIN_SUPPRESSION,MASK_HELD_OPEN,MASK_FORCED_OPEN,OVERRIDE_TZ,PIN_RETRIES,BIO_CHANNEL,
BIO_SUPPRESS_TZ,CYPHER_TZ FROM PWNT.DBO.PW5000_PANEL_R where id like 'sgant%'
--插入关联数据,
insert into PW5000_PANEL_CFG (PANEL_ID,CF_NUMBER ,CF_ID, FACILITY_CODE )
select PANEL_ID,CF_NUMBER ,CF_ID, FACILITY_CODE from PWNT.DBO.PW5000_PANEL_CFG
WHERE PANEL_ID LIKE 'sgant%'
--插入关联数据,
insert into SPANEL (ID,HWDESCRP,PPID,PPTYPE,SPANEL_TYPE,LOCATION,ADDR,INSTALLED,UNLOAD)
SELECT ID,HWDESCRP,PPID,PPTYPE,SPANEL_TYPE,LOCATION,ADDR,INSTALLED,UNLOAD FROM PWNT.DBO.SPANEL
WHERE ID LIKE 'sgant%'
--插入 卡格式 数据,
insert into CARD_FORMAT (ID,DESCRP,IS_SYSTEM,ID_OFFSET,FUNC,FLAGS,BITS,MIN_DIGITS,MAX_DIGITS,PE_LOC,PE_LEN,PO_LOC,PO_LEN,FC_LOC,
FC_LEN,CH_LOC,CH_LEN,IC_LOC,IC_LEN,CARD_A_LOC,CARD_A_LEN,CARD_B_LOC,CARD_B_LEN,CARD_C_LOC,CARD_C_LEN,
CARD_D_LOC,CARD_D_LEN,COMPANY_CODE_LOC,COMPANY_CODE_LEN,COMPANY_CODE_A_LOC,COMPANY_CODE_A_LEN,COMPANY_CODE_B_LOC,
COMPANY_CODE_B_LEN,EXP_DATE_LOC,EXP_DATE_LEN,SEEP_FC_LOC,SEEP_FC_LEN,SITE_CODE_LOC,SITE_CODE_LEN,
SITE_CODE_A_LOC,SITE_CODE_A_LEN,SITE_CODE_B_LOC,SITE_CODE_B_LEN,PE_COLOR,PO_COLOR,FC_COLOR,CH_COLOR,
IC_COLOR,CARD_A_COLOR,CARD_B_COLOR,CARD_C_COLOR,CARD_D_COLOR,COMPANY_COLOR,COMPANY_A_COLOR,COMPANY_B_COLOR,
EXP_DATE_COLOR,SEEP_FC_COLOR,SITE_COLOR,SITE_A_COLOR,SITE_B_COLOR,EMPTY_COLOR,CURRENT_FIELD,CHIP_PARITY_LEN,
CHIP_START_PARITY,CHIP_END_PARITY,PW2K_FORMAT_STRING,IS_PW5K_DEFAULT)
SELECT ID,DESCRP,IS_SYSTEM,ID_OFFSET,FUNC,FLAGS,BITS,MIN_DIGITS,MAX_DIGITS,PE_LOC,PE_LEN,PO_LOC,PO_LEN,FC_LOC,
FC_LEN,CH_LOC,CH_LEN,IC_LOC,IC_LEN,CARD_A_LOC,CARD_A_LEN,CARD_B_LOC,CARD_B_LEN,CARD_C_LOC,CARD_C_LEN,
CARD_D_LOC,CARD_D_LEN,COMPANY_CODE_LOC,COMPANY_CODE_LEN,COMPANY_CODE_A_LOC,COMPANY_CODE_A_LEN,COMPANY_CODE_B_LOC,
COMPANY_CODE_B_LEN,EXP_DATE_LOC,EXP_DATE_LEN,SEEP_FC_LOC,SEEP_FC_LEN,SITE_CODE_LOC,SITE_CODE_LEN,
SITE_CODE_A_LOC,SITE_CODE_A_LEN,SITE_CODE_B_LOC,SITE_CODE_B_LEN,PE_COLOR,PO_COLOR,FC_COLOR,CH_COLOR,
IC_COLOR,CARD_A_COLOR,CARD_B_COLOR,CARD_C_COLOR,CARD_D_COLOR,COMPANY_COLOR,COMPANY_A_COLOR,COMPANY_B_COLOR,
EXP_DATE_COLOR,SEEP_FC_COLOR,SITE_COLOR,SITE_A_COLOR,SITE_B_COLOR,EMPTY_COLOR,CURRENT_FIELD,CHIP_PARITY_LEN,
CHIP_START_PARITY,CHIP_END_PARITY,PW2K_FORMAT_STRING,IS_PW5K_DEFAULT FROM PWNT.DBO.CARD_FORMAT
where id in ( 0x007CC5429947D5174940A93AECD450483B0A,0x007CD89614842D364957BFEEDFDBFC237705)
--插入 逻辑设备输出点 数据
insert into OUTPUT (ID, HWDESCRP,PPID,PPTYPE,LOCATION,PT_NBR,PANEL_ID, INSTALLED)
SELECT ID, HWDESCRP,PPID,PPTYPE,LOCATION,PT_NBR,PANEL_ID, INSTALLED FROM PWNT.DBO.OUTPUT
WHERE ID LIKE 'sgant%'
--插入 逻辑设备输入点 数据
insert into INPUT ( ID, HWDESCRP,PPID,PPTYPE,LOCATION,INPUT_TYP,PT_NBR,PANEL_ID,SHUNT,ENABLE_FLG )
select ID, HWDESCRP,PPID,PPTYPE,LOCATION,INPUT_TYP,PT_NBR,PANEL_ID,SHUNT,ENABLE_FLG from PWNT.DBO.INPUT
WHERE ID LIKE 'sgant%'
--插入 点 数据, ADDR会重复,所以加上1000
insert into POINT ( ID,DESCRP,DESCRP_R,PPID,PPTYPE,ADDR,ALTYP_ID,ALTYP_ID_R,SHUNT,SHUNT_R,PRI,PRI_R,PRI_CCTV_VIEW,PRI_CCTV_VIEW_R,
SEC_CCTV_VIEW,SEC_CCTV_VIEW_R,PRI_CCTV,PRI_CCTV_R,SEC_CCTV,SEC_CCTV_R,TZ_SUPP,TZ_SUPP_R,WAVE_FIL_A,WAVE_FIL_R,
ANNUN,ANNUN_R,STAT,STAT_R,PAGER,PAGER_R,MAP_ID,MAP_ID_R,PTTXT,PTTXT2,PTTXT_R,PTTXT2_R,EVNT_ID,EVNT_ID_R,RTN,
EMAIL,AVI_FILE,EXT_INSTR,EXT_INSTR_R,ACK_EVNT_ID,CLEAR_EVNT_ID,ACK_EVNT_ID_R,CLEAR_EVNT_ID_R,CID_REC_LINE,
CID_ACCOUNT,CID_USER_EVENT,CID_POINT_USER_ID,CID_GROUP,CID_EVENT_CODE,CID_CS_SEND_RESET )
select ID,DESCRP,DESCRP_R,PPID,PPTYPE,'1000'+ADDR,ALTYP_ID,ALTYP_ID_R,SHUNT,SHUNT_R,PRI,PRI_R,PRI_CCTV_VIEW,PRI_CCTV_VIEW_R,
SEC_CCTV_VIEW,SEC_CCTV_VIEW_R,PRI_CCTV,PRI_CCTV_R,SEC_CCTV,SEC_CCTV_R,TZ_SUPP,TZ_SUPP_R,WAVE_FIL_A,WAVE_FIL_R,
ANNUN,ANNUN_R,STAT,STAT_R,PAGER,PAGER_R,MAP_ID,MAP_ID_R,PTTXT,PTTXT2,PTTXT_R,PTTXT2_R,EVNT_ID,EVNT_ID_R,RTN,
EMAIL,AVI_FILE,EXT_INSTR,EXT_INSTR_R,ACK_EVNT_ID,CLEAR_EVNT_ID,ACK_EVNT_ID_R,CLEAR_EVNT_ID_R,CID_REC_LINE,
CID_ACCOUNT,CID_USER_EVENT,CID_POINT_USER_ID,CID_GROUP,CID_EVENT_CODE,CID_CS_SEND_RESET from PWNT.DBO.POINT
WHERE PPID LIKE 'sgant%'
--插入 数据
insert into TIMECD_T ( ID,SEQ,STARTTIM,STOPTIM,DAYS,IN_USE )
select ID,SEQ,STARTTIM,STOPTIM,DAYS,IN_USE from PWNT.DBO.TIMECD_T where id=0x000EC4612E70A1D14B0E9D8DA25184D86438
--插入 数据
insert into HW_CLASS (ID,DESCRP)
SELECT ID,DESCRP FROM PWNT.DBO.HW_CLASS where id=0x006E1E84B968382546608F6D690F4920A7F7
--插入 时区 数据
insert into PANEL_T ( PPID,TIME_ID,SEQ, SYSTEM_ZONE )
select PPID,TIME_ID,SEQ, SYSTEM_ZONE from PWNT.DBO.PANEL_T WHERE PPID LIKE 'sgant%'
----插入 时区 数据
insert into TIMECD (ID,DESCRP,SYSTEM_ZONE,ALL_ACCESS)
select ID,DESCRP,SYSTEM_ZONE,ALL_ACCESS from PWNT.DBO.TIMECD WHERE ID=0x000EC4612E70A1D14B0E9D8DA25184D86438
--插入 逻辑设备输出点数据
insert into PW5000_PANEL_O (ID,DRIVE_MODE ,DEFAULT_PULSE,TZ_MASK, SHUNTED )
select ID,DRIVE_MODE ,DEFAULT_PULSE,TZ_MASK, SHUNTED from PWNT.DBO.PW5000_PANEL_O
WHERE ID LIKE 'sgant%'
--插入 逻辑设备输入点数据
insert into PW5000_PANEL_I (ID,SUPERVISED ,DEBOUNCE ,HOLD_TIME, LOG_TRX, MODE_, ENTRY_DELAY ,EXIT_DELAY,TZ_MASK )
select ID,SUPERVISED ,DEBOUNCE ,HOLD_TIME, LOG_TRX, MODE_, ENTRY_DELAY ,EXIT_DELAY,TZ_MASK from PWNT.DBO.PW5000_PANEL_I
WHERE ID LIKE 'sgant%'
----插入 逻辑设备IO数据
insert into PW5000_PANEL_M ( ID,FE_SPANEL_TYPE,PORT,COMMAND_CODE,PIN_RETRIES,EXT_SHUNT_MAX )
select ID,FE_SPANEL_TYPE,PORT,COMMAND_CODE,PIN_RETRIES,EXT_SHUNT_MAX from PWNT.DBO.PW5000_PANEL_M
WHERE ID LIKE 'sgant%'
----插入 数据
INSERT INTO STATUS_GROUP_L (ID,LOGICALDEV_ID)
SELECT ID,LOGICALDEV_ID FROM PWNT.DBO.STATUS_GROUP_L WHERE ID =0x00542B473F85D90943988BDC938136008740
----插入 数据
INSERT INTO STATUS_GROUP_H (ID,HARDWARE_ID)
SELECT ID,HARDWARE_ID FROM PWNT.DBO.STATUS_GROUP_H
----插入 数据 ---
INSERT INTO CLASS_W (ID,WRKSTN_ID)
SELECT ID,WRKSTN_ID FROM PWNT.DBO.CLASS_W WHERE WRKSTN_ID=0x001241454332323637372D444443372D3439
----插入 数据 ---
INSERT INTO COMPANYC (ID,CLEAR_ID)
SELECT ID,CLEAR_ID from PWNT.DBO.COMPANYC WHERE ID NOT IN ( 0x0048729E6EB48D9311D4A45600508BC86902, 0x00488A1872D040A54A3882E897327E7955A0 )
----插入 数据 ---
--以下表中是存的站点Generic 的数据,可以不用合并。
select * from dbo.LOGICAL_DEV_INTERLOCK_PW5000
select * from PWNT.DBO.LOGICAL_DEV_INTERLOCK_PW5000
----插入 数据 --
INSERT INTO MAP (ID,DESCRP,FILENAME, MAPTYPE,MAPDEFAULT , ZOOMLEVEL )
SELECT ID,DESCRP,FILENAME, MAPTYPE,MAPDEFAULT , ZOOMLEVEL FROM PWNT.DBO.MAP
----插入 数据 ---
INSERT INTO MAP_D (ID, SEQ, RESOURCE_ID, DX1,DY1, DX2, DY2, INIT_COLOR, HIGH_METH, FILENAME )
SELECT ID, SEQ, RESOURCE_ID, DX1,DY1, DX2, DY2, INIT_COLOR, HIGH_METH, FILENAME FROM PWNT.DBO.MAP_D
----插入 数据 ---
INSERT INTO MAP_DG ( MAP_ID,RESOURCE_ID,EFFECTIVE_ID )
SELECT MAP_ID,RESOURCE_ID,EFFECTIVE_ID FROM PWNT.DBO.MAP_DG
----插入 数据 ---
--可能还要处理一下
INSERT INTO PANEL_TZACTIVE ( ID,TIME_ID )
SELECT ID,TIME_ID FROM PWNT.DBO.PANEL_TZACTIVE WHERE ID like 'sgant%'
----插入 数据 --- 注意WHERE条件,
INSERT INTO PW5000_PANEL_PROC ( PANEL_ID,PROC_NO,DESCR,PROC_TYPE )
SELECT PANEL_ID,PROC_NO,DESCR,PROC_TYPE FROM PWNT.DBO.PW5000_PANEL_PROC WHERE PANEL_ID like 'sgant%'
----插入 数据 ---
INSERT INTO PW5000_PANEL_PROC_TZ ( PANEL_ID, TZ_ID,ENTRY_PROC,EXIT_PROC,ENTRY_TRIG,EXIT_TRIG )
SELECT PANEL_ID, TZ_ID,ENTRY_PROC,EXIT_PROC,ENTRY_TRIG,EXIT_TRIG FROM PWNT.DBO.PW5000_PANEL_PROC_TZ WHERE PANEL_ID LIKE 'sgant%'
----插入 数据 ---
delete PW5000_PANEL_TG WHERE PANEL_ID LIKE 'sgant%'
INSERT INTO PW5000_PANEL_TG (PANEL_ID,TRG_NO,DESCRP,PROC_NO,PROC_EXISTS,PROC_CMD,SRC_TYPE,SRC_NUM_PANEL,SRC_NUM_HWID,SRC_NUM_TZID,TRAN_TYPE,CODE,TZ,TRIG_TYPE,
TRIG_VAR1,TRIG_VAR2,TRIG_VAR3,TRIG_VAR4,USER_ARG1,USER_ARG2,USER_ARG3,USER_ARG4,DOOR_ALARM_TYPE,PREVIOUS_DOOR_STATE)
SELECT PANEL_ID,TRG_NO,DESCRP,PROC_NO,PROC_EXISTS,PROC_CMD,SRC_TYPE,SRC_NUM_PANEL,SRC_NUM_HWID,SRC_NUM_TZID,TRAN_TYPE,CODE,TZ,TRIG_TYPE,
TRIG_VAR1,TRIG_VAR2,TRIG_VAR3,TRIG_VAR4,USER_ARG1,USER_ARG2,USER_ARG3,USER_ARG4,DOOR_ALARM_TYPE,PREVIOUS_DOOR_STATE FROM PWNT.DBO.PW5000_PANEL_TG WHERE PANEL_ID LIKE 'sgant%'
----------两套门禁系统合并,CHANNEL_SNO不能重复,分别改为2和3,按实际做修改,CHANNEL_SNO都要唯一-------------
----------这很重要,不然将导致控制器处于离线状态。
UPDATE CHANNEL SET CHANNEL_SNO='2' WHERE ID='sgant::0501'
UPDATE CHANNEL SET CHANNEL_SNO='3' WHERE ID='sgant::0502'
---处理完数据后,就选择新加入的站点,右键点属性,重新设置一下主站点,不然设备的状态不能被轮循更新。
---处理完数据后,选择新加入的通道,右键点属性,重新保存一下。
--整合完毕,两个站点,5个控制器,状态都是绿色,都正常,搞定! OK!