Obsidian/Recognition/Work Related/프로젝트/D-MHFH/유지보수/수협본회 서버 작업.md

3.9 KiB

SP_GET_MSGTXID 수정

CREATE OR REPLACE PROCEDURE DMFHF.SP_GET_MSGTXID(
	ar_mssage_id in varchar2, 
	ar_msg_gbn IN varchar2,
	ret_txid OUT varchar2
)
IS

	host_dt varchar2(8);
	host_hh varchar2(2);
	rtn_data varchar2(1);

BEGIN
	
	/* mssage_id로 먼저 데이터 확인하여 
	 * 기존에 보낸 방송이라면 해당 tx_id return
	 * 기존에 보낸 방송이 아닐때 신규 채번하여 return
	 * 
	 */
	
	rtn_data := '0';

	host_dt := to_char(sysdate, 'yyyymmdd');
 	host_hh := to_char(sysdate, 'HH24'); 

 	IF host_hh > '08' AND host_hh < '16' THEN
		host_hh := '08';
	ELSIF host_hh > '16' AND host_hh < '24' THEN 
		host_hh := '16';
	ELSE 
		host_hh := '00';
	END IF;
 		
 	
    -- 동일시간대 동일 방송 신규채번 방지
	IF ar_mssage_id IS NOT NULL THEN
	
		SELECT nvl(max(msg_txid),0)
		INTO rtn_data
		FROM TB_MSGTXID_H
		WHERE mssage_id like substr(ar_mssage_id, 1, 12)||'%'
		AND MSG_GBN = ar_msg_gbn
		AND CREATE_DT = host_dt
		AND create_hh = host_hh;
		
	END IF;


 	IF rtn_data = '0' THEN
 	
 		SELECT nvl(max(msg_txid),0) + 1
 		INTO rtn_data
		FROM TB_MSGTXID_H
		WHERE CREATE_DT = host_dt
		AND create_hh = host_hh ;
	
		-- tx_id는 7을 넘으면 안됨 (1byte)
		IF rtn_data > '7' THEN
			rtn_data := '7';
		--RETURN;
		END IF ;
	
	
		BEGIN
			
			INSERT INTO TB_MSGTXID_H(create_dt, create_hh, msg_txid, msg_gbn, mssage_id, INSERT_DT)
			values(host_dt, host_hh, rtn_data, ar_msg_gbn, ar_mssage_id, sysdate);
			COMMIT;
		EXCEPTION
			WHEN OTHERS THEN
			ret_txid := '0';
			RETURN;
		END;
	
 	END IF;

	ret_txid := rtn_data;

END SP_GET_MSGTXID;

application.properties ( msg.sndCnt=2 )

어선안전DB TB_FBB_TKOFF 인덱스 생성

 CREATE INDEX idx_TB_FBB_TKOFF_tkoffde ON TB_FBB_TKOFF(TKOFF_DE, TKOFF_TIME);

상황관제 수신현황 오브젝트

DROP TYPE DMFHF_REQUST_COLLECTION_TYPE;

DROP TYPE  DMFHF_REQUST_TYPE;


CREATE TYPE  DMFHF_REQUST_TYPE AS OBJECT
(
	sdt_date varchar2(8),
	ITEM_IDX NUMBER(2),
	MMSI VARCHAR2(9),
	SLOT_NO NUMBER(4,0),
	MSSAGE_ID VARCHAR2(17),
	MODEM_LIST VARCHAR2(400),
	FAILR_MODEM_LIST VARCHAR2(400), 
	PROCESS NUMBER(1,0), 
	PROCESS_DT DATE, 
	BRDCST NUMBER(1,0), 
	INSERT_DT DATE, 
	SND_DT DATE, 
	MSG_TXID varchar2(100),
	INSERT_USER VARCHAR2(30), 
	UPDATE_USER VARCHAR2(30)
);

CREATE TYPE DMFHF_REQUST_COLLECTION_TYPE AS TABLE OF DMFHF_REQUST_TYPE;


상황관제 종합현황 오브젝트


DROP TYPE TOTAL_STATUS_COLLECTION_TYPE;

DROP TYPE TOTAL_STATUS_TYPE;


CREATE TYPE TOTAL_STATUS_TYPE AS OBJECT
(
  	GUBUN	NUMBER,
	GUBUN2	NUMBER,
	MSSAGE_ID	VARCHAR2(20),
	REPORT_DAY	DATE,
	SLOT_NO	NUMBER(4,0),
	MMSI	VARCHAR2(9),
	ALE_REFLCT_YN	VARCHAR2(3),
	SOG	NUMBER,
	COG	NUMBER,
	MODEM_LIST	VARCHAR2(300),
	MSG_DT	DATE,
	LAST_RCV_BRDCST_ID	NUMBER(3,0),
	LAST_RCV_BRDCST_NM VARCHAR2(100),
	LA	NUMBER,
	LO	NUMBER,
	LA_BFE10	NUMBER,
	LO_BFE10	NUMBER,
	LA_BFE20	NUMBER,
	LO_BFE20	NUMBER,
	LA_BFE30	NUMBER,
	LO_BFE30	NUMBER,
	LA_BFE40	NUMBER,
	LO_BFE40	NUMBER,
	LA_BFE50	NUMBER,
	LO_BFE50	NUMBER,
	LA_BFE60	NUMBER,
	LO_BFE60	NUMBER,
	LA_BFE70	NUMBER,
	LO_BFE70	NUMBER,
	LA_BFE80	NUMBER,
	LO_BFE80	NUMBER,
	LA_BFE90	NUMBER,
	LO_BFE90	NUMBER,
	BTRY_STTUS	NUMBER(1,0),
	FSHOPR_TY	NUMBER(2,0),
	GPS_STTUS	NUMBER,
	KDFSH1	NUMBER(4,0),
	TOTALCAT1	NUMBER(6,0),
	KDFSH2	NUMBER(4,0),
	TOTALCAT2	NUMBER(6,0),
	KDFSH3	NUMBER(4,0),
	TOTALCAT3	NUMBER(6,0),
	KDFSH4	NUMBER(4,0),
	TOTALCAT4	NUMBER(6,0),
	KDFSH5	NUMBER(4,0),
	TOTALCAT5	NUMBER(6,0),
	KDFSH6	NUMBER(4,0),
	TOTALCAT6	NUMBER(6,0),
	KDFSH7	NUMBER(4,0),
	TOTALCAT7	NUMBER(6,0),
	DSAST_STTUS	NUMBER,
	DSAST_DT	DATE,
	CANCL_DT	DATE,
	DSAST_TY	NUMBER,
	SND_DT	DATE,
	INSERT_USER	VARCHAR2(30),
	UPDATE_USER	VARCHAR2(30),
	INSERT_DT DATE,
	FQNC VARCHAR2(10),
	MSG_TXID varchar2(100)
);

CREATE TYPE   TOTAL_STATUS_COLLECTION_TYPE AS TABLE OF TOTAL_STATUS_TYPE;

2022-06-30


alter table TB_FBB_LC add(MSSAGE_TY varchar2(2));
alter table TB_FBB_LC add(LAST_RCV_BRDCST_ID NUMBER(1));