/* 자재관리 자재기본정보 수신 */ MERGE INTO T_EQUIP_BASE USING DUAL ON (MTRL_ID = #{MTRL_ID}) WHEN NOT MATCHED THEN INSERT ( MTRL_ID, MTRL_CL_CD, MTRL_BLON_CL_CD, DEPT1, DEPT2, KDN_DEPT1, KDN_DEPT2, MTRL_CO_ID, MTRL_STRG_PLCE_CD, MTRL_USER_ID, MTRL_STS_CD, LST_BX_NO, WRHSG_SHP_CL_CD, SHP_PURP_CTT, INST_L, INST_M, INST_S, POSS_CLCD , ATCH_FILE_ID1 , MOD_ID, MOD_DATE, REG_ID, REG_DATE ) VALUES ( #{MTRL_ID}, #{MTRL_CL_CD}, #{MTRL_BLON_CL_CD}, #{DEPT1}, #{DEPT2}, #{KDN_DEPT1}, #{KDN_DEPT2}, #{MTRL_CO_ID}, #{MTRL_STRG_PLCE_CD}, #{MTRL_USER_ID}, #{MTRL_STS_CD}, #{LST_BX_NO}, #{WRHSG_SHP_CL_CD}, #{SHP_PURP_CTT}, #{INST_L}, #{INST_M}, #{INST_S}, #{POSS_CLCD} , #{ATCH_FILE_ID1} , NVL(#{MOD_ID}, 'DFXAGENT_USER'), TO_DATE(NVL(#{MOD_DATE}, TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS')), 'YYYYMMDDHH24MISS'), NVL(#{REG_ID}, 'DFXAGENT_USER'), TO_DATE(NVL(#{REG_DATE}, TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS')), 'YYYYMMDDHH24MISS') ) WHEN MATCHED THEN UPDATE SET MTRL_CL_CD = #{MTRL_CL_CD} , MTRL_BLON_CL_CD = #{MTRL_BLON_CL_CD} , DEPT1 = #{DEPT1} , DEPT2 = #{DEPT2} , KDN_DEPT1 = #{KDN_DEPT1} , KDN_DEPT2 = #{KDN_DEPT2} , MTRL_CO_ID = #{MTRL_CO_ID} , MTRL_STRG_PLCE_CD = #{MTRL_STRG_PLCE_CD} , MTRL_USER_ID = #{MTRL_USER_ID} , MTRL_STS_CD = #{MTRL_STS_CD} , LST_BX_NO = #{LST_BX_NO} , WRHSG_SHP_CL_CD = #{WRHSG_SHP_CL_CD} , SHP_PURP_CTT = #{SHP_PURP_CTT} , INST_L = #{INST_L} , INST_M = #{INST_M} , INST_S = #{INST_S} , POSS_CLCD = #{POSS_CLCD} , ATCH_FILE_ID1 = #{ATCH_FILE_ID1} , MOD_ID = NVL(#{MOD_ID}, 'DFXAGENT_USER') , MOD_DATE = DECODE(#{MOD_DATE}, NULL, SYSDATE, TO_DATE(#{MOD_DATE}, 'YYYYMMDDHH24MISS'))
/* 자재관리 자재이력정보 수신 */ MERGE INTO T_EQUIP_MOVE USING DUAL ON (MTRL_HST_SEQNO = #{MTRL_HST_SEQNO}) WHEN NOT MATCHED THEN INSERT ( MTRL_HST_SEQNO, MTRL_ID, MTRL_CL_CD, DCU_ID, MODEM_MAC, METER_ID, WRHSG_SHP_CL_CD, HNDOVR_BLON_CL_CD, TRF_DEPT1, TRF_DEPT2, TRF_KDN_DEPT1, TRF_KDN_DEPT2, HNDOVR_CO_ID, HNDOVR_USER_ID, HNDOVR_STRG_PLCE, TKOVR_BLON_CL_CD, TFE_DEPT1, TFE_DEPT2, TFE_KDN_DEPT1, TFE_KDN_DEPT2, TKOVR_CO_ID, TKOVR_USER_ID, TKOVR_STRG_PLCE, MTRL_STS_CD, WRHSG_SHP_YMD, MTRL_BX_NO , MOD_ID, MOD_DATE, REG_ID, REG_DATE, SEND_YN , SHP_PURP_CD, ATCH_FILE_ID1 ) VALUES ( #{MTRL_HST_SEQNO}, #{MTRL_ID}, #{MTRL_CL_CD}, #{DCU_ID}, #{MODEM_MAC}, #{METER_ID}, #{WRHSG_SHP_CL_CD}, #{HNDOVR_BLON_CL_CD}, #{TRF_DEPT1}, #{TRF_DEPT2}, #{TRF_KDN_DEPT1}, #{TRF_KDN_DEPT2}, #{HNDOVR_CO_ID}, #{HNDOVR_USER_ID}, #{HNDOVR_STRG_PLCE}, #{TKOVR_BLON_CL_CD}, #{TFE_DEPT1}, #{TFE_DEPT2}, #{TFE_KDN_DEPT1}, #{TFE_KDN_DEPT2}, #{TKOVR_CO_ID}, #{TKOVR_USER_ID}, #{TKOVR_STRG_PLCE}, #{MTRL_STS_CD}, #{WRHSG_SHP_YMD}, #{MTRL_BX_NO} , NVL(#{MOD_ID}, 'DFXAGENT_USER'), TO_DATE(NVL(#{MOD_DATE}, TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS')), 'YYYYMMDDHH24MISS'), NVL(#{REG_ID}, 'DFXAGENT_USER'), TO_DATE(NVL(#{REG_DATE}, TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS')), 'YYYYMMDDHH24MISS'), 'N' , #{SHP_PURP_CD}, #{ATCH_FILE_ID1} ) WHEN MATCHED THEN UPDATE SET MTRL_ID = #{MTRL_ID} , MTRL_CL_CD = #{MTRL_CL_CD} , DCU_ID = #{DCU_ID} , MODEM_MAC = #{MODEM_MAC} , METER_ID = #{METER_ID} , WRHSG_SHP_CL_CD = #{WRHSG_SHP_CL_CD} , HNDOVR_BLON_CL_CD = #{HNDOVR_BLON_CL_CD} , TRF_DEPT1 = #{TRF_DEPT1} , TRF_DEPT2 = #{TRF_DEPT2} , TRF_KDN_DEPT1 = #{TRF_KDN_DEPT1} , TRF_KDN_DEPT2 = #{TRF_KDN_DEPT2} , HNDOVR_CO_ID = #{HNDOVR_CO_ID} , HNDOVR_USER_ID = #{HNDOVR_USER_ID} , HNDOVR_STRG_PLCE = #{HNDOVR_STRG_PLCE} , TKOVR_BLON_CL_CD = #{TKOVR_BLON_CL_CD} , TFE_DEPT1 = #{TFE_DEPT1} , TFE_DEPT2 = #{TFE_DEPT2} , TFE_KDN_DEPT1 = #{TFE_KDN_DEPT1} , TFE_KDN_DEPT2 = #{TFE_KDN_DEPT2} , TKOVR_CO_ID = #{TKOVR_CO_ID} , TKOVR_USER_ID = #{TKOVR_USER_ID} , TKOVR_STRG_PLCE = #{TKOVR_STRG_PLCE} , MTRL_STS_CD = #{MTRL_STS_CD} , WRHSG_SHP_YMD = #{WRHSG_SHP_YMD} , MTRL_BX_NO = #{MTRL_BX_NO} , MOD_ID = NVL(#{MOD_ID}, 'DFXAGENT_USER') , MOD_DATE = DECODE(#{MOD_DATE}, NULL, SYSDATE, TO_DATE(#{MOD_DATE}, 'YYYYMMDDHH24MISS')) , SEND_YN = 'N' , SHP_PURP_CD = #{SHP_PURP_CD} , ATCH_FILE_ID1 = #{ATCH_FILE_ID1}
/* 자재관리 자재마스터 송신 */ SELECT MTRL_ID, MTRL_CL_CD, MTRL_UDI, MTRL_IDNT_NO, MTRL_SERNO, FCL_NO, MNFCT_YM, DLVG_PCKN_NO, NOW_PCKN_NO, MTRL_DLVG_NO, MTRL_NO, MTRL_OPE_STS_CL_CD, MTRL_STS_CL_CD, MTRL_STRG_PLCE_NO, MST_CL_CD, MTRL_EXPL, USE_YN, INST_L, INST_M, INST_S, POSS_CLCD , MOD_ID, MOD_DATE, REG_ID, REG_DATE FROM ( SELECT A.MTRL_ID, DECODE(B.AMMS_MTRL_KND_CL_CD, '1', 'T', '2', 'M', '3', 'D', B.AMMS_MTRL_KND_CL_CD) AS MTRL_CL_CD, A.MTRL_UDI, A.MTRL_IDNT_NO, A.MTRL_SERNO, A.FCL_NO, A.MNFCT_YM, A.DLVG_PCKN_NO, A.NOW_PCKN_NO, A.MTRL_DLVG_NO, A.MTRL_NO, A.MTRL_OPE_STS_CL_CD, A.MTRL_STS_CL_CD, A.MTRL_STRG_PLCE_NO, A.MST_CL_CD, A.MTRL_EXPL, A.USE_YN, A.INST_L, A.INST_M, A.INST_S, A.POSS_CLCD , A.MOD_ID, TO_CHAR(A.MOD_DATE, 'YYYYMMDDHH24MISS') AS MOD_DATE, A.REG_ID, TO_CHAR(A.REG_DATE, 'YYYYMMDDHH24MISS') AS REG_DATE , ROW_NUMBER() OVER (ORDER BY A.MTRL_ID) AS R_NUM FROM T_EQUIP_MTRL A JOIN T_MTRL_TP B ON A.MTRL_NO = B.MTRL_NO WHERE 1 = 1 AND A.AWMS_SEND_YN = 'N' ) WHERE 1 = 1 AND R_NUM BETWEEN 1 AND 1000
/* 자재관리 자재마스터 송신 상태 변경 */ UPDATE T_EQUIP_MTRL SET AWMS_SEND_YN = 'Y' , AWMS_SEND_DATE = SYSDATE WHERE 1 = 1 AND MTRL_ID IN ( SELECT MTRL_ID FROM ( SELECT A.MTRL_ID, B.AMMS_MTRL_KND_CL_CD AS MTRL_CL_CD, A.MTRL_UDI, A.MTRL_IDNT_NO, A.MTRL_SERNO, A.FCL_NO, A.MNFCT_YM, A.DLVG_PCKN_NO, A.NOW_PCKN_NO, A.MTRL_DLVG_NO, A.MTRL_NO, A.MTRL_OPE_STS_CL_CD, A.MTRL_STS_CL_CD, A.MTRL_STRG_PLCE_NO, A.MST_CL_CD, A.MTRL_EXPL, A.USE_YN, A.INST_L, A.INST_M, A.INST_S, A.POSS_CLCD , A.MOD_ID, TO_CHAR(A.MOD_DATE, 'YYYYMMDDHH24MISS') AS MOD_DATE, A.REG_ID, TO_CHAR(A.REG_DATE, 'YYYYMMDDHH24MISS') AS REG_DATE , ROW_NUMBER() OVER (ORDER BY A.MTRL_ID) AS R_NUM FROM T_EQUIP_MTRL A JOIN T_MTRL_TP B ON A.MTRL_NO = B.MTRL_NO WHERE 1 = 1 AND A.AWMS_SEND_YN = 'N' ) WHERE 1 = 1 AND R_NUM BETWEEN 1 AND 1000 )
/* 자재관리 자재보관장소 송신 */ SELECT MTRL_STRG_PLCE_NO, MTRL_STRG_PLCE_KND_CL_CD, AMMS_MTRL_STRG_PLCE_REG_CL_CD, MTRL_STRG_PLCE_NM, MTRL_STRG_PLCE_POST_NO, MTRL_STRG_PLCE_ADDR, MTRL_STRG_PLCE_DTLS_ADDR, USE_YN , MOD_ID, MOD_DATE, REG_ID, REG_DATE FROM ( SELECT MTRL_STRG_PLCE_NO, MTRL_STRG_PLCE_KND_CL_CD, AMMS_MTRL_STRG_PLCE_REG_CL_CD, MTRL_STRG_PLCE_NM, MTRL_STRG_PLCE_POST_NO, MTRL_STRG_PLCE_ADDR, MTRL_STRG_PLCE_DTLS_ADDR, USE_YN , MOD_ID, TO_CHAR(MOD_DATE, 'YYYYMMDDHH24MISS') AS MOD_DATE, REG_ID, TO_CHAR(REG_DATE, 'YYYYMMDDHH24MISS') AS REG_DATE , ROW_NUMBER() OVER (ORDER BY MTRL_STRG_PLCE_NO) AS R_NUM FROM T_MNG_PLCE WHERE 1 = 1 AND AWMS_SEND_YN = 'N' ) WHERE 1 = 1 AND R_NUM BETWEEN 1 AND 1000
/* 자재관리 자재보관장소 송신 상태 변경 */ UPDATE T_MNG_PLCE SET AWMS_SEND_YN = 'Y' , AWMS_SEND_DATE = SYSDATE WHERE 1 = 1 AND MTRL_STRG_PLCE_NO IN ( SELECT MTRL_STRG_PLCE_NO FROM ( SELECT MTRL_STRG_PLCE_NO, MTRL_STRG_PLCE_KND_CL_CD, AMMS_MTRL_STRG_PLCE_REG_CL_CD, MTRL_STRG_PLCE_NM, MTRL_STRG_PLCE_POST_NO, MTRL_STRG_PLCE_ADDR, MTRL_STRG_PLCE_DTLS_ADDR, USE_YN , MOD_ID, TO_CHAR(MOD_DATE, 'YYYYMMDDHH24MISS') AS MOD_DATE, REG_ID, TO_CHAR(REG_DATE, 'YYYYMMDDHH24MISS') AS REG_DATE , ROW_NUMBER() OVER (ORDER BY MTRL_STRG_PLCE_NO) AS R_NUM FROM T_MNG_PLCE WHERE 1 = 1 AND AWMS_SEND_YN = 'N' ) WHERE 1 = 1 AND R_NUM BETWEEN 1 AND 1000 )
/* 자재관리 패킹 송신 */ SELECT BONBU_CD, PCKN_NO, QR_CD_CTT, UPPO_PCKN_NO, PCKN_TP_CL_CD, PCKN_LVL, PCKN_EXPL, USE_YN , MOD_ID, MOD_DATE, REG_ID, REG_DATE FROM ( SELECT BONBU_CD, PCKN_NO, QR_CD_CTT, UPPO_PCKN_NO, PCKN_TP_CL_CD, PCKN_LVL, PCKN_EXPL, USE_YN , MOD_ID, TO_CHAR(MOD_DATE, 'YYYYMMDDHH24MISS') AS MOD_DATE, REG_ID, TO_CHAR(REG_DATE, 'YYYYMMDDHH24MISS') AS REG_DATE , ROW_NUMBER() OVER (ORDER BY BONBU_CD, PCKN_NO) AS R_NUM FROM T_PCKN WHERE 1 = 1 AND AWMS_SEND_YN = 'N' ) WHERE 1 = 1 AND R_NUM BETWEEN 1 AND 1000
/* 자재관리 패킹 송신 상태 변경 */ UPDATE T_PCKN SET AWMS_SEND_YN = 'Y' , AWMS_SEND_DATE = SYSDATE WHERE 1 = 1 AND (BONBU_CD, PCKN_NO) IN ( SELECT BONBU_CD, PCKN_NO FROM ( SELECT BONBU_CD, PCKN_NO, QR_CD_CTT, UPPO_PCKN_NO, PCKN_TP_CL_CD, PCKN_LVL, PCKN_EXPL, USE_YN , MOD_ID, TO_CHAR(MOD_DATE, 'YYYYMMDDHH24MISS') AS MOD_DATE, REG_ID, TO_CHAR(REG_DATE, 'YYYYMMDDHH24MISS') AS REG_DATE , ROW_NUMBER() OVER (ORDER BY BONBU_CD, PCKN_NO) AS R_NUM FROM T_PCKN WHERE 1 = 1 AND AWMS_SEND_YN = 'N' ) WHERE 1 = 1 AND R_NUM BETWEEN 1 AND 1000 )
/* 자재관리 자재납품마스터_DCU 수신 */ MERGE INTO T_DLVG_DCU USING DUAL ON (EXL_UPD_GRP_NO = #{EXL_UPD_GRP_NO} AND AMMS_DLVG_HDQR_CL_CD = #{AMMS_DLVG_HDQR_CL_CD} AND MTRL_ID = #{MTRL_ID}) WHEN NOT MATCHED THEN INSERT ( EXL_UPD_GRP_NO, MTRL_ID, BX_NO, CNTR_NO, ORD_NO, MTRL_NO, CNTR_CO_BIZR_REG_NO, AMMS_DLVG_HDQR_CL_CD, ORD_YMD, MDL_NM, LDIN_NW_MODM_TP_CL_CD, MNFCO_CL_CD, MODM_UNITC, WAN_MAC_ADDR, AMI_FRMW_VER_NM, MST_PLC_MODL_VER_NM, MNFCT_YM, DLVG_YMD, SYS_TITL_NM, SRL_NO, PLLT_NO , MOD_ID, MOD_DATE, REG_ID, REG_DATE, SEND_YN ) VALUES ( #{EXL_UPD_GRP_NO}, #{MTRL_ID}, #{BX_NO}, #{CNTR_NO}, #{ORD_NO}, #{MTRL_NO}, #{CNTR_CO_BIZR_REG_NO}, #{AMMS_DLVG_HDQR_CL_CD}, #{ORD_YMD}, #{MDL_NM}, #{LDIN_NW_MODM_TP_CL_CD}, #{MNFCO_CL_CD}, #{MODM_UNITC}, #{WAN_MAC_ADDR}, #{AMI_FRMW_VER_NM}, #{MST_PLC_MODL_VER_NM}, #{MNFCT_YM}, #{DLVG_YMD}, #{SYS_TITL_NM}, #{SRL_NO}, #{PLLT_NO} , NVL(#{MOD_ID}, 'DFXAGENT_USER'), TO_DATE(NVL(#{MOD_DATE}, TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS')), 'YYYYMMDDHH24MISS'), NVL(#{REG_ID}, 'DFXAGENT_USER'), TO_DATE(NVL(#{REG_DATE}, TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS')), 'YYYYMMDDHH24MISS'), 'N' ) WHEN MATCHED THEN UPDATE SET BX_NO = #{BX_NO} , CNTR_NO = #{CNTR_NO} , ORD_NO = #{ORD_NO} , MTRL_NO = #{MTRL_NO} , CNTR_CO_BIZR_REG_NO = #{CNTR_CO_BIZR_REG_NO} , ORD_YMD = #{ORD_YMD} , MDL_NM = #{MDL_NM} , LDIN_NW_MODM_TP_CL_CD = #{LDIN_NW_MODM_TP_CL_CD} , MNFCO_CL_CD = #{MNFCO_CL_CD} , MODM_UNITC = #{MODM_UNITC} , WAN_MAC_ADDR = #{WAN_MAC_ADDR} , AMI_FRMW_VER_NM = #{AMI_FRMW_VER_NM} , MST_PLC_MODL_VER_NM = #{MST_PLC_MODL_VER_NM} , MNFCT_YM = #{MNFCT_YM} , DLVG_YMD = #{DLVG_YMD} , SYS_TITL_NM = #{SYS_TITL_NM} , SRL_NO = #{SRL_NO} , PLLT_NO = #{PLLT_NO} , MOD_ID = NVL(#{MOD_ID}, 'DFXAGENT_USER') , MOD_DATE = DECODE(#{MOD_DATE}, NULL, SYSDATE, TO_DATE(#{MOD_DATE}, 'YYYYMMDDHH24MISS')) , SEND_YN = 'N'
/* 자재관리 자재납품마스터_모뎀 수신 */ MERGE INTO T_DLVG_MODM USING DUAL ON (EXL_UPD_GRP_NO = #{EXL_UPD_GRP_NO} AND AMMS_DLVG_HDQR_CL_CD = #{AMMS_DLVG_HDQR_CL_CD} AND MTRL_ID = #{MTRL_ID}) WHEN NOT MATCHED THEN INSERT ( EXL_UPD_GRP_NO, MTRL_ID, BX_NO, CNTR_NO, ORD_NO, MTRL_NO, CNTR_CO_BIZR_REG_NO, AMMS_DLVG_HDQR_CL_CD, ORD_YMD, MDL_NM, LDIN_NW_MODM_TP_CL_CD, MNFCO_CL_CD, MODM_UNITC, MODM_MAC_ADDR, MCU_FRMW_VER_NM, PLC_CMN_MODL_VER_NM, MNFCT_YM, DLVG_YMD, SYS_TITL_NM, SRL_NO, PLLT_NO , MOD_ID, MOD_DATE, REG_ID, REG_DATE, SEND_YN ) VALUES ( #{EXL_UPD_GRP_NO}, #{MTRL_ID}, #{BX_NO}, #{CNTR_NO}, #{ORD_NO}, #{MTRL_NO}, #{CNTR_CO_BIZR_REG_NO}, #{AMMS_DLVG_HDQR_CL_CD}, #{ORD_YMD}, #{MDL_NM}, #{LDIN_NW_MODM_TP_CL_CD}, #{MNFCO_CL_CD}, #{MODM_UNITC}, #{MODM_MAC_ADDR}, #{MCU_FRMW_VER_NM}, #{PLC_CMN_MODL_VER_NM}, #{MNFCT_YM}, #{DLVG_YMD}, #{SYS_TITL_NM}, #{SRL_NO}, #{PLLT_NO} , NVL(#{MOD_ID}, 'DFXAGENT_USER'), TO_DATE(NVL(#{MOD_DATE}, TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS')), 'YYYYMMDDHH24MISS'), NVL(#{REG_ID}, 'DFXAGENT_USER'), TO_DATE(NVL(#{REG_DATE}, TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS')), 'YYYYMMDDHH24MISS'), 'N' ) WHEN MATCHED THEN UPDATE SET BX_NO = #{BX_NO} , CNTR_NO = #{CNTR_NO} , ORD_NO = #{ORD_NO} , MTRL_NO = #{MTRL_NO} , CNTR_CO_BIZR_REG_NO = #{CNTR_CO_BIZR_REG_NO} , ORD_YMD = #{ORD_YMD} , MDL_NM = #{MDL_NM} , LDIN_NW_MODM_TP_CL_CD = #{LDIN_NW_MODM_TP_CL_CD} , MNFCO_CL_CD = #{MNFCO_CL_CD} , MODM_UNITC = #{MODM_UNITC} , MODM_MAC_ADDR = #{MODM_MAC_ADDR} , MCU_FRMW_VER_NM = #{MCU_FRMW_VER_NM} , PLC_CMN_MODL_VER_NM = #{PLC_CMN_MODL_VER_NM} , MNFCT_YM = #{MNFCT_YM} , DLVG_YMD = #{DLVG_YMD} , SYS_TITL_NM = #{SYS_TITL_NM} , SRL_NO = #{SRL_NO} , PLLT_NO = #{PLLT_NO} , MOD_ID = NVL(#{MOD_ID}, 'DFXAGENT_USER') , MOD_DATE = DECODE(#{MOD_DATE}, NULL, SYSDATE, TO_DATE(#{MOD_DATE}, 'YYYYMMDDHH24MISS')) , SEND_YN = 'N'
/* 자재관리 자재납품마스터_계기 수신 */ MERGE INTO T_DLVG_METR USING DUAL ON (EXL_UPD_GRP_NO = #{EXL_UPD_GRP_NO} AND AMMS_DLVG_HDQR_CL_CD = #{AMMS_DLVG_HDQR_CL_CD} AND MTRL_ID = #{MTRL_ID}) WHEN NOT MATCHED THEN INSERT ( EXL_UPD_GRP_NO, MTRL_ID, AMMS_DLVG_HDQR_CL_CD, ANNC_NO, MNFCO_CL_CD, BX_NO, MTRL_NO, MNFCT_YM, LSEFT_YM, PLLT_NO , MOD_ID, MOD_DATE, REG_ID, REG_DATE, SEND_YN ) VALUES ( #{EXL_UPD_GRP_NO}, #{MTRL_ID}, #{AMMS_DLVG_HDQR_CL_CD}, #{ANNC_NO}, #{MNFCO_CL_CD}, #{BX_NO}, #{MTRL_NO}, #{MNFCT_YM}, #{LSEFT_YM}, #{PLLT_NO} , NVL(#{MOD_ID}, 'DFXAGENT_USER'), TO_DATE(NVL(#{MOD_DATE}, TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS')), 'YYYYMMDDHH24MISS'), NVL(#{REG_ID}, 'DFXAGENT_USER'), TO_DATE(NVL(#{REG_DATE}, TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS')), 'YYYYMMDDHH24MISS'), 'N' ) WHEN MATCHED THEN UPDATE SET ANNC_NO = #{ANNC_NO} , MNFCO_CL_CD = #{MNFCO_CL_CD} , BX_NO = #{BX_NO} , MTRL_NO = #{MTRL_NO} , MNFCT_YM = #{MNFCT_YM} , LSEFT_YM = #{LSEFT_YM} , PLLT_NO = #{PLLT_NO} , MOD_ID = NVL(#{MOD_ID}, 'DFXAGENT_USER') , MOD_DATE = DECODE(#{MOD_DATE}, NULL, SYSDATE, TO_DATE(#{MOD_DATE}, 'YYYYMMDDHH24MISS')) , SEND_YN = 'N'
/* 자재관리 자재납품마스터_LTE모뎀 수신 */ MERGE INTO T_DLVG_LTE_MODM USING DUAL ON (EXL_UPD_GRP_NO = #{EXL_UPD_GRP_NO} AND AMMS_DLVG_HDQR_CL_CD = #{AMMS_DLVG_HDQR_CL_CD} AND MTRL_ID = #{MTRL_ID}) WHEN NOT MATCHED THEN INSERT ( EXL_UPD_GRP_NO, MTRL_ID, BX_NO, CNTR_NO, ORD_NO, LHV_CL_CD, AMMS_CMN_NW_TP_CL_CD, MTRL_NO, CNTR_CO_BIZR_REG_NO, CMCO_CD, AMMS_DLVG_HDQR_CL_CD, ORD_YMD, MDL_NM, MNFCO_CL_CD, CRC_NO, MODM_UNITC, CRC_CHRG, MODM_MAC_ADDR, SMGWC_ID, FRMW_VER_NM, CMN_MODL_VER_NM, MNFCT_YM, DLVG_YMD, SYS_TITL_NM, TEQP_IDNT_NO, USIM_NO, IPV6_ADDR, SRL_NO, PLLT_NO , MOD_ID, MOD_DATE, REG_ID, REG_DATE, SEND_YN ) VALUES ( #{EXL_UPD_GRP_NO}, #{MTRL_ID}, #{BX_NO}, #{CNTR_NO}, #{ORD_NO}, #{LHV_CL_CD}, #{AMMS_CMN_NW_TP_CL_CD}, #{MTRL_NO}, #{CNTR_CO_BIZR_REG_NO}, #{CMCO_CD}, #{AMMS_DLVG_HDQR_CL_CD}, #{ORD_YMD}, #{MDL_NM}, #{MNFCO_CL_CD}, #{CRC_NO}, #{MODM_UNITC}, #{CRC_CHRG}, #{MODM_MAC_ADDR}, #{SMGWC_ID}, #{FRMW_VER_NM}, #{CMN_MODL_VER_NM}, #{MNFCT_YM}, #{DLVG_YMD}, #{SYS_TITL_NM}, #{TEQP_IDNT_NO}, #{USIM_NO}, #{IPV6_ADDR}, #{SRL_NO}, #{PLLT_NO} , NVL(#{MOD_ID}, 'DFXAGENT_USER'), TO_DATE(NVL(#{MOD_DATE}, TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS')), 'YYYYMMDDHH24MISS'), NVL(#{REG_ID}, 'DFXAGENT_USER'), TO_DATE(NVL(#{REG_DATE}, TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS')), 'YYYYMMDDHH24MISS'), 'N' ) WHEN MATCHED THEN UPDATE SET BX_NO = #{BX_NO} , CNTR_NO = #{CNTR_NO} , ORD_NO = #{ORD_NO} , LHV_CL_CD = #{LHV_CL_CD} , AMMS_CMN_NW_TP_CL_CD = #{AMMS_CMN_NW_TP_CL_CD} , MTRL_NO = #{MTRL_NO} , CNTR_CO_BIZR_REG_NO = #{CNTR_CO_BIZR_REG_NO} , CMCO_CD = #{CMCO_CD} , ORD_YMD = #{ORD_YMD} , MDL_NM = #{MDL_NM} , MNFCO_CL_CD = #{MNFCO_CL_CD} , CRC_NO = #{CRC_NO} , MODM_UNITC = #{MODM_UNITC} , CRC_CHRG = #{CRC_CHRG} , MODM_MAC_ADDR = #{MODM_MAC_ADDR} , SMGWC_ID = #{SMGWC_ID} , FRMW_VER_NM = #{FRMW_VER_NM} , CMN_MODL_VER_NM = #{CMN_MODL_VER_NM} , MNFCT_YM = #{MNFCT_YM} , DLVG_YMD = #{DLVG_YMD} , SYS_TITL_NM = #{SYS_TITL_NM} , TEQP_IDNT_NO = #{TEQP_IDNT_NO} , USIM_NO = #{USIM_NO} , IPV6_ADDR = #{IPV6_ADDR} , SRL_NO = #{SRL_NO} , PLLT_NO = #{PLLT_NO} , MOD_ID = NVL(#{MOD_ID}, 'DFXAGENT_USER') , MOD_DATE = DECODE(#{MOD_DATE}, NULL, SYSDATE, TO_DATE(#{MOD_DATE}, 'YYYYMMDDHH24MISS')) , SEND_YN = 'N'
/* 자재관리 자재유형 송신 */ SELECT MTRL_NO, AMMS_MTRL_KND_CL_CD, AMMS_VOLT_CL_CD, AMMS_METR_PH_KND_CL_CD, AMMS_CMN_MHD_CL_CD, AMMS_FCL_TP_CL_CD, AMMS_INS_INFO_CL_CD, AMMS_CMN_NW_TP_CL_CD, TDU_INCLD_YN, MTRL_TP_EXPL, AMMS_MTRL_FORM_CL_CD, APWR_NDL_DIGT_CNT, MAX_DM_NDL_DIGT_CNT, RPWR_NDL_DIGT_CNT , MOD_ID, MOD_DATE, REG_ID, REG_DATE FROM ( SELECT MTRL_NO, AMMS_MTRL_KND_CL_CD, AMMS_VOLT_CL_CD, AMMS_METR_PH_KND_CL_CD, AMMS_CMN_MHD_CL_CD, AMMS_FCL_TP_CL_CD, AMMS_INS_INFO_CL_CD, AMMS_CMN_NW_TP_CL_CD, TDU_INCLD_YN, MTRL_TP_EXPL, AMMS_MTRL_FORM_CL_CD, APWR_NDL_DIGT_CNT, MAX_DM_NDL_DIGT_CNT, RPWR_NDL_DIGT_CNT , MOD_ID, TO_CHAR(MOD_DATE, 'YYYYMMDDHH24MISS') AS MOD_DATE, REG_ID, TO_CHAR(REG_DATE, 'YYYYMMDDHH24MISS') AS REG_DATE , ROW_NUMBER() OVER (ORDER BY MTRL_NO) AS R_NUM FROM T_MTRL_TP WHERE 1 = 1 AND AWMS_SEND_YN = 'N' ) WHERE 1 = 1 AND R_NUM BETWEEN 1 AND 1000
/* 자재관리 자재유형 송신 상태 변경 */ UPDATE T_MTRL_TP SET AWMS_SEND_YN = 'Y' , AWMS_SEND_DATE = SYSDATE WHERE 1 = 1 AND MTRL_NO IN ( SELECT MTRL_NO FROM ( SELECT MTRL_NO, AMMS_MTRL_KND_CL_CD, AMMS_VOLT_CL_CD, AMMS_METR_PH_KND_CL_CD, AMMS_CMN_MHD_CL_CD, AMMS_FCL_TP_CL_CD, AMMS_INS_INFO_CL_CD, AMMS_CMN_NW_TP_CL_CD, TDU_INCLD_YN, MTRL_TP_EXPL, AMMS_MTRL_FORM_CL_CD, APWR_NDL_DIGT_CNT, MAX_DM_NDL_DIGT_CNT, RPWR_NDL_DIGT_CNT , MOD_ID, TO_CHAR(MOD_DATE, 'YYYYMMDDHH24MISS') AS MOD_DATE, REG_ID, TO_CHAR(REG_DATE, 'YYYYMMDDHH24MISS') AS REG_DATE , ROW_NUMBER() OVER (ORDER BY MTRL_NO) AS R_NUM FROM T_MTRL_TP WHERE 1 = 1 AND AWMS_SEND_YN = 'N' ) WHERE 1 = 1 AND R_NUM BETWEEN 1 AND 1000 )
/* 자재관리 AMMS등록업체 - 하도급사 송신 */ SELECT COCMP_BUPE_ID, TRNA, BIZNO, CORP_REGST_NO, RPSNT_NM, TYPBU_NM, TOIN_NM, ZIPCD, SIDO_ADDR, BUPE_ADDR, USE_YN , MOD_ID, MOD_DATE, REG_ID, REG_DATE , DEPT1, DEPT2, KDN_DEPT1, KDN_DEPT2 FROM ( SELECT COCMP_BUPE_ID, TRNA, BIZNO, CORP_REGST_NO, RPSNT_NM, TYPBU_NM, TOIN_NM, ZIPCD, SIDO_ADDR, BUPE_ADDR, USE_YN , MOD_ID, TO_CHAR(MOD_DATE, 'YYYYMMDDHH24MISS') AS MOD_DATE, REG_ID, TO_CHAR(REG_DATE, 'YYYYMMDDHH24MISS') AS REG_DATE , DEPT1, DEPT2, KDN_DEPT1, KDN_DEPT2 , ROW_NUMBER() OVER (ORDER BY COCMP_BUPE_ID) AS R_NUM FROM T_SBCN_CO WHERE 1 = 1 AND AWMS_SEND_YN = 'N' ) WHERE 1 = 1 AND R_NUM BETWEEN 1 AND 1000
/* 자재관리 AMMS등록업체 - 하도급사 송신 상태 변경 */ UPDATE T_SBCN_CO SET AWMS_SEND_YN = 'Y' , AWMS_SEND_DATE = SYSDATE WHERE 1 = 1 AND COCMP_BUPE_ID IN ( SELECT COCMP_BUPE_ID FROM ( SELECT COCMP_BUPE_ID, TRNA, BIZNO, CORP_REGST_NO, RPSNT_NM, TYPBU_NM, TOIN_NM, ZIPCD, SIDO_ADDR, BUPE_ADDR, USE_YN , MOD_ID, TO_CHAR(MOD_DATE, 'YYYYMMDDHH24MISS') AS MOD_DATE, REG_ID, TO_CHAR(REG_DATE, 'YYYYMMDDHH24MISS') AS REG_DATE , DEPT1, DEPT2, KDN_DEPT1, KDN_DEPT2 , ROW_NUMBER() OVER (ORDER BY COCMP_BUPE_ID) AS R_NUM FROM T_SBCN_CO WHERE 1 = 1 AND AWMS_SEND_YN = 'N' ) WHERE 1 = 1 AND R_NUM BETWEEN 1 AND 1000 )
/* 자재관리 AMMS등록업체 - 내선업체 송신 */ SELECT COCMP_BUPE_ID, TRNA, BIZNO, CORP_REGST_NO, RPSNT_NM, TYPBU_NM, TOIN_NM, ZIPCD, SIDO_ADDR, BUPE_ADDR, USE_YN , MOD_ID, MOD_DATE, REG_ID, REG_DATE , DEPT1, DEPT2, KDN_DEPT1, KDN_DEPT2 FROM ( SELECT COCMP_BUPE_ID, TRNA, BIZNO, CORP_REGST_NO, RPSNT_NM, TYPBU_NM, TOIN_NM, ZIPCD, SIDO_ADDR, BUPE_ADDR, USE_YN , MOD_ID, TO_CHAR(MOD_DATE, 'YYYYMMDDHH24MISS') AS MOD_DATE, REG_ID, TO_CHAR(REG_DATE, 'YYYYMMDDHH24MISS') AS REG_DATE , DEPT1, DEPT2, KDN_DEPT1, KDN_DEPT2 , ROW_NUMBER() OVER (ORDER BY COCMP_BUPE_ID) AS R_NUM FROM T_INLN_CO WHERE 1 = 1 AND AWMS_SEND_YN = 'N' ) WHERE 1 = 1 AND R_NUM BETWEEN 1 AND 1000
/* 자재관리 AMMS등록업체 - 내선업체 송신 상태 변경 */ UPDATE T_INLN_CO SET AWMS_SEND_YN = 'Y' , AWMS_SEND_DATE = SYSDATE WHERE 1 = 1 AND COCMP_BUPE_ID IN ( SELECT COCMP_BUPE_ID FROM ( SELECT COCMP_BUPE_ID, TRNA, BIZNO, CORP_REGST_NO, RPSNT_NM, TYPBU_NM, TOIN_NM, ZIPCD, SIDO_ADDR, BUPE_ADDR, USE_YN , MOD_ID, TO_CHAR(MOD_DATE, 'YYYYMMDDHH24MISS') AS MOD_DATE, REG_ID, TO_CHAR(REG_DATE, 'YYYYMMDDHH24MISS') AS REG_DATE , DEPT1, DEPT2, KDN_DEPT1, KDN_DEPT2 , ROW_NUMBER() OVER (ORDER BY COCMP_BUPE_ID) AS R_NUM FROM T_INLN_CO WHERE 1 = 1 AND AWMS_SEND_YN = 'N' ) WHERE 1 = 1 AND R_NUM BETWEEN 1 AND 1000 )