崎頂子母隧道
紀州庵
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | dbm.getPredictedNumber=with predictedNumber as ( \n \ SELECT lpad(to_char(a.ACCOUNT_YR, 'yyyy')-1911, 3, '0') AS ACCOUNT_YR, \n \ a.BUDGET_STATUS AS BUDGET_STATUS, \n \ a.BUDGET_CODE AS BUDGET_CODE, \n \ a.DEBT_CODE AS DEBT_CODE, \n \ a.DATA_TYPE AS DATA_TYPE, \n \ b.DEBT_TYPE AS DEBT_TYPE, \n \ b.BOND_TYPE AS BOND_TYPE, \n \ nvl(b.ALLC_AMOUNT, 0) AS ALLC_AMOUNT \n \ FROM \n \ (SELECT ACCOUNT_YR, \n \ BUDGET_CODE, \n \ DEBT_CODE, \n \ DATA_TYPE, \n \ BUDGET_STATUS, \n \ END_DATE, \n \ MAX(BUDGET_STATUS) OVER (PARTITION BY ACCOUNT_YR, BUDGET_CODE, DEBT_CODE, DATA_TYPE, SUBSTR(BUDGET_STATUS, 0, 1)) AS maxBudgetStatus \n \ FROM DBM091FA \n \ WHERE DATA_TYPE IN ('C', \n \ 'I')) a, \n \ |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | DEBUG c.c.c.persistence.query.SqlExecutor - Executing SQL:with predictedNumber as ( SELECT lpad(to_char(a.ACCOUNT_YR, 'yyyy')-1911, 3, '0') AS ACCOUNT_YR, a.BUDGET_STATUS AS BUDGET_STATUS, a.BUDGET_CODE AS BUDGET_CODE, a.DEBT_CODE AS DEBT_CODE, a.DATA_TYPE AS DATA_TYPE, b.DEBT_TYPE AS DEBT_TYPE, b.BOND_TYPE AS BOND_TYPE, nvl(b.ALLC_AMOUNT, 0) AS ALLC_AMOUNT FROM (SELECT ACCOUNT_YR, BUDGET_CODE, DEBT_CODE, DATA_TYPE, BUDGET_STATUS, END_DATE, MAX(BUDGET_STATUS) OVER (PARTITION BY ACCOUNT_YR, BUDGET_CODE, DEBT_CODE, DATA_TYPE, SUBSTR(BUDGET_STATUS, 0, 1)) AS maxBudgetStatus FROM DBM091FA WHERE DATA_TYPE IN ('C', 'I')) a, |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | SELECT :startYear AS account_yr, budget_status AS budget_status, data_type AS data_type, sum(ALLC_AMOUNT) AS bondARest FROM (SELECT lpad(to_char(a.ACCOUNT_YR, 'yyyy')-1911, 3, '0') AS ACCOUNT_YR, a.BUDGET_STATUS AS BUDGET_STATUS, a.BUDGET_CODE AS BUDGET_CODE, a.DEBT_CODE AS DEBT_CODE, a.DATA_TYPE AS DATA_TYPE, b.DEBT_TYPE AS DEBT_TYPE, b.BOND_TYPE AS BOND_TYPE, nvl(b.ALLC_AMOUNT, 0) AS ALLC_AMOUNT FROM (SELECT ACCOUNT_YR, BUDGET_CODE, DEBT_CODE, DATA_TYPE, BUDGET_STATUS, END_DATE, MAX(BUDGET_STATUS) OVER (PARTITION BY ACCOUNT_YR, BUDGET_CODE, DEBT_CODE, DATA_TYPE, SUBSTR(BUDGET_STATUS, 0, 1)) AS maxBudgetStatus FROM DBM091FA WHERE DATA_TYPE IN ('C', 'I')) a, DBM091FB b WHERE a.ACCOUNT_YR=b.ACCOUNT_YR AND a.BUDGET_CODE=b.BUDGET_CODE AND a.DEBT_CODE=b.DEBT_CODE AND a.DATA_TYPE=b.DATA_TYPE AND a.BUDGET_STATUS=b.BUDGET_STATUS AND a.BUDGET_STATUS=a.maxBudgetStatus ORDER BY a.ACCOUNT_YR, a.BUDGET_STATUS, a.BUDGET_CODE, a.DEBT_CODE) WHERE budget_code=1 AND debt_type=1 AND bond_type=21 AND account_yr BETWEEN '083' AND :startYear GROUP BY budget_status, data_type UNION SELECT account_yr, budget_status, data_type, sum(ALLC_AMOUNT) bondARest FROM (SELECT lpad(to_char(a.ACCOUNT_YR, 'yyyy')-1911, 3, '0') AS ACCOUNT_YR, a.BUDGET_STATUS AS BUDGET_STATUS, a.BUDGET_CODE AS BUDGET_CODE, a.DEBT_CODE AS DEBT_CODE, a.DATA_TYPE AS DATA_TYPE, b.DEBT_TYPE AS DEBT_TYPE, b.BOND_TYPE AS BOND_TYPE, nvl(b.ALLC_AMOUNT, 0) AS ALLC_AMOUNT FROM (SELECT ACCOUNT_YR, BUDGET_CODE, DEBT_CODE, DATA_TYPE, BUDGET_STATUS, END_DATE, MAX(BUDGET_STATUS) OVER (PARTITION BY ACCOUNT_YR, BUDGET_CODE, DEBT_CODE, DATA_TYPE, SUBSTR(BUDGET_STATUS, 0, 1)) AS maxBudgetStatus FROM DBM091FA WHERE DATA_TYPE IN ('C', 'I')) a, DBM091FB b WHERE a.ACCOUNT_YR=b.ACCOUNT_YR AND a.BUDGET_CODE=b.BUDGET_CODE AND a.DEBT_CODE=b.DEBT_CODE AND a.DATA_TYPE=b.DATA_TYPE AND a.BUDGET_STATUS=b.BUDGET_STATUS AND a.BUDGET_STATUS=a.maxBudgetStatus ORDER BY a.ACCOUNT_YR, a.BUDGET_STATUS, a.BUDGET_CODE, a.DEBT_CODE) WHERE budget_code=1 AND debt_type=1 AND bond_type=21 AND account_yr > :startYear GROUP BY account_yr, budget_status, data_type ORDER BY account_yr |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | with predictedNumber as ( SELECT lpad(to_char(a.ACCOUNT_YR, 'yyyy')-1911, 3, '0') AS ACCOUNT_YR, a.BUDGET_STATUS AS BUDGET_STATUS, a.BUDGET_CODE AS BUDGET_CODE, a.DEBT_CODE AS DEBT_CODE, a.DATA_TYPE AS DATA_TYPE, b.DEBT_TYPE AS DEBT_TYPE, b.BOND_TYPE AS BOND_TYPE, nvl(b.ALLC_AMOUNT, 0) AS ALLC_AMOUNT FROM (SELECT ACCOUNT_YR, BUDGET_CODE, DEBT_CODE, DATA_TYPE, BUDGET_STATUS, END_DATE, MAX(BUDGET_STATUS) OVER (PARTITION BY ACCOUNT_YR, BUDGET_CODE, DEBT_CODE, DATA_TYPE, SUBSTR(BUDGET_STATUS, 0, 1)) AS maxBudgetStatus FROM DBM091FA WHERE DATA_TYPE IN ('C', 'I')) a, DBM091FB b WHERE a.ACCOUNT_YR=b.ACCOUNT_YR AND a.BUDGET_CODE=b.BUDGET_CODE AND a.DEBT_CODE=b.DEBT_CODE AND a.DATA_TYPE=b.DATA_TYPE AND a.BUDGET_STATUS=b.BUDGET_STATUS AND a.BUDGET_STATUS=a.maxBudgetStatus ORDER BY a.ACCOUNT_YR, a.BUDGET_STATUS, a.BUDGET_CODE, a.DEBT_CODE ) select :startYear AS account_yr, budget_status AS budget_status, data_type AS data_type, sum(ALLC_AMOUNT) AS bondARest from predictedNumber where budget_code=1 and debt_type=1 and bond_type=21 and account_yr between '083' and :startYear group by budget_status, data_type union select account_yr, budget_status, data_type, sum(ALLC_AMOUNT) bondARest from predictedNumber where budget_code=1 and debt_type=1 and bond_type=21 and account_yr > :startYear group by account_yr, budget_status, data_type order by account_yr |
public static String format(String format, Object... args)
Locale.getDefault()
.format
- A format stringargs
- Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by The Java™ Virtual Machine Specification. The behaviour on a null argument depends on the conversion.IllegalFormatException
- If a format string contains an illegal syntax, a format specifier that is incompatible with the given arguments, insufficient arguments given the format string, or other illegal conditions. For specification of all possible formatting errors, see the Details section of the formatter class specification.NullPointerException
- If the format is nullFormatter
1 2 3 4 5 6 7 8 9 10 | public static void main(String[] args) { // The first Chinese string character should enclose with left and right parenthesis. // The second amount string character has fixed 16 spaces. String strFormat = "(%s)%16s"; System.out.println(String.format(strFormat, "預", "14.13")); System.out.println(String.format(strFormat, "決", "14.34")); System.out.println(String.format(strFormat, "預", "0.00")); System.out.println(String.format(strFormat, "決", "3.25")); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | SELECT TO_CHAR(A.STA_DATE,'YYYYMMDD') AS STA_DATE, A.AGE, A.FUND_ID, A.MGE_TYPE, F_DBM_FIND_LAGE_NM(A.STA_DATE,A.AGE) AGE_NAME, F_DBM_FIND_FUND_NM(A.STA_DATE,A.AGE,A.FUND_ID) FUND_NAME, (A.IN_AMT/A.OUT_AMT) * 100 AS RATE0, (C.IN_AMT/C.OUT_AMT) * 100 AS RATE1, (D.IN_AMT/D.OUT_AMT) * 100 AS RATE2, (E.IN_AMT/E.OUT_AMT) * 100 AS RATE3 FROM DBM034FA A, (SELECT * FROM DBM034FA WHERE TO_CHAR(STA_DATE,'YYYY')=:accountYr +1910) C, (SELECT * FROM DBM034FA WHERE TO_CHAR(STA_DATE,'YYYY')=:accountYr +1909) D, (SELECT * FROM DBM034FA WHERE TO_CHAR(STA_DATE,'YYYY')=:accountYr +1908) E WHERE TO_CHAR(A.STA_DATE,'YYYY')=:accountYr +1911 AND A.AGE = C.AGE(+) AND A.FUND_ID = C.FUND_ID(+) AND A.MGE_TYPE=C.MGE_TYPE(+) AND A.AGE = D.AGE(+) AND A.FUND_ID = D.FUND_ID(+) AND A.MGE_TYPE=D.MGE_TYPE(+) AND A.AGE = E.AGE(+) AND A.FUND_ID = E.FUND_ID(+) AND A.MGE_TYPE=E.MGE_TYPE(+) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | select t.STA_DATE as STA_DATE, t.AGE, t.FUND_ID, t.MGE_TYPE, t.AGE_NAME, t.FUND_NAME, t.RATE0, t.RATE1, t.RATE2, t.RATE3 from ( SELECT CONVERT(VARCHAR(4), A.STA_DATE, 112), A.AGE, A.FUND_ID, A.MGE_TYPE, AP_NTA.F_DBM_FIND_LAGE_NM(A.STA_DATE,A.AGE) AGE_NAME, AP_NTA.F_DBM_FIND_FUND_NM(A.STA_DATE,A.AGE,A.FUND_ID) FUND_NAME, (A.IN_AMT/A.OUT_AMT) * 100 AS RATE0, (C.IN_AMT/C.OUT_AMT) * 100 AS RATE1, (D.IN_AMT/D.OUT_AMT) * 100 AS RATE2, (E.IN_AMT/E.OUT_AMT) * 100 AS RATE3 FROM DBM034FA A LEFT OUTER JOIN (SELECT * FROM DBM034FA WHERE CONVERT(VARCHAR(4), STA_DATE, 112)=:accountYr +1910) C ON A.AGE = C.AGE AND A.FUND_ID = C.FUND_ID AND A.MGE_TYPE=C.MGE_TYPE LEFT OUTER JOIN (SELECT * FROM DBM034FA WHERE CONVERT(VARCHAR(4), STA_DATE, 112)=:accountYr +1909) D ON A.AGE = D.AGE AND A.FUND_ID = D.FUND_ID AND A.MGE_TYPE=D.MGE_TYPE LEFT OUTER JOIN (SELECT * FROM DBM034FA WHERE CONVERT(VARCHAR(4), STA_DATE, 112)=:accountYr +1908) E ON A.AGE = E.AGE AND A.FUND_ID = E.FUND_ID AND A.MGE_TYPE=E.MGE_TYPE ) t where t.STA_DATE=:accountYr +1911 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | <!-- original HTML code snippet (does not bind any event yet) --> <div class="row"> <div class="col-sm-12"> <div class="col-sm-6 "> <label class="control-label label-width-4 text-right">資料類別</label> <input type="radio" value="C" data-ng-model="dbm003eFormBean.dataType">預算數 <input type="radio" value="P" data-ng-model="dbm003eFormBean.dataType">還本數 <input type="radio" value="I" data-ng-model="dbm003eFormBean.dataType">付息數 </div> <div class="col-sm-6 "></div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="col-sm-6 "> <label class="control-label label-width-4 text-right">預算階段</label> <input type="radio" value="P0" data-ng-model="dbm003eFormBean.budgetStatus">{{budgetStatusP0Text}} <input type="radio" value="P1" data-ng-model="dbm003eFormBean.budgetStatus">{{budgetStatusP1Text}} <input type="radio" value="F0" data-ng-model="dbm003eFormBean.budgetStatus">{{budgetStatusF0Text}} <input type="radio" value="F1" data-ng-model="dbm003eFormBean.budgetStatus">{{budgetStatusF1Text}} <input type="radio" value="F2" data-ng-model="dbm003eFormBean.budgetStatus">{{budgetStatusF2Text}} </div> <div class="col-sm-6 "> </div> </div> </div> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <!-- Updated HTML code snippet * bind ng-change event with 資料類別 radio button --> <div class="row"> <div class="col-sm-12"> <div class="col-sm-6 "> <label class="control-label label-width-4 text-right">資料類別</label> <input type="radio" value="C" data-ng-model="dbm003eFormBean.dataType" data-ng-change="changeDataType('C')">預算數 <input type="radio" value="P" data-ng-model="dbm003eFormBean.dataType" data-ng-change="changeDataType('P')">還本數 <input type="radio" value="I" data-ng-model="dbm003eFormBean.dataType" data-ng-change="changeDataType('I')">付息數 </div> <div class="col-sm-6 "></div> </div> </div> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <!-- * bind ng-hide with 預算階段 radio button --> <div class="row"> <div class="col-sm-12"> <div class="col-sm-6 "> <label class="control-label label-width-4 text-right">預算階段</label> <input type="radio" value="P0" data-ng-model="dbm003eFormBean.budgetStatus" data-ng-hide="hideBudgetStatusP0">{{budgetStatusP0Text}} <input type="radio" value="P1" data-ng-model="dbm003eFormBean.budgetStatus" data-ng-hide="hideBudgetStatusP1">{{budgetStatusP1Text}} <input type="radio" value="F0" data-ng-model="dbm003eFormBean.budgetStatus" data-ng-hide="hideBudgetStatusF0">{{budgetStatusF0Text}} <input type="radio" value="F1" data-ng-model="dbm003eFormBean.budgetStatus" data-ng-hide="hideBudgetStatusF1">{{budgetStatusF1Text}} <input type="radio" value="F2" data-ng-model="dbm003eFormBean.budgetStatus" data-ng-hide="hideBudgetStatusF2">{{budgetStatusF2Text}} </div> <div class="col-sm-6 "> </div> </div> </div> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | <!-- JavaScript code snippet --> $scope.changeDataType = function(dataType){ //if 資料類別(dataType) choose '還本數'(P) or 付息數(I) if(dataType =='P' || dataType == 'I'){ //show '預算數' and '決算數' options $scope.hideBudgetStatusP0 = true; $scope.hideBudgetStatusP1 = false; $scope.hideBudgetStatusF0 = false; $scope.hideBudgetStatusF1 = true; $scope.hideBudgetStatusF2 = true; //show 預算數 and 決算數 's radio buttons' text $scope.budgetStatusP0Text = ''; $scope.budgetStatusP1Text = '預算數'; $scope.budgetStatusF0Text = '決算數'; $scope.budgetStatusF1Text = ''; $scope.budgetStatusF2Text = ''; //set default option $scope.dbm003eFormBean.budgetStatus = 'P1'; } //if 資料類別(dataType) choose '預算數'(C) else if(dataType == 'C'){ //show 預算階段 all options $scope.hideBudgetStatusP0 = false; $scope.hideBudgetStatusP1 = false; $scope.hideBudgetStatusF0 = false; $scope.hideBudgetStatusF1 = false; $scope.hideBudgetStatusF2 = false; //show all radio buttons' text $scope.budgetStatusP0Text = '預算案數'; $scope.budgetStatusP1Text = '預算數'; $scope.budgetStatusF0Text = '決算數'; $scope.budgetStatusF1Text = '院編決算數'; $scope.budgetStatusF2Text = '審定決算數'; //set default option $scope.dbm003eFormBean.budgetStatus = 'P0'; } }; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | $scope.dbm003eGrid1 = { data : 'dbm003eGrid1Data', selectedItems: $scope.dbm003eGrid1SelectedRow, columnDefs : [ { field : 'accountYr', displayName : '預算年度', width: 100, cellClass: 'text-left', cellFilter : 'mingGuoYearFilter'}, { field : 'budgetStatus', displayName : '預算階段', width: 100, cellClass: 'text-left'}, { field : 'budgetCode', displayName : 'budgetCode', width: 0, cellClass: 'text-left', visible : false}, { field : 'budgetName', displayName : '預算別', width: 200, cellClass: 'text-left'}, { field : 'debtCode', displayName : 'debtCode', width: 0, cellClass: 'text-left', visible : false}, { field : 'debtName', displayName : '債務別', width: 400, cellClass: 'text-left'}, { field : 'budgetYearPeriod', displayName : '預算年度', width: 100, cellClass: 'text-left'}, { field : 'beginYear', displayName : 'beginYear', width: 0, cellClass: 'text-left', visible : false}, { field : 'endYear', displayName : 'endYear', width: 0, cellClass: 'text-left', visible : false}, { field : 'ttlAmount', displayName : '預算總額', width: 150, cellClass: 'text-right', cellFilter: 'number'}], enableColumnResize :true, plugins : [ new ngGridFlexibleHeightPlugin({ minHeight : 30, maxHeight : 150 }) ], i18n:'zh-tw', multiSelect : false }; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | /* 轉換預算階段 * P0-預算案數 * P1-預算數 * F0-決算數 * F1-院編決算數 * F2-審定決算數 */ formatters.filter('budgetStatusFilter', function(){ return function (budgetStatus){ if(budgetStatus == 'P0'){ return '預算案數'; }else if(budgetStatus == 'P1'){ return '預算數'; }else if(budgetStatus == 'F0'){ return '決算數'; }else if(budgetStatus == 'F1'){ return '院編決算數'; }else if(budgetStatus == 'F2'){ return '審定決算數'; } }; }); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | $scope.dbm003eGrid1 = { data : 'dbm003eGrid1Data', selectedItems: $scope.dbm003eGrid1SelectedRow, columnDefs : [ { field : 'accountYr', displayName : '預算年度', width: 100, cellClass: 'text-left', cellFilter : 'mingGuoYearFilter'}, { field : 'budgetStatus', displayName : '預算階段', width: 100, cellClass: 'text-left', cellFilter : 'budgetStatusFilter'}, { field : 'budgetCode', displayName : 'budgetCode', width: 0, cellClass: 'text-left', visible : false}, { field : 'budgetName', displayName : '預算別', width: 200, cellClass: 'text-left'}, { field : 'debtCode', displayName : 'debtCode', width: 0, cellClass: 'text-left', visible : false}, { field : 'debtName', displayName : '債務別', width: 400, cellClass: 'text-left'}, { field : 'budgetYearPeriod', displayName : '預算年度', width: 100, cellClass: 'text-left'}, { field : 'beginYear', displayName : 'beginYear', width: 0, cellClass: 'text-left', visible : false}, { field : 'endYear', displayName : 'endYear', width: 0, cellClass: 'text-left', visible : false}, { field : 'ttlAmount', displayName : '預算總額', width: 150, cellClass: 'text-right', cellFilter: 'number'}], enableColumnResize :true, plugins : [ new ngGridFlexibleHeightPlugin({ minHeight : 30, maxHeight : 150 }) ], i18n:'zh-tw', multiSelect : false }; |