SELECT CTLR_MNGM_NMBR,   
       CTLR_TYPE_CD,     
       VALD_YN,          
       X_CRDN,           
       Y_CRDN,           
       LCTN,             
       TRMN_IP,          
       TRMN_PORT,        
       CTLR_CLCT_CYCL,   
       CTLR_STTS_CYCL,   
       LOOP_BORD_NUM,    
       DLTR_NMBR,        
       DEL_DT,           
       DEL_YN,           
       FRST_REGR_NMBR,   
       FRST_RGST_DT,     
       LAST_CRPR_NMBR,   
       LAST_CRCT__DT     
  FROM TB_VDS_CTLR       


-- 등록 시설물
SELECT 'VDS' AS FAC_TYPE, CTLR_MNGM_NMBR AS FAC_ID, LCTN AS FAC_N, DEL_YN
  FROM TB_VDS_CTLR 
 WHERE DEL_YN = 'N'

--시설물 상태
SELECT 'VDS' AS FAC_TYPE, CTLR_MNGM_NMBR AS FAC_ID, 
       DECODE(CMNC_STTS_CD, 'CMS0', '1', 'CMS1', '0', '2') AS COMM,
       DECODE(CBOX_DOOR_STTS_CD, 'CDS0', '0', 'CDS1', '1', '2') AS DOOR
  FROM TB_VDS_CTLR_STTS 
 WHERE UPDT_DT >= TO_CHAR(SYSDATE-2/1440, 'YYYYMMDDHH24MISS')
