window.repositoryObject = {"parameters_custom_fields":[],"object_id":"p386","name":"cus_netpathy_mail_point_ins","subtype":"PROCEDURE","is_user_defined":false,"description":null,"summary":[{"field":"Documentation","value":{"_type":"link","name":"style24@172.30.90.100","id":"d10"}},{"field":"Schema","value":""},{"field":"Name","value":"cus_netpathy_mail_point_ins"},{"field":"Type","value":"Procedure"}],"script":"BEGIN\r\n\t/* TsbCustomerDao.truncateNetpathyMailCustomerPoint */\r\n\tTRUNCATE TABLE STYLE24_MAILBATCH.NETPATHY_POINT;\r\n    \r\n    /* TsbCustomerDao.createNetpathyMailCustomerPoint */\r\n\t\tINSERT INTO STYLE24_MAILBATCH.NETPATHY_POINT (\r\n\t\t       CUST_NO\r\n\t\t     , CUST_ID\r\n\t\t     , RM_PNT_AMT\r\n\t\t     , PREV_DT\r\n\t\t)\r\n\t\tSELECT CP.CUST_NO                                                                       /*회원번호*/\r\n\t\t     , C.CUST_ID                                                                        /*회원ID*/\r\n\t\t     , SUM(CASE WHEN CP.EXP_CMP_DT IS NULL THEN CP.RM_PNT_AMT ELSE 0 END) AS RM_PNT_AMT /*남은포인트금액*/\r\n\t\t     , DATE_ADD(CURRENT_DATE(), INTERVAL -1 DAY)                          AS PREV_DT    /*전일*/\r\n\t\tFROM   TB_CUST_POINT CP\r\n\t\t     , TB_CUSTOMER C\r\n\t\tWHERE  CP.CUST_NO = C.CUST_NO\r\n\t\tAND    CP.CUST_NO IN (SELECT CUST_NO\r\n\t\t                      FROM   TB_CUST_POINT\r\n\t\t                      WHERE  UPD_DT >= DATE_ADD(CURRENT_DATE(), INTERVAL -1 DAY)\r\n\t\t                      AND    UPD_DT < CURRENT_DATE()\r\n\t\t                     )\r\n\t\tAND    C.CUST_STAT = 'G104_10' /*활동회원만*/\r\n\t\tGROUP  BY CP.CUST_NO;\r\nEND","parameters":[],"dependencies":null,"imported_at":"2021-11-11 16:37"};