/**
 *
 * @(#)author  [ok]
 * @(#)version 1.0
 * @(#)date    2014. 06. 30
 * @(#)since   JDK 1.7.2
 *
 * Copyright (c) www.udapsoft.co.kr, Inc.
 * All rights reserved.
 * This software is the proprietary information of udapsoft, Inc.
 */
 package kr.co.udapsoft.ebid.buyer.payment.outside.biz;


import kr.co.hsnc.common.base.WAFLogger;
import kr.co.hsnc.common.sql.RowSet;
import kr.co.hsnc.common.sql.RowSetImpl;
import kr.co.hsnc.common.sql.WAFSQLException;
import kr.co.hsnc.common.sql.persistent.Persistent;
import kr.co.hsnc.common.sql.persistent.PersistentImpl;
import kr.co.hsnc.common.sql.search.Search;
import kr.co.hsnc.common.sql.search.SearchImpl;
import kr.co.hsnc.common.util.ValueObject;




import kr.co.udapsoft.ebid.buyer.sycs.user.biz.UserCommon;

import com.udapsoft.modular.web.ibsheet7.IBSheet7Factory;
import com.udapsoft.waf.system.Biz;
import com.udapsoft.waf.system.HandlerStorage;

public class ApplicationRequestListViewBiz extends Biz {
	
	public ApplicationRequestListViewBiz(HandlerStorage storage) {
		super(storage);
	}

	public void doBiz() throws Exception {
		
		if(storage.compareEvent("GET_DATA")){	//데이터 조회
			params.set("sheet1", getPrePaymentList(params));
			storage.addObject("ibsheet7Data", IBSheet7Factory.createIBSheet7(params, storage.request));
		}
	}

    /**
     *@param ValueObject
     *@return RowSet
     *기   능 : 기성신청현황 데이터 조회
     *@author OK
     *@version 2014. 6. 30.
     *@since JDK1.7
     */
    public RowSet getPrePaymentList(ValueObject Params) {
        Search search = new SearchImpl();
        RowSet listRowSet = null;
        String sqlstr = "";
        StringBuffer sql = new StringBuffer();
        
        try {
        	sqlstr += " -- 잔여기성이 있는 경																															\n"
        			+ " SELECT A.*																																	\n"
        			+ " FROM (																																		\n"
        			+ " 	SELECT																																	\n"
        			+ " 	   A1.SUB_CONT_ID																														\n"
        			+ " 	  ,B1.CON_CORP_ID																														\n"
        			+ "		  ,(SELECT MAX(MOD_NO)																										\n"
        			+ "			FROM SUB2000T 																									\n"
        			+ "			WHERE SUB_CONT_ID = A1.SUB_CONT_ID																						\n"
        			+ "			AND CON_CLS_YN = '9') AS MOD_NO  	    																						\n"
        			//+ " 	  ,B1.MOD_NO			max(mod_no)를 가져와야 함																												\n"
        			+ " 	  ,'"+params.get("searchDate").replaceAll("-", "")+"' AS ACMP_YYYYMM																												\n"
        			//+ " 	  ,B1.ACMP_NO+1 AS ACMP_NO -- 지급차수																									\n"
        			+ " 	  ,B1.MAX_ACMP_NO+1 AS ACMP_NO -- 지급차수																								\n"
        			+ " 	  ,TO_CHAR(LAST_DAY(TO_DATE('"+params.get("searchDate").replaceAll("-", "")+"', 'YYYY-MM')), 'YYYY-MM-DD') AS ACMP_DATE															\n"
        			+ " 	  ,TO_CHAR(TO_DATE('"+params.get("searchDate").replaceAll("-", "")+"' || '-01', 'YYYY-MM-DD'), 'YYYY-MM-DD') AS CON_START_DATE													\n"
        			+ " 	  ,TO_CHAR(LAST_DAY(TO_DATE('"+params.get("searchDate").replaceAll("-", "")+"', 'YYYY-MM')), 'YYYY-MM-DD') AS CON_END_DATE														\n"
        			+ " 	  ,TO_CHAR(A1.START_WORK_DATE, 'YYYY-MM-DD') AS START_WORK_DATE																			\n"
        			+ " 	  ,TO_CHAR(A1.END_WORK_DATE, 'YYYY-MM-DD') AS END_WORK_DATE																				\n"
        			+ " 	  ,TO_CHAR(A1.START_WORK_DATE, 'YYYY-MM-DD') || ' ~ ' || TO_CHAR(A1.END_WORK_DATE, 'YYYY-MM-DD') AS START_END_WORK_DATE					\n"
        			+ " 	  ,A1.CON_CUR_CD																														\n"
        			+ " 	  ,A1.CON_AMT																															\n"
        			+ " 	  ,A1.CON_SUPPLY_AMT																													\n"
        			+ " 	  ,A1.CON_SUPPLY_TAMT																													\n"
        			+ " 	  ,A1.CON_SUPPLY_NAMT																													\n"
        			+ " 	  ,A1.CON_SURTAX_AMT																													\n"
        			+ " 	  ,0 AS FUND_AMT -- 금회기성 																												\n"
        			+ " 	  ,0 AS FUND_TAMT --기성금액_과세																											\n"
        			+ " 	  ,0 AS FUND_NAMT --기성금액_면세																											\n"
        			+ " 	  ,0 AS PAY_DEDUCT_AMT --선급금공제금																										\n"
        			+ " 	  ,0 AS PAY_DEDUCT_TAMT    --선급금공제금_과세																								\n"
        			+ " 	  ,0 AS PAY_DEDUCT_NAMT    --선급금공제금_면세																								\n"
        			+ " 	  ,0 AS PAY_DEDUCT_RATE     --선급금공제율																								\n"
        			+ " 	  ,0 AS REQU_AMT                  --청구금액																								\n"
        			+ " 	  ,0 AS REQU_SUPPLY_AMT      --창구_공급가액																								\n"
        			+ " 	  ,0 AS REQU_SUPPLY_TAMT    --청구_공급가액_과세																							\n"
        			+ " 	  ,0 AS REQU_SUPPLY_NAMT    --청구_공급가액_면세																							\n"
        			+ " 	  ,0 AS REQU_SURTAX_AMT     --청구_부가세액																								\n"
        			+ " 	  ,NVL(B1.TOT_FUND_AMT        , 0)                           PRE_FUND_AMT                    --전월기성금액								\n"
        			+ " 	  ,NVL(B1.TOT_FUND_TAMT       , 0)                           PRE_FUND_TAMT                   --전월기성금액_과세							\n"
        			+ " 	  ,NVL(B1.TOT_FUND_NAMT       , 0)                           PRE_FUND_NAMT                   --전월기성금액_면세							\n"
        			+ " 	  ,NVL(B1.TOT_PAY_DEDUCT_AMT  , 0)                           PRE_PAY_DEDUCT_AMT              --전월선급금공제금액							\n"
        			+ " 	  ,NVL(B1.TOT_PAY_DEDUCT_TAMT , 0)                           PRE_PAY_DEDUCT_TAMT             --전월선급금공제금액_과세						\n"
        			+ " 	  ,NVL(B1.TOT_PAY_DEDUCT_NAMT , 0)                           PRE_PAY_DEDUCT_NAMT             --전월선급금공제금액_면세						\n"
        			+ " 	  ,NVL(B1.TOT_PAY_DEDUCT_RATE , 0)                           PRE_PAY_DEDUCT_RATE             --전월선급금공제율							\n"
        			+ " 	  ,NVL(B1.TOT_REQU_AMT        , 0)                           PRE_REQU_AMT                    --전월청구금액								\n"
        			+ " 	  ,NVL(B1.TOT_REQU_SUPPLY_AMT , 0)                           PRE_REQU_SUPPLY_AMT             --전월청구_공급가액							\n"
        			+ " 	  ,NVL(B1.TOT_REQU_SUPPLY_TAMT, 0)                           PRE_REQU_SUPPLY_TAMT            --전월청구_공급가액_과세						\n"
        			+ " 	  ,NVL(B1.TOT_REQU_SUPPLY_NAMT, 0)                           PRE_REQU_SUPPLY_NAMT            --전월청구_공급가액_면세						\n"
        			+ " 	  ,NVL(B1.TOT_REQU_SURTAX_AMT , 0)                           PRE_REQU_SURTAX_AMT             --전월청구_부가세액							\n"
        			+ " 	  ,A1.PROOF_CD                                               PROOF_CD                        --증빙구분									\n"
        			+ " 	  ,'01'                                                      STATUS_CD                       --기성진행상태								\n"
        			+ " 	  ,F_GET_R_DEPT_CD(B1.DEPT_CD )                                                 DEPT_CD                         --현장코드									\n"
        			+ " 	  ,A1.CON_SUPPLY_AMT - NVL(B1.TOT_FUND_AMT, 0) MOD_FUND_AMT -- 잔여기성																	\n"
        			+ " 	  ,NVL(B1.TOT_FUND_AMT        , 0) AS TOT_FUND_AMT         --전체기성금액																	\n"
        			+ " 	  ,NVL(B1.TOT_FUND_TAMT       , 0)                           TOT_FUND_TAMT                   --전체기성금액_과세							\n"
        			+ " 	  ,NVL(B1.TOT_FUND_NAMT       , 0)                           TOT_FUND_NAMT                   --전체기성금액_면세							\n"
        			+ " 	  ,NVL(B1.TOT_PAY_DEDUCT_AMT  , 0)                           TOT_PAY_DEDUCT_AMT              --전체선급금공제금액							\n"
        			+ " 	  ,NVL(B1.TOT_PAY_DEDUCT_TAMT , 0)                           TOT_PAY_DEDUCT_TAMT             --전체선급금공제금액_과세						\n"
        			+ " 	  ,NVL(B1.TOT_PAY_DEDUCT_NAMT , 0)                           TOT_PAY_DEDUCT_NAMT             --전체선급금공제금액_면세						\n"
        			+ " 	  ,NVL(B1.TOT_PAY_DEDUCT_RATE , 0)                           TOT_PAY_DEDUCT_RATE             --전체선급금공제율							\n"
        			+ " 	  ,NVL(B1.TOT_REQU_AMT        , 0)                           TOT_REQU_AMT                    --전체청구금액								\n"
        			+ " 	  ,NVL(B1.TOT_REQU_SUPPLY_AMT , 0)                           TOT_REQU_SUPPLY_AMT             --전체청구_공급가액							\n"
        			+ " 	  ,NVL(B1.TOT_REQU_SUPPLY_TAMT, 0)                           TOT_REQU_SUPPLY_TAMT            --전체청구_공급가액_과세						\n"
        			+ " 	  ,NVL(B1.TOT_REQU_SUPPLY_NAMT, 0)                           TOT_REQU_SUPPLY_NAMT            --전체청구_공급가액_면세						\n"
        			+ " 	  ,NVL(B1.TOT_REQU_SURTAX_AMT , 0)                           TOT_REQU_SURTAX_AMT             --전체청구_부가세액							\n"
        			+ " 	  ,A1.BUILD_NAME																														\n"
        			+ " 	  ,B1.TAX_CHARG_NM																														\n"
        			+ " 	  ,B1.TAX_CHARG_HP																														\n"
        			+ " 	  ,B1.TAX_CHARG_EMAIL																													\n"
        			+ "	  	  ,G.STATUS_CD       P_STATUS_CD    --                                                                                          \n" //2015.11.10
                	+ "		  ,F_GET_CODE_NAME('PREPAY_STATUS_CD', G.STATUS_CD    )  STATUS_NM                                                          \n" //2015.11.10
                	+ " 	  ,A1.DEPT_NAME																															\n"
                	+ " 	  ,NVL(A1.SUPP_DIRECT_YN,'N') AS SUPP_DIRECT_YN																							\n"	//2021.04.12
                	+ " 	  ,NVL(A1.LABOR_USE_YN,'N') AS LABOR_USE_YN																								\n"	//2022.03.21
                	+ " 	  ,(SELECT COUNT(*) FROM SUB1040T WHERE SUB_CONT_ID = A1.SUB_CONT_ID AND ACMP_YYYYMM = '"+params.get("searchDate").replaceAll("-", "")+"') cnt									\n"	//2023.05.09
        			+ " FROM SUB1000T A1																															\n"
        			+ " 	  ,(SELECT A.*, B.MAX_ACMP_NO, B.MAX_SUB_CONT_ID   FROM sub1040t A  ,  (SELECT SUB_CONT_ID AS MAX_SUB_CONT_ID, MAX(ACMP_YYYYMM) ACMP_YYYYMM, MAX(ACMP_NO) MAX_ACMP_NO FROM sub1040t GROUP BY SUB_CONT_ID) B	\n"
        			+ " 		WHERE A.SUB_CONT_ID = B.MAX_SUB_CONT_ID																											\n"
        			+ " 		AND A.ACMP_NO = B.MAX_ACMP_NO																										\n"
        			//2016.12.26 반려,작성중 상태일때만 기성생성 제한-->해제 
        			+ " 		AND A.STATUS_CD = '10' 																									\n";
        			//2023.05.09 관리자 권한인 경우 중복기성신청 가능 
        			if(storage.getUser().get("ACCT_TYPE_CODE").equals("ADMIN")){
        				sqlstr += " 		AND B.ACMP_YYYYMM <= '"+params.get("searchDate").replaceAll("-", "")+"') B1																									\n";
        			}else{
        				sqlstr += " 		AND B.ACMP_YYYYMM < '"+params.get("searchDate").replaceAll("-", "")+"') B1																									\n";
        			}
        			sqlstr +=  " 	  ,(SELECT DEPT_CD, MAX(YYYYMM) YYYYMM FROM ETEC_ERPIF.COM900V WHERE FLAG01 = '0' AND FLAG04 = '0' AND YYYYMM = '"+params.get("searchDate").replaceAll("-", "")+"' GROUP BY DEPT_CD) C1	\n"
        			+ " 	  ,SUB1020T X		\n"
        			+ "		  ,(SELECT SUB_CONT_ID, RANK() OVER(PARTITION BY SUB_CONT_ID ORDER BY SUB_CONT_MOD_ID DESC ) RNK, STATUS_CD FROM SUB1030T ) G  --2015.11.10선급처리여부 확인                     														            \n"
                	+ " WHERE A1.SUB_CONT_ID = B1.MAX_SUB_CONT_ID																										\n"
        			+ " AND  F_GET_R_DEPT_CD(B1.DEPT_CD) = C1.DEPT_CD																													\n"
        			+ " AND A1.CON_CLS_YN = '9'																														\n"
        			+ " AND X.CON_CORP_ID  = B1.CON_CORP_ID																														\n"
        			+ " AND NVL(B1.TOT_FUND_AMT, 0) <  A1.CON_AMT																									\n"
        			+"	AND A1.SUB_CONT_ID = G.SUB_CONT_ID(+) AND G.RNK(+) = 1				--2015.11.17																		\n"
                	+ " AND C1.DEPT_CD  = '"+params.get("dept_cd")+"'																									\n"
        			+ " UNION ALL       -- 기성을 한번도 실행하지 않은 경우																								\n"
        			+ " SELECT A1.SUB_CONT_ID																														\n"
        			+ " 	  ,(SELECT CON_CORP_ID FROM SUB1020T WHERE SUB_CONT_ID = A1.SUB_CONT_ID AND CORP_ID = C1.CORP_ID)  CON_CORP_ID													\n"
        			+ "		  ,(SELECT MAX(MOD_NO)																										\n"
        			+ "			FROM SUB2000T 																									\n"
        			+ "			WHERE SUB_CONT_ID = A1.SUB_CONT_ID																						\n"
        			+ "			AND CON_CLS_YN = '9')  	AS MOD_NO    																						\n"
        			+ " 	  ,'"+params.get("searchDate").replaceAll("-", "")+"' AS ACMP_YYYYMM																												\n"
        			+ " 	  ,1 AS ACMP_NO	-- 지급차수																												\n"
        			+ " 	  ,TO_CHAR(LAST_DAY(TO_DATE('"+params.get("searchDate").replaceAll("-", "")+"', 'YYYY-MM')), 'YYYY-MM-DD') AS ACMP_DATE															\n"
        			+ " 	  ,TO_CHAR(TO_DATE('"+params.get("searchDate").replaceAll("-", "")+"' || '-01', 'YYYY-MM-DD'), 'YYYY-MM-DD') AS CON_START_DATE													\n"
        			+ " 	  ,TO_CHAR(LAST_DAY(TO_DATE('"+params.get("searchDate").replaceAll("-", "")+"', 'YYYY-MM')), 'YYYY-MM-DD') AS CON_END_DATE														\n"
        			+ " 	  ,TO_CHAR(A1.START_WORK_DATE, 'YYYY-MM-DD') AS START_WORK_DATE																			\n"
        			+ " 	  ,TO_CHAR(A1.END_WORK_DATE, 'YYYY-MM-DD') AS END_WORK_DATE																				\n"
        			+ " 	  ,TO_CHAR(A1.START_WORK_DATE, 'YYYY-MM-DD') || ' ~ ' || TO_CHAR(A1.END_WORK_DATE, 'YYYY-MM-DD') AS START_END_WORK_DATE					\n"        			
        			+ " 	  ,A1.CON_CUR_CD																														\n"
        			+ " 	  ,A1.CON_AMT																															\n"
        			+ " 	  ,A1.CON_SUPPLY_AMT																													\n"
        			+ " 	  ,A1.CON_SUPPLY_TAMT																													\n"
        			+ " 	  ,A1.CON_SUPPLY_NAMT																													\n"
        			+ " 	  ,A1.CON_SURTAX_AMT																													\n"
        			+ " 	  ,0 AS FUND_AMT -- 금회기성																												\n"
        			+ " 	  ,0 AS FUND_TAMT --기성금액_과세																											\n"
        			+ " 	  ,0 AS FUND_NAMT --기성금액_면세																											\n"
        			+ " 	  ,0 AS PAY_DEDUCT_AMT --선급금공제금																										\n"
        			+ " 	  ,0 AS PAY_DEDUCT_TAMT    --선급금공제금_과세																								\n"
        			+ " 	  ,0 AS PAY_DEDUCT_NAMT    --선급금공제금_면세																								\n"
        			+ " 	  ,0 AS PAY_DEDUCT_RATE     --선급금공제율																								\n"
        			+ " 	  ,0 AS REQU_AMT                  --청구금액																								\n"
        			+ " 	  ,0 AS REQU_SUPPLY_AMT      --창구_공급가액																								\n"
        			+ " 	  ,0 AS REQU_SUPPLY_TAMT    --청구_공급가액_과세																							\n"
        			+ " 	  ,0 AS REQU_SUPPLY_NAMT    --청구_공급가액_면세																							\n"
        			+ " 	  ,0 AS REQU_SURTAX_AMT     --청구_부가세액																								\n"
        			+ " 	  ,0                           PRE_FUND_AMT                    --전월기성금액																\n"
        			+ " 	  ,0                           PRE_FUND_TAMT                   --전월기성금액_과세															\n"
        			+ " 	  ,0                           PRE_FUND_NAMT                   --전월기성금액_면세															\n"
        			+ " 	  ,0                           PRE_PAY_DEDUCT_AMT              --전월선급금공제금액														\n"
        			+ " 	  ,0                           PRE_PAY_DEDUCT_TAMT             --전월선급금공제금액_과세													\n"
        			+ " 	  ,0                           PRE_PAY_DEDUCT_NAMT             --전월선급금공제금액_면세													\n"
        			+ " 	  ,0                           PRE_PAY_DEDUCT_RATE             --전월선급금공제율															\n"
        			+ " 	  ,0                           PRE_REQU_AMT                    --전월청구금액																\n"
        			+ " 	  ,0                           PRE_REQU_SUPPLY_AMT             --전월청구_공급가액															\n"
        			+ " 	  ,0                           PRE_REQU_SUPPLY_TAMT            --전월청구_공급가액_과세													\n"
        			+ " 	  ,0                           PRE_REQU_SUPPLY_NAMT            --전월청구_공급가액_면세													\n"
        			+ " 	  ,0                           PRE_REQU_SURTAX_AMT             --전월청구_부가세액															\n"
        			+ " 	  ,A1.PROOF_CD                                               PROOF_CD                        --증빙구분									\n"
        			+ " 	  ,'01'                                                      STATUS_CD                       --기성진행상태								\n"
        			+ " 	  ,F_GET_R_DEPT_CD(A1.DEPT_CD )                                               DEPT_CD                         --현장코드									\n"
        			+ " 	  ,A1.CON_AMT AS  MOD_FUND_AMT -- 잔여기성																								\n"
        			+ " 	  ,0 AS TOT_FUND_AMT         --전체기성금액																								\n"
        			+ " 	  ,0                           TOT_FUND_TAMT                   --전체기성금액_과세															\n"
        			+ " 	  ,0                           TOT_FUND_NAMT                   --전체기성금액_면세															\n"
        			+ " 	  ,0                           TOT_PAY_DEDUCT_AMT              --전체선급금공제금액														\n"
        			+ " 	  ,0                           TOT_PAY_DEDUCT_TAMT             --전체선급금공제금액_과세													\n"
        			+ " 	  ,0                           TOT_PAY_DEDUCT_NAMT             --전체선급금공제금액_면세													\n"
        			+ " 	  ,0                           TOT_PAY_DEDUCT_RATE             --전체선급금공제율															\n"
        			+ " 	  ,0                           TOT_REQU_AMT                    --전체청구금액																\n"
        			+ " 	  ,0                           TOT_REQU_SUPPLY_AMT             --전체청구_공급가액															\n"
        			+ " 	  ,0                           TOT_REQU_SUPPLY_TAMT            --전체청구_공급가액_과세													\n"
        			+ " 	  ,0                           TOT_REQU_SUPPLY_NAMT            --전체청구_공급가액_면세													\n"
        			+ " 	  ,0                           TOT_REQU_SURTAX_AMT             --전체청구_부가세액															\n"
        			+ " 	  ,A1.BUILD_NAME																														\n"
        			+ " 	  ,C1.USER_NAME as TAX_CHARG_NM																											\n"
        			+ " 	  ,C1.HP as TAX_CHARG_HP																												\n"
        			+ " 	  ,C1.EMAIL as TAX_CHARG_EMAIL																											\n"
        			+ "	  	  ,G.STATUS_CD      P_STATUS_CD                                                                                            \n" //2015.11.10
                	+ "		  ,F_GET_CODE_NAME('PREPAY_STATUS_CD', G.STATUS_CD  )  STATUS_NM                                                          \n" //2015.11.10
                	+ " 	  ,A1.DEPT_NAME																															\n"
                	+ " 	  ,A1.SUPP_DIRECT_YN																													\n"	//2021.04.12
                	+ " 	  ,A1.LABOR_USE_YN																														\n"	//2022.03.21
                	+ " 	  ,(SELECT COUNT(*) FROM SUB1040T WHERE SUB_CONT_ID = A1.SUB_CONT_ID AND ACMP_YYYYMM = '"+params.get("searchDate").replaceAll("-", "")+"') cnt									\n"	//2023.05.09                	
        			+ " FROM (SELECT A.*																															\n"
        			+ " 		FROM (SELECT A.*, B.MOD_NO, B.SUB_CONT_MOD_ID																						\n"
        			+ " 				FROM SUB1000T A, 																											\n"
        			+ " 				(SELECT SUB_CONT_ID, MAX(SUB_CONT_MOD_ID) AS SUB_CONT_MOD_ID, MAX(MOD_NO) AS MOD_NO											\n"
        			+ " 				FROM SUB2000T																												\n"
        			+ " 				WHERE CON_CLS_YN = '9'																										\n"
        			+ " 				GROUP BY SUB_CONT_ID																										\n"
        			+ " 			  	) B																															\n"
        			+ " 		WHERE A.SUB_CONT_ID =  B.SUB_CONT_ID) A LEFT OUTER JOIN (SELECT SUB_CONT_ID FROM sub1040t GROUP BY SUB_CONT_ID) B					\n"
        			+ " 	ON A.SUB_CONT_ID =  B.SUB_CONT_ID																										\n"
        			+ " 	WHERE 1=1																												\n"
        			+ " 	AND B.SUB_CONT_ID IS NULL																												\n"
        			+ " 	AND A.CON_CLS_YN = '9') A1 -- 기성을 한번도 실행하지 않은 계약 쿼리																			\n"
        			+ " ,(SELECT DEPT_CD, MAX(YYYYMM) YYYYMM FROM ETEC_ERPIF.COM900V  WHERE FLAG01 = '0' AND FLAG04 = '0' AND YYYYMM = '"+params.get("searchDate").replaceAll("-", "")+"' GROUP BY DEPT_CD) B1		\n"
        			+ " ,SUB1020T X																																	\n"
        			+ " ,CONT_OUT_SUPP C1																																	\n"
        			+ " , (SELECT SUB_CONT_ID, RANK() OVER(PARTITION BY SUB_CONT_ID ORDER BY SUB_CONT_MOD_ID DESC ) RNK, STATUS_CD FROM SUB1030T) G  --2015.11.10선급처리여부 확인                     														            \n"
                	+ " WHERE  F_GET_R_DEPT_CD(A1.DEPT_CD) = B1.DEPT_CD																												\n"
        			+ " AND X.SUB_CONT_ID  = A1.SUB_CONT_ID																											\n"
        			+ " AND X.CORP_ID = C1.CORP_ID																											\n"
        			+ " AND B1.DEPT_CD  = '"+params.get("dept_cd")+"'																								\n"
        			+ " AND A1.SUB_CONT_MOD_ID = C1.SUB_CONT_MOD_ID																								\n"
        			+"	AND A1.SUB_CONT_ID = G.SUB_CONT_ID(+) 	AND G.RNK(+) = 1			--2015.11.17																		\n"
                	+ " AND C1.sign_seq = '2'																								\n"
        			+ " ) A																																			\n"
        			+ " WHERE 1=1																																	\n";
        	
            search.setStatement(sqlstr);
            System.out.println(sqlstr);
            listRowSet = search.execute();
           
        }
        catch(Exception e) {
            WAFLogger.error(this.getClass().getName() + " --> getPrePaymentList() : " + e.getMessage());
            WAFLogger.error("SQL : " + search.getStatement());
            WAFLogger.error(e);
            return null;
        }
        finally {

            if( listRowSet == null ) listRowSet = new RowSetImpl();
            return listRowSet;
        }
    }
}
