/*
 * MosP - Mind Open Source Project         http://www.mosp.jp/
 * Copyright (C) 1987-2009 MIND Co., Ltd.  http://www.e-mind.co.jp/
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
package jp.mosp.payroll.bonus.dao;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import jp.mosp.payroll.bonus.BonusConst;

import jp.mosp.payroll.base.PayrollDao;
import jp.mosp.payroll.bonus.dto.PdPaymentDto;
import jp.mosp.common.common.MospException;

public class PdPaymentDao extends PayrollDao {
	
	// テーブル名及びキー列名
	public static final String TABLE = "UD_PAYMENT";
	public static final String KEY_1 = "K_CODE"   ;	// 社員コード
	public static final String KEY_2 = "CALC_DATE";	// 計算年月
	
	// 列名
	public static final String COL_K_CODE               = "K_CODE"              ;	// 社員コード
	public static final String COL_CALC_DATE            = "CALC_DATE"           ;	// 計算年月
	public static final String COL_PAYDAY               = "PAYDAY"              ;	// 給与支給日
	public static final String COL_CALC_STATUS          = "CALC_STATUS"         ;	// 計算ステータス
	public static final String COL_K_NAME               = "K_NAME"              ;	// 社員氏名
	public static final String COL_STATION_CODE         = "STATION_CODE"        ;	// 所属コード
	public static final String COL_POSITION_CODE        = "POSITION_CODE"       ;	// 職位コード
	public static final String COL_EMPLOYMENT_TYPE      = "EMPLOYMENT_TYPE"     ;	// 雇用区分
	public static final String COL_PRESENCE             = "PRESENCE"            ;	// 出勤日数
	public static final String COL_WORK_ON_HOLIDAY      = "WORK_ON_HOLIDAY"     ;	// 休日出勤日数
	public static final String COL_PARTICULAR_HOLIDAY   = "PARTICULAR_HOLIDAY"  ;	// 特別休暇日数
	public static final String COL_PAID_HOLIDAY         = "PAID_HOLIDAY"        ;	// 有給休暇日数
	public static final String COL_ABSENCE              = "ABSENCE"             ;	// 欠勤日数
	public static final String COL_PAID_HOLIDAY_REST    = "PAID_HOLIDAY_REST"   ;	// 有給残
	public static final String COL_PAYMENT_HOURS        = "PAYMENT_HOURS"       ;	// 時給時間
	public static final String COL_ARRIVE_LATE          = "ARRIVE_LATE"         ;	// 遅刻回数
	public static final String COL_EFFORT_TIME          = "EFFORT_TIME"         ;	// 成果、残業時間
	public static final String COL_EFFORT_ALLOWANCE     = "EFFORT_ALLOWANCE"    ;	// 成果、残業手当
	public static final String COL_LATE_NIGHT           = "LATE_NIGHT"          ;	// 深夜時間
	public static final String COL_LATE_NIGHT_ALLOWANCE = "LATE_NIGHT_ALLOWANCE";	// 深夜手当
	public static final String COL_OVER_LATE            = "OVER_LATE"           ;	// 深夜残業時間
	public static final String COL_OVER_LATE_ALLOWANCE  = "OVER_LATE_ALLOWANCE" ;	// 深夜残業手当
	public static final String COL_HOLIDAY_TIME         = "HOLIDAY_TIME"        ;	// 休日時間
	public static final String COL_HOLIDAY_ALLOWANCE    = "HOLIDAY_ALLOWANCE"   ;	// 休日手当
	public static final String COL_ATTENDANCE_13        = "ATTENDANCE_13"       ;	// 勤怠項目13
	public static final String COL_ATTENDANCE_14        = "ATTENDANCE_14"       ;	// 勤怠項目14
	public static final String COL_INSTITUTIONAL_ABS    = "INSTITUTIONAL_ABS"   ;	// 制度欠勤日数
	public static final String COL_OTHER_ATTENDANCE     = "OTHER_ATTENDANCE"    ;	// その他勤怠日数
	public static final String COL_BASIC_SALARY         = "BASIC_SALARY"        ;	// 基本給
	public static final String COL_ABILITY1_ALLOWANCE   = "ABILITY1_ALLOWANCE"  ;	// 職能手当1
	public static final String COL_ABILITY2_ALLOWANCE   = "ABILITY2_ALLOWANCE"  ;	// 職能手当2
	public static final String COL_FAMILY_ALLOWANCE     = "FAMILY_ALLOWANCE"    ;	// 扶養手当
	public static final String COL_ALLOWANCE_05         = "ALLOWANCE_05"        ;	// 支給項目05
	public static final String COL_ALLOWANCE_06         = "ALLOWANCE_06"        ;	// 支給項目06
	public static final String COL_CUT_FOR_MISSING      = "CUT_FOR_MISSING"     ;	// 皆勤減額
	public static final String COL_CUT_FOR_SHORT        = "CUT_FOR_SHORT"       ;	// 役職減額経験
	public static final String COL_ALLOWANCE_09         = "ALLOWANCE_09"        ;	// 支給項目09
	public static final String COL_ALLOWANCE_10         = "ALLOWANCE_10"        ;	// 支給項目10
	public static final String COL_ALLOWANCE_11         = "ALLOWANCE_11"        ;	// 支給項目11
	public static final String COL_ALLOWANCE_12         = "ALLOWANCE_12"        ;	// 支給項目12
	public static final String COL_ALLOWANCE_13         = "ALLOWANCE_13"        ;	// 支給項目13
	public static final String COL_DATE_ALLOWANCE       = "DATE_ALLOWANCE"      ;	// 日付手当
	public static final String COL_ALLOWANCE_15         = "ALLOWANCE_15"        ;	// 支給項目15
	public static final String COL_ALLOWANCE_16         = "ALLOWANCE_16"        ;	// 支給項目16
	public static final String COL_ALLOWANCE_17         = "ALLOWANCE_17"        ;	// 支給項目17
	public static final String COL_COMMUTATION          = "COMMUTATION"         ;	// 通勤費
	public static final String COL_COMMUTATION_TAX      = "COMMUTATION_TAX"     ;	// 課税通勤費
	public static final String COL_OVERTIME_ALLOWANCE   = "OVERTIME_ALLOWANCE"  ;	// 成・深・休
	public static final String COL_CUT_FROM_BASIC       = "CUT_FROM_BASIC"      ;	// 減額金
	public static final String COL_HEALTH_INSURANCE     = "HEALTH_INSURANCE"    ;	// 健康保険料
	public static final String COL_PENSION_INSURANCE    = "PENSION_INSURANCE"   ;	// 厚生年金保険
	public static final String COL_PENSION_FUND         = "PENSION_FUND"        ;	// 厚生年金基金
	public static final String COL_EMPLOYEE_INSURANCE   = "EMPLOYEE_INSURANCE"  ;	// 雇用保険料
	public static final String COL_INCOME_TAX           = "INCOME_TAX"          ;	// 所得税
	public static final String COL_RESIDENCE_TAX        = "RESIDENCE_TAX"       ;	// 住民税
	public static final String COL_NURSING_INSURANCE    = "NURSING_INSURANCE"   ;	// 介護保険料
	public static final String COL_DEDUCTION_08         = "DEDUCTION_08"        ;	// 控除項目08
	public static final String COL_DEDUCTION_09         = "DEDUCTION_09"        ;	// 控除項目09
	public static final String COL_DEDUCTION_10         = "DEDUCTION_10"        ;	// 控除項目10
	public static final String COL_DEDUCTION_11         = "DEDUCTION_11"        ;	// 控除項目11
	public static final String COL_DEDUCTION_12         = "DEDUCTION_12"        ;	// 控除項目12
	public static final String COL_DEDUCTION_13         = "DEDUCTION_13"        ;	// 控除項目13
	public static final String COL_DEDUCTION_14         = "DEDUCTION_14"        ;	// 控除項目14
	public static final String COL_DEDUCTION_15         = "DEDUCTION_15"        ;	// 控除項目15
	public static final String COL_DEDUCTION_16         = "DEDUCTION_16"        ;	// 控除項目16
	public static final String COL_DEDUCTION_17         = "DEDUCTION_17"        ;	// 控除項目17
	public static final String COL_DEDUCTION_18         = "DEDUCTION_18"        ;	// 控除項目18
	public static final String COL_DEDUCTION_19         = "DEDUCTION_19"        ;	// 控除項目19
	public static final String COL_DEDUCTION_20         = "DEDUCTION_20"        ;	// 控除項目20
	public static final String COL_ALLOWANCE_TOTAL      = "ALLOWANCE_TOTAL"     ;	// 総支給金額
	public static final String COL_DEDUCTION_TOTAL      = "DEDUCTION_TOTAL"     ;	// 総控除金額
	public static final String COL_PAYMENT_TOTAL        = "PAYMENT_TOTAL"       ;	// 差引支給額
	public static final String COL_BANK1_PAY_AMOUNT     = "BANK1_PAY_AMOUNT"    ;	// 銀行1振込額
	public static final String COL_BANK2_PAY_AMOUNT     = "BANK2_PAY_AMOUNT"    ;	// 銀行2振込額
	public static final String COL_CASH_PAY_AMOUNT      = "CASH_PAY_AMOUNT"     ;	// 現金支給額
	public static final String COL_DEPENDENT_COUNT      = "DEPENDENT_COUNT"     ;	// 扶養等の数
	public static final String COL_AMOUNT_TO_TAXATION   = "AMOUNT_TO_TAXATION"  ;	// 課税対象額
	public static final String COL_AMOUNT_TO_SOC_INS    = "AMOUNT_TO_SOC_INS"   ;	// 社会保険対象額


	
	/**
	 * コンストラクタ
	 */
	public PdPaymentDao() {
		super();
	}
	
	/**
	 * 検索結果取得(DTOのList)
	 * @return List 検索リスト
	 * @throws SQLException
	 */
	private List<PdPaymentDto> mappingAll() throws SQLException {
		List<PdPaymentDto> all = new ArrayList<PdPaymentDto>();
		while (rs.next()) {
			all.add(mapping());
		}
		return all;
	}
	
	/**
	 * 検索結果取得(DTO)
	 * @return PdPaymentDto UD_PAYMENTレコード
	 * @throws SQLException
	 */
	private PdPaymentDto mapping() throws SQLException {
		PdPaymentDto dto = new PdPaymentDto();
		dto.setKCode             (rs.getString(COL_K_CODE              ));	// 社員コード
		dto.setCalcDate          (rs.getDate  (COL_CALC_DATE           ));	// 計算年月
		dto.setPayday            (rs.getDate  (COL_PAYDAY              ));	// 給与支給日
		dto.setCalcStatus        (rs.getString(COL_CALC_STATUS         ));	// 計算ステータス
		dto.setKName             (rs.getString(COL_K_NAME              ));	// 社員氏名
		dto.setStationCode       (rs.getString(COL_STATION_CODE        ));	// 所属コード
		dto.setPositionCode      (rs.getString(COL_POSITION_CODE       ));	// 職位コード
		dto.setEmploymentType    (rs.getString(COL_EMPLOYMENT_TYPE     ));	// 雇用区分
		dto.setPresence          (rs.getInt   (COL_PRESENCE            ));	// 出勤日数
		dto.setWorkOnHoliday     (rs.getInt   (COL_WORK_ON_HOLIDAY     ));	// 休日出勤日数
		dto.setParticularHoliday (rs.getInt   (COL_PARTICULAR_HOLIDAY  ));	// 特別休暇日数
		dto.setPaidHoliday       (rs.getInt   (COL_PAID_HOLIDAY        ));	// 有給休暇日数
		dto.setAbsence           (rs.getInt   (COL_ABSENCE             ));	// 欠勤日数
		dto.setPaidHolidayRest   (rs.getInt   (COL_PAID_HOLIDAY_REST   ));	// 有給残
		dto.setPaymentHours      (rs.getFloat (COL_PAYMENT_HOURS       ));	// 時給時間
		dto.setArriveLate        (rs.getInt   (COL_ARRIVE_LATE         ));	// 遅刻回数
		dto.setEffortTime        (rs.getFloat (COL_EFFORT_TIME         ));	// 成果、残業時間
		dto.setEffortAllowance   (rs.getInt   (COL_EFFORT_ALLOWANCE    ));	// 成果、残業手当
		dto.setLateNight         (rs.getFloat (COL_LATE_NIGHT          ));	// 深夜時間
		dto.setLateNightAllowance(rs.getInt   (COL_LATE_NIGHT_ALLOWANCE));	// 深夜手当
		dto.setOverLate          (rs.getFloat (COL_OVER_LATE           ));	// 深夜残業時間
		dto.setOverLateAllowance (rs.getInt   (COL_OVER_LATE_ALLOWANCE ));	// 深夜残業手当
		dto.setHolidayTime       (rs.getFloat (COL_HOLIDAY_TIME        ));	// 休日時間
		dto.setHolidayAllowance  (rs.getInt   (COL_HOLIDAY_ALLOWANCE   ));	// 休日手当
		dto.setAttendance_13     (rs.getFloat (COL_ATTENDANCE_13       ));	// 勤怠項目13
		dto.setAttendance_14     (rs.getFloat (COL_ATTENDANCE_14       ));	// 勤怠項目14
		dto.setInstitutionalAbs  (rs.getInt   (COL_INSTITUTIONAL_ABS   ));	// 制度欠勤日数
		dto.setOtherAttendance   (rs.getInt   (COL_OTHER_ATTENDANCE    ));	// その他勤怠日数
		dto.setBasicSalary       (rs.getInt   (COL_BASIC_SALARY        ));	// 基本給
		dto.setAbility1Allowance (rs.getInt   (COL_ABILITY1_ALLOWANCE  ));	// 職能手当1
		dto.setAbility2Allowance (rs.getInt   (COL_ABILITY2_ALLOWANCE  ));	// 職能手当2
		dto.setFamilyAllowance   (rs.getInt   (COL_FAMILY_ALLOWANCE    ));	// 扶養手当
		dto.setAllowance_05      (rs.getInt   (COL_ALLOWANCE_05        ));	// 支給項目05
		dto.setAllowance_06      (rs.getInt   (COL_ALLOWANCE_06        ));	// 支給項目06
		dto.setCutForMissing     (rs.getInt   (COL_CUT_FOR_MISSING     ));	// 皆勤減額
		dto.setCutForShort       (rs.getInt   (COL_CUT_FOR_SHORT       ));	// 役職減額経験
		dto.setAllowance_09      (rs.getInt   (COL_ALLOWANCE_09        ));	// 支給項目09
		dto.setAllowance_10      (rs.getInt   (COL_ALLOWANCE_10        ));	// 支給項目10
		dto.setAllowance_11      (rs.getInt   (COL_ALLOWANCE_11        ));	// 支給項目11
		dto.setAllowance_12      (rs.getInt   (COL_ALLOWANCE_12        ));	// 支給項目12
		dto.setAllowance_13      (rs.getInt   (COL_ALLOWANCE_13        ));	// 支給項目13
		dto.setDateAllowance     (rs.getInt   (COL_DATE_ALLOWANCE      ));	// 日付手当
		dto.setAllowance_15      (rs.getInt   (COL_ALLOWANCE_15        ));	// 支給項目15
		dto.setAllowance_16      (rs.getInt   (COL_ALLOWANCE_16        ));	// 支給項目16
		dto.setAllowance_17      (rs.getInt   (COL_ALLOWANCE_17        ));	// 支給項目17
		dto.setCommutation       (rs.getInt   (COL_COMMUTATION         ));	// 通勤費
		dto.setCommutationTax    (rs.getInt   (COL_COMMUTATION_TAX     ));	// 課税通勤費
		dto.setOvertimeAllowance (rs.getInt   (COL_OVERTIME_ALLOWANCE  ));	// 成・深・休
		dto.setCutFromBasic      (rs.getInt   (COL_CUT_FROM_BASIC      ));	// 減額金
		dto.setHealthInsurance   (rs.getInt   (COL_HEALTH_INSURANCE    ));	// 健康保険料
		dto.setPensionInsurance  (rs.getInt   (COL_PENSION_INSURANCE   ));	// 厚生年金保険
		dto.setPensionFund       (rs.getInt   (COL_PENSION_FUND        ));	// 厚生年金基金
		dto.setEmployeeInsurance (rs.getInt   (COL_EMPLOYEE_INSURANCE  ));	// 雇用保険料
		dto.setIncomeTax         (rs.getInt   (COL_INCOME_TAX          ));	// 所得税
		dto.setResidenceTax      (rs.getInt   (COL_RESIDENCE_TAX       ));	// 住民税
		dto.setNursingInsurance  (rs.getInt   (COL_NURSING_INSURANCE   ));	// 介護保険料
		dto.setDeduction_08      (rs.getInt   (COL_DEDUCTION_08        ));	// 控除項目08
		dto.setDeduction_09      (rs.getInt   (COL_DEDUCTION_09        ));	// 控除項目09
		dto.setDeduction_10      (rs.getInt   (COL_DEDUCTION_10        ));	// 控除項目10
		dto.setDeduction_11      (rs.getInt   (COL_DEDUCTION_11        ));	// 控除項目11
		dto.setDeduction_12      (rs.getInt   (COL_DEDUCTION_12        ));	// 控除項目12
		dto.setDeduction_13      (rs.getInt   (COL_DEDUCTION_13        ));	// 控除項目13
		dto.setDeduction_14      (rs.getInt   (COL_DEDUCTION_14        ));	// 控除項目14
		dto.setDeduction_15      (rs.getInt   (COL_DEDUCTION_15        ));	// 控除項目15
		dto.setDeduction_16      (rs.getInt   (COL_DEDUCTION_16        ));	// 控除項目16
		dto.setDeduction_17      (rs.getInt   (COL_DEDUCTION_17        ));	// 控除項目17
		dto.setDeduction_18      (rs.getInt   (COL_DEDUCTION_18        ));	// 控除項目18
		dto.setDeduction_19      (rs.getInt   (COL_DEDUCTION_19        ));	// 控除項目19
		dto.setDeduction_20      (rs.getInt   (COL_DEDUCTION_20        ));	// 控除項目20
		dto.setAllowanceTotal    (rs.getInt   (COL_ALLOWANCE_TOTAL     ));	// 総支給金額
		dto.setDeductionTotal    (rs.getInt   (COL_DEDUCTION_TOTAL     ));	// 総控除金額
		dto.setPaymentTotal      (rs.getInt   (COL_PAYMENT_TOTAL       ));	// 差引支給額
		dto.setBank1PayAmount    (rs.getInt   (COL_BANK1_PAY_AMOUNT    ));	// 銀行1振込額
		dto.setBank2PayAmount    (rs.getInt   (COL_BANK2_PAY_AMOUNT    ));	// 銀行2振込額
		dto.setCashPayAmount     (rs.getInt   (COL_CASH_PAY_AMOUNT     ));	// 現金支給額
		dto.setDependentCount    (rs.getInt   (COL_DEPENDENT_COUNT     ));	// 扶養等の数
		dto.setAmountToTaxation  (rs.getInt   (COL_AMOUNT_TO_TAXATION  ));	// 課税対象額
		dto.setAmountToSocIns    (rs.getInt   (COL_AMOUNT_TO_SOC_INS   ));	// 社会保険対象額
		mappingCommonInfo(dto);
		return dto;
	}

	/**
	 * 全データ取得
	 * @return List 検索結果(DTOのList)
	 * @throws SQLException
	 * @throws IllegalAccessException
	 * @throws NoSuchFieldException
	 */
	public List<PdPaymentDto> findAll() throws SQLException, IllegalAccessException, NoSuchFieldException {
		try {
			prepareStatement(getSelectQuery(getClass()) + getOrderForKey(getClass()));
			executeQuery();
			List<PdPaymentDto> all = mappingAll();
			return all;
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}
	
	/**
	 * キーによるデータ取得
	 * @param kCode 社員コード(検索キー)
	 * @param calcDate 計算年月(検索キー)
	 * @return PdPaymentDto 検索結果(DTO)
	 * @throws SQLException
	 * @throws IllegalAccessException
	 * @throws NoSuchFieldException
	 */
	public PdPaymentDto findForKey(
			String kCode,
			Date   calcDate
	) throws SQLException, IllegalAccessException, NoSuchFieldException {
		try {
			index = 1;
			prepareStatement(getSelectQuery(getClass()) + getConditionForKey(getClass()));
			setParam(index++, kCode);
			setParam(index++, calcDate);
			executeQuery();
			PdPaymentDto dto = null;
			if (rs.next()) {
				dto = mapping();
			}
			return dto;
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}

	/**
	 * キーによる行ロック取得
	 * @param kCode 社員コード(検索キー)
	 * @param calcDate 計算年月(検索キー)
	 * @return PdPaymentDto 検索結果(DTO)
	 * @throws SQLException
	 * @throws IllegalAccessException
	 * @throws NoSuchFieldException
	 */
	public PdPaymentDto findForUpdate(
			String kCode,
			Date   calcDate
	) throws SQLException, IllegalAccessException, NoSuchFieldException {
		try {
			index = 1;
			prepareStatement(getSelectQuery(getClass()) + getConditionForKey(getClass()) + getForUpdate());
			setParam(index++, kCode);
			setParam(index++, calcDate);
			executeQuery();
			PdPaymentDto dto = null;
			if (rs.next()) {
				dto = mapping();
			}
			return dto;
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}
	
	/**
	 * 条件文によるデータ取得
	 * @param startDate 対象開始年月
	 * @param endDate 対象終了年月
	 * @return List 検索結果(DTOのList)
	 * @throws SQLException
	 * @throws IllegalAccessException
	 * @throws NoSuchFieldException
	 */
	public List<PdPaymentDto> findForConditionDate(
			String kCode,
			Date startDate,
			Date endDate
	) throws SQLException, IllegalAccessException, NoSuchFieldException {
		index = 1;
		StringBuffer sb = new StringBuffer();
		sb.append("WHERE ");
		sb.append(COL_K_CODE);
		sb.append(" = ? ");
		sb.append(" AND ");
		sb.append(COL_CALC_DATE);
		sb.append(" >= ? ");
		sb.append(" AND ");
		sb.append(COL_CALC_DATE);
		sb.append(" <= ? ");
		try {
			prepareStatement(getSelectQuery(getClass()) + sb.toString() + getOrderForKey(getClass()));
			setParam(index++, kCode);
			setParam(index++, startDate);
			setParam(index++, endDate);
			executeQuery();
			List<PdPaymentDto> list = mappingAll();
			return list;
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}
	
	/**
	 * 条件文によるデータ取得
	 * @param calcDate 検索計算年月
	 * @return List 検索結果(DTOのList)
	 * @throws SQLException
	 * @throws IllegalAccessException
	 * @throws NoSuchFieldException
	 */
	public List<PdPaymentDto> findForCondition(
			Date calcDate
	) throws SQLException, IllegalAccessException, NoSuchFieldException {
		index = 1;
		StringBuffer sb = new StringBuffer();
		sb.append("WHERE ");
		sb.append(COL_CALC_DATE);
		sb.append(" = ? ");
		try {
			prepareStatement(getSelectQuery(getClass()) + sb.toString() + getOrderForKey(getClass()));
			setParam(index++, calcDate);
			executeQuery();
			List<PdPaymentDto> list = mappingAll();
			return list;
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}

	
	
	/**
	 * 条件文によりデータを取得する。<br>
	 * 指定年月における確定済みデータを抽出する。<br>
	 * kCodeをnullにすると、社員コードによる指定を行わない。<br>
	 * 給与明細出力時に用いる。
	 * @param calcDate 検索計算年月
	 * @param kCode    検索社員コード
	 * @return List 検索結果(DTOのList)
	 * @throws SQLException
	 * @throws IllegalAccessException
	 * @throws NoSuchFieldException
	 */
	public List<PdPaymentDto> findForFBDataOutputDetail(
			Date calcDate, String kCode
	) throws SQLException, IllegalAccessException, NoSuchFieldException {
		index = 1;
		StringBuffer sb = new StringBuffer();
		sb.append("WHERE ");
		if (kCode != null) {
			sb.append(COL_K_CODE + " = ? ");
			sb.append("AND ");
		}
		sb.append(COL_CALC_DATE + " = ? ");
		sb.append("AND ");
		sb.append(COL_CALC_STATUS + " = '" + BonusConst.CALC_STATUS_FIX + "' ");
		try {
			prepareStatement(getSelectQuery(getClass()) + sb.toString() + getOrderForKey(getClass()));
			if (kCode != null) {
				setParam(index++, kCode);
			}
			setParam(index++, calcDate);
			executeQuery();
			return mappingAll();
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}
	
	
	
	/**
	 * 条件文によりデータを取得する。<br>
	 * 指定年月における確定済みデータを抽出する。<br>
	 * kCodeをnullにすると、社員コードによる指定を行わない。<br>
	 * 給与明細出力時に用いる。
	 * @param calcDate 検索計算年月
	 * @param kCode    検索社員コード
	 * @param stationCode 検索所属コード(事業所)
	 * @return List 検索結果(DTOのList)
	 * @throws SQLException
	 * @throws IllegalAccessException
	 * @throws NoSuchFieldException
	 */
	public  List<PdPaymentDto> findForOutputDetail(
			Date calcDate, String kCode, String stationCode
	) throws SQLException, IllegalAccessException, NoSuchFieldException {
		index = 1;
		StringBuffer sb = new StringBuffer();
		sb.append("WHERE ");
		if (kCode != null) {
			sb.append(COL_K_CODE + " = ? ");
			sb.append("AND ");
		}
		sb.append(COL_CALC_DATE + " = ? ");
		sb.append("AND ");
		sb.append(COL_CALC_STATUS + " IN ('" + BonusConst.CALC_STATUS_FIX + "','" +BonusConst.CALC_STATUS_FB +"')");
		if (stationCode != null) {
			if (!stationCode.equals("")) {
				sb.append("AND ");
				sb.append(COL_STATION_CODE + " IN  ( " + PmStationDao.getStationQuery() + " ) ");
			}
		}
		try {
			prepareStatement(getSelectQuery(getClass()) + sb.toString() + getOrderForKey(getClass()));
			if (kCode != null) {
				setParam(index++, kCode);
			}
			setParam(index++, calcDate);
			if (stationCode != null) {
				if (!stationCode.equals("")) {
					setParam(index++, stationCode);
				}
			}
			executeQuery();
			return mappingAll();
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}

	/**
	 * 条件文によるデータ削除
	 * @param calcDate 検索計算年月
	 * @return List 検索結果(DTOのList)
	 * @throws SQLException
	 */
	public int deleteForCondition(
			Date calcDate
	) throws SQLException {
		index = 1;
		StringBuffer sb = new StringBuffer();
		sb.append("DELETE FROM ");
		sb.append(TABLE + " ");
		sb.append("WHERE ");
		sb.append(COL_CALC_DATE);
		sb.append(" = ? ");
		try {
			prepareStatement(sb.toString());
			setParam(index++, calcDate);
			executeUpdate();
			return cnt;
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}

	/**
	 * データ挿入
	 * @param dto 挿入対象DTO
	 * @return int 挿入結果(件数)
	 * @throws SQLException
	 * @throws IllegalAccessException
	 * @throws NoSuchFieldException
	 * @throws MospException
	 */
	public int insert(PdPaymentDto dto) throws SQLException, IllegalAccessException, NoSuchFieldException, MospException {
		try {
			index = 1;
			prepareStatement(getInsertQuery(getClass()));
			setParams(dto, true);
			executeUpdate();
			chkInsert(1);
			return cnt;
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}
	
	/**
	 * データ挿入(アップロード)
	 * @param aryCsvDate 挿入対象DTO
	 * @return int 挿入結果(件数)
	 * @throws SQLException
	 */
	public int insertUpload(
			String[] aryHeaderNo,
			String[] aryCsvData,
			Date calcDate,
			Date payDay,
			String kName,
			String stationCode,
			String employmentType,
			String positionCode
	) throws SQLException {
		try {
			Date date = new Date();
			index = 1;
			StringBuffer sb = new StringBuffer();
			sb.append("INSERT INTO ");
			sb.append(TABLE);
			sb.append(" ( ");
			sb.append(createCol(aryHeaderNo,true));
			sb.append(COL_CALC_DATE);
			sb.append(", ");
			sb.append(COL_PAYDAY);
			sb.append(", ");
			sb.append(COL_K_NAME);
			sb.append(", ");
			sb.append(COL_STATION_CODE);
			sb.append(", ");			
			sb.append(COL_CALC_STATUS);
			sb.append(", ");
			sb.append(COL_EMPLOYMENT_TYPE);
			sb.append(", ");
			sb.append(COL_POSITION_CODE);
			sb.append(", ");
			if (!INSERT_DATE.equals("")) {
				sb.append(INSERT_DATE + ", ");
			}
			if (!INSERT_USER.equals("")) {
				sb.append(INSERT_USER + ", ");
			}
			if (!UPDATE_DATE.equals("")) {
				sb.append(UPDATE_DATE + ", ");
			}
			if (!UPDATE_USER.equals("")) {
				sb.append(UPDATE_USER + " ");
			}
			sb.append(" ) VALUES ( ");
			sb.append(insertRow(aryCsvData));
			sb.append("?, ");
			sb.append("?, ");
			sb.append("?, ");
			sb.append("?, ");			
			sb.append("?, ");
			sb.append("?, ");			
			sb.append("?, ");
			if (!INSERT_DATE.equals("")) {
				sb.append("?, ");
			}
			if (!INSERT_USER.equals("")) {
				sb.append("?, ");
			}
			if (!UPDATE_DATE.equals("")) {
				sb.append("?, ");
			}
			if (!UPDATE_USER.equals("")) {
				sb.append("?  ");
			}
			sb.append(" ) ");
			prepareStatement(sb.toString());
			for (int i = 0; i < aryCsvData.length; i++) {
				setParam(index++, aryCsvData[i]);
			}
			setParam(index++, calcDate);
			setParam(index++, payDay);
			setParam(index++, kName);
			setParam(index++, stationCode);
			setParam(index++, BonusConst.CALC_STATUS_CRE);
			setParam(index++, employmentType);
			setParam(index++, positionCode);
			if (!INSERT_DATE.equals("")) {
				setParam(index++, date);
			}
			if (!INSERT_USER.equals("")) {
				setParam(index++, userId);
			}
			if (!UPDATE_DATE.equals("")) {
				setParam(index++, date);
			}
			if (!UPDATE_USER.equals("")) {
				setParam(index++, userId);
			}
			executeUpdate();
			return cnt;
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}
	
	/**
	 * 選択カラムのみSQL作成
	 * @param aryHeaderNo
	 * @param isInsert
	 * @return
	 */
	public String createCol(
			String[] aryHeaderNo,
			boolean isInsert
		) {
			index = 1;
			StringBuffer sb = new StringBuffer();
			for (int i = 0; i < aryHeaderNo.length; i++) {
				sb.append(getColumn(Integer.parseInt(aryHeaderNo[i])));
				if (!isInsert) {
					sb.append(" = ? ");
				}
				sb.append(BonusConst.STR_CSV_SEPARATOR);
			}
			return sb.toString();
		
	}
	
	/**
	 * 登録パラメータ生成
	 * @param aryCsvData
	 * @return
	 */
	public String insertRow(
			String[] aryCsvData
		) {
			index = 1;
			StringBuffer sb = new StringBuffer();
			for (int i = 0; i < aryCsvData.length; i++) {
				sb.append(" ? ");
				sb.append(BonusConst.STR_CSV_SEPARATOR);
			}
			return sb.toString();
		
	}
	
	/**
	 * データ更新(アップロード)
	 * @param dto 更新対象DTO
	 * @return int 更新結果(件数)
	 * @throws SQLException
	 */
	public int updateUpload(
			String[] aryHeaderNo,
			String[] aryCsvData,
			String   kCode,
			Date   calcDate,
			String kName,
			String stationCode,
			String employmentType,
			String positionCode
	) throws SQLException {
		try {
			Date date = new Date();
			index = 1;
			StringBuffer sb = new StringBuffer();
			sb.append("UPDATE ");
			sb.append(TABLE);
			sb.append(" SET ");
			sb.append(createCol(aryHeaderNo,false));
			sb.append(COL_CALC_DATE + " = ?, ");
			sb.append(COL_K_NAME + " = ?, ");
			sb.append(COL_STATION_CODE + " = ?, ");			
			sb.append(COL_CALC_STATUS + " = ?, ");
			sb.append(COL_EMPLOYMENT_TYPE + " = ?, ");
			sb.append(COL_POSITION_CODE + " = ?, ");
			
			sb.append(COL_ALLOWANCE_TOTAL    + " = ?, ");
			sb.append(COL_DEDUCTION_TOTAL    + " = ?, ");
			sb.append(COL_PAYMENT_TOTAL      + " = ?, ");
			sb.append(COL_BANK1_PAY_AMOUNT   + " = ?, ");
			sb.append(COL_BANK2_PAY_AMOUNT   + " = ?, ");
			sb.append(COL_CASH_PAY_AMOUNT    + " = ?, ");
			sb.append(COL_AMOUNT_TO_TAXATION + " = ?, ");
			sb.append(COL_AMOUNT_TO_SOC_INS  + " = ?, ");
			
			if (!UPDATE_DATE.equals("")) {
				sb.append(UPDATE_DATE + " = ?, ");
			}
			if (!UPDATE_USER.equals("")) {
				sb.append(UPDATE_USER + " = ? ");
			}
			sb.append(" WHERE ");
			sb.append(COL_K_CODE);
			sb.append(" = ? ");
			sb.append(" AND ");
			sb.append(COL_CALC_DATE);
			sb.append(" = ? ");
			prepareStatement(sb.toString());
			for (int i = 0; i < aryCsvData.length; i++) {
				setParam(index++, aryCsvData[i]);
			}
			setParam(index++, calcDate);
			setParam(index++, kName);
			setParam(index++, stationCode);
			setParam(index++, BonusConst.CALC_STATUS_CRE);
			setParam(index++, employmentType);
			setParam(index++, positionCode);
			
			setParam(index++, 0);
			setParam(index++, 0);
			setParam(index++, 0);
			setParam(index++, 0);
			setParam(index++, 0);
			setParam(index++, 0);
			setParam(index++, 0);
			setParam(index++, 0);
			if (!UPDATE_DATE.equals("")) {
				setParam(index++, date);
			}
			if (!UPDATE_USER.equals("")) {
				setParam(index++, userId);
			}
			setParam(index++, kCode);
			setParam(index++, calcDate);
			executeUpdate();
			return cnt;
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}

	/**
	 * データ挿入
	 * @param dto 挿入対象DTO
	 * @param needLog ログ出力要否
	 * @return int 挿入結果(件数)
	 * @throws SQLException
	 * @throws IllegalAccessException
	 * @throws NoSuchFieldException
	 * @throws MospException
	 */
	public int insert(PdPaymentDto dto, boolean needLog) throws SQLException, IllegalAccessException, NoSuchFieldException, MospException {
		try {
			index = 1;
			prepareStatement(getInsertQuery(getClass()));
			setParams(dto, true);
			executeUpdate(needLog);
			chkInsert(1);
			return cnt;
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}
	
	/**
	 * データ更新
	 * @param dto 更新対象DTO
	 * @param needLog ログ出力要否
	 * @return int 更新結果(件数)
	 * @throws SQLException
	 * @throws IllegalAccessException
	 * @throws NoSuchFieldException
	 * @throws MospException
	 */
	public int update(
			PdPaymentDto dto, boolean needLog
	) throws SQLException, IllegalAccessException, NoSuchFieldException, MospException {
		try {
			index = 1;
			prepareStatement(getUpdateQuery(getClass()));
			setParams(dto, false);
			setParam(index++, dto.getKCode());
			setParam(index++, dto.getCalcDate());
			executeUpdate(needLog);
			chkUpdate(1);
			return cnt;
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}
	
	/**
	 * データ削除
	 * @param dto 更新対象DTO
	 * @return int 削除結果(件数)
	 * @throws SQLException
	 * @throws IllegalAccessException
	 * @throws NoSuchFieldException
	 * @throws MospException
	 */
	public int delete(PdPaymentDto dto) throws SQLException, IllegalAccessException, NoSuchFieldException, MospException {
		try {
			index = 1;
			prepareStatement(getDeleteQuery(getClass()));
			setParam(index++, dto.getKCode());
			setParam(index++, dto.getCalcDate());
			executeUpdate();
			chkDelete(1);
			return cnt;
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}
	
	/**
	 * 社員によるデータ削除
	 * @param kCode 削除対象社員コード
	 * @return int 削除結果(件数)
	 * @throws SQLException
	 */
	public int deleteForEmployee(String kCode) throws SQLException {
		try {
			index = 1;
			StringBuffer sb = new StringBuffer();
			sb.append("DELETE FROM " + TABLE + " ");
			sb.append("WHERE ");
			sb.append(COL_K_CODE + " = ? ");
			prepareStatement(sb.toString());
			setParam(index++, kCode);
			executeUpdate();
			return cnt;
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}
	
	/**
	 * 条件文によるデータ取得(人事マスタ保守-社員一覧用)
	 * @param kCode          検索社員コード
	 * @param kName          検索社員名
	 * @param kKana          検索ﾌﾘｶﾞﾅ
	 * @param stationCode    検索所属コード
	 * @param positionCode   検索職位コード
	 * @param retirementFlag 検索退職フラグ
	 * @return List 検索結果(DTOのList)
	 * @throws SQLException
	 * @throws IllegalAccessException
	 * @throws NoSuchFieldException 
	 */
	public List<PdPaymentDto> findForPaymentList(
			String kCode,
			String kName,
			String stationCode,
			String statusData
	) throws SQLException, IllegalAccessException, NoSuchFieldException {
		index = 1;
		StringBuffer sb = new StringBuffer();
		if (
			kCode        != null && !kCode.equals       ("") ||
			kName        != null && !kName.equals       ("") ||
			stationCode  != null && !stationCode.equals ("") ||
			statusData   != null && !statusData.equals  ("")
		) {
			sb.append("WHERE ");
		}		
		if (kCode != null && !kCode.equals("")) {
			sb.append(COL_K_CODE + " =  ? ");
			if (
					kName        != null && !kName.equals       ("") ||
					stationCode  != null && !stationCode.equals ("") ||
					statusData   != null && !statusData.equals  ("")
				) {
				sb.append("AND ");
			}		
		}
		if (kName != null && !kName.equals("")) {
			sb.append(COL_K_NAME + " =  ? ");
			if (
					
					stationCode  != null && !stationCode.equals ("") ||
					statusData   != null && !statusData.equals  ("")
				) {
				sb.append("AND ");
			}		
		}
		if (stationCode != null && !stationCode.equals("")) {
			sb.append(COL_STATION_CODE + " =  ? ");
			if (
					statusData   != null && !statusData.equals  ("")
				) {
				sb.append("AND ");
			}		
		}		
		if (statusData != null && !statusData.equals("")) {
			sb.append(COL_CALC_STATUS + " =  ? ");
		}
		try {
			prepareStatement(getSelectQuery(getClass()) + sb.toString() + getOrderForKey(getClass()));
			if (kCode != null && !kCode.equals("")) {
				setParam(index++, kCode);
			}
			if (kName != null && !kName.equals("")) {
				setParam(index++, kName);
			}
			if (stationCode != null && !stationCode.equals("")) {
				setParam(index++, stationCode);
			}		
			if (statusData != null && !statusData.equals("")) {
				setParam(index++, statusData);
			}
			// 実行
			executeQuery();
			List<PdPaymentDto> list = mappingAll();
			return list;
		} catch (SQLException e) {
			throw e;
		} finally {
			releaseResultSet();
			releasePreparedStatement();
		}
	}
	
	/**
	 * パラメータ設定
	 * @param dto 更新対象DTO
	 * @param isInsert 挿入文フラグ(true：挿入文、false：更新文)
	 * @throws SQLException
	 */
	private void setParams(PdPaymentDto dto, boolean isInsert) throws SQLException {
		setParam(index++, dto.getKCode             ());	// 社員コード
		setParam(index++, dto.getCalcDate          ());	// 計算年月
		setParam(index++, dto.getPayday            ());	// 給与支給日
		setParam(index++, dto.getCalcStatus        ());	// 計算ステータス
		setParam(index++, dto.getKName             ());	// 社員氏名
		setParam(index++, dto.getStationCode       ());	// 所属コード
		setParam(index++, dto.getPositionCode      ());	// 職位コード
		setParam(index++, dto.getEmploymentType    ());	// 雇用区分
		setParam(index++, dto.getPresence          ());	// 出勤日数
		setParam(index++, dto.getWorkOnHoliday     ());	// 休日出勤日数
		setParam(index++, dto.getParticularHoliday ());	// 特別休暇日数
		setParam(index++, dto.getPaidHoliday       ());	// 有給休暇日数
		setParam(index++, dto.getAbsence           ());	// 欠勤日数
		setParam(index++, dto.getPaidHolidayRest   ());	// 有給残
		setParam(index++, dto.getPaymentHours      ());	// 時給時間
		setParam(index++, dto.getArriveLate        ());	// 遅刻回数
		setParam(index++, dto.getEffortTime        ());	// 成果、残業時間
		setParam(index++, dto.getEffortAllowance   ());	// 成果、残業手当
		setParam(index++, dto.getLateNight         ());	// 深夜時間
		setParam(index++, dto.getLateNightAllowance());	// 深夜手当
		setParam(index++, dto.getOverLate          ());	// 深夜残業時間
		setParam(index++, dto.getOverLateAllowance ());	// 深夜残業手当
		setParam(index++, dto.getHolidayTime       ());	// 休日時間
		setParam(index++, dto.getHolidayAllowance  ());	// 休日手当
		setParam(index++, dto.getAttendance_13     ());	// 勤怠項目13
		setParam(index++, dto.getAttendance_14     ());	// 勤怠項目14
		setParam(index++, dto.getInstitutionalAbs  ());	// 制度欠勤日数
		setParam(index++, dto.getOtherAttendance   ());	// その他勤怠日数
		setParam(index++, dto.getBasicSalary       ());	// 基本給
		setParam(index++, dto.getAbility1Allowance ());	// 職能手当1
		setParam(index++, dto.getAbility2Allowance ());	// 職能手当2
		setParam(index++, dto.getFamilyAllowance   ());	// 扶養手当
		setParam(index++, dto.getAllowance_05      ());	// 支給項目05
		setParam(index++, dto.getAllowance_06      ());	// 支給項目06
		setParam(index++, dto.getCutForMissing     ());	// 皆勤減額
		setParam(index++, dto.getCutForShort       ());	// 役職減額経験
		setParam(index++, dto.getAllowance_09      ());	// 支給項目09
		setParam(index++, dto.getAllowance_10      ());	// 支給項目10
		setParam(index++, dto.getAllowance_11      ());	// 支給項目11
		setParam(index++, dto.getAllowance_12      ());	// 支給項目12
		setParam(index++, dto.getAllowance_13      ());	// 支給項目13
		setParam(index++, dto.getDateAllowance     ());	// 日付手当
		setParam(index++, dto.getAllowance_15      ());	// 支給項目15
		setParam(index++, dto.getAllowance_16      ());	// 支給項目16
		setParam(index++, dto.getAllowance_17      ());	// 支給項目17
		setParam(index++, dto.getCommutation       ());	// 通勤費
		setParam(index++, dto.getCommutationTax    ());	// 課税通勤費
		setParam(index++, dto.getOvertimeAllowance ());	// 成・深・休
		setParam(index++, dto.getCutFromBasic      ());	// 減額金
		setParam(index++, dto.getHealthInsurance   ());	// 健康保険料
		setParam(index++, dto.getPensionInsurance  ());	// 厚生年金保険
		setParam(index++, dto.getPensionFund       ());	// 厚生年金基金
		setParam(index++, dto.getEmployeeInsurance ());	// 雇用保険料
		setParam(index++, dto.getIncomeTax         ());	// 所得税
		setParam(index++, dto.getResidenceTax      ());	// 住民税
		setParam(index++, dto.getNursingInsurance  ());	// 介護保険料
		setParam(index++, dto.getDeduction_08      ());	// 控除項目08
		setParam(index++, dto.getDeduction_09      ());	// 控除項目09
		setParam(index++, dto.getDeduction_10      ());	// 控除項目10
		setParam(index++, dto.getDeduction_11      ());	// 控除項目11
		setParam(index++, dto.getDeduction_12      ());	// 控除項目12
		setParam(index++, dto.getDeduction_13      ());	// 控除項目13
		setParam(index++, dto.getDeduction_14      ());	// 控除項目14
		setParam(index++, dto.getDeduction_15      ());	// 控除項目15
		setParam(index++, dto.getDeduction_16      ());	// 控除項目16
		setParam(index++, dto.getDeduction_17      ());	// 控除項目17
		setParam(index++, dto.getDeduction_18      ());	// 控除項目18
		setParam(index++, dto.getDeduction_19      ());	// 控除項目19
		setParam(index++, dto.getDeduction_20      ());	// 控除項目20
		setParam(index++, dto.getAllowanceTotal    ());	// 総支給金額
		setParam(index++, dto.getDeductionTotal    ());	// 総控除金額
		setParam(index++, dto.getPaymentTotal      ());	// 差引支給額
		setParam(index++, dto.getBank1PayAmount    ());	// 銀行1振込額
		setParam(index++, dto.getBank2PayAmount    ());	// 銀行2振込額
		setParam(index++, dto.getCashPayAmount     ());	// 現金支給額
		setParam(index++, dto.getDependentCount    ());	// 扶養等の数
		setParam(index++, dto.getAmountToTaxation  ());	// 課税対象額
		setParam(index++, dto.getAmountToSocIns    ());	// 社会保険対象額
		setCommonParams(isInsert);
	}

	/**
	 * カラム名取得
	 * @param idx
	 * @return カラム名
	 */
	
	public String getColumn(
			int idx
		) {
		switch (idx) {
		case 0  : return COL_K_CODE             ; // 社員コード
		case 1  : return COL_ALLOWANCE_05       ; // 支給項目05
		case 2  : return COL_ALLOWANCE_06       ; // 支給項目06
		case 3  : return COL_ALLOWANCE_09       ; // 支給項目09
		case 4  : return COL_ALLOWANCE_10       ; // 支給項目10
		case 5  : return COL_ALLOWANCE_11       ; // 支給項目11
		case 6  : return COL_ALLOWANCE_12       ; // 支給項目12
		case 7  : return COL_ALLOWANCE_13       ; // 支給項目13
		case 8  : return COL_ALLOWANCE_15       ; // 支給項目15
		case 9  : return COL_ALLOWANCE_16       ; // 支給項目16
		case 10 : return COL_ALLOWANCE_17       ; // 支給項目17
		case 11 : return COL_DEDUCTION_08       ; // 控除項目08
		case 12 : return COL_DEDUCTION_09       ; // 控除項目09
		case 13 : return COL_DEDUCTION_10       ; // 控除項目10
		case 14 : return COL_DEDUCTION_11       ; // 控除項目11
		case 15 : return COL_DEDUCTION_12       ; // 控除項目12
		case 16 : return COL_DEDUCTION_13       ; // 控除項目13
		case 17 : return COL_DEDUCTION_14       ; // 控除項目14
		case 18 : return COL_DEDUCTION_15       ; // 控除項目15
		case 19 : return COL_DEDUCTION_16       ; // 控除項目16
		case 20 : return COL_DEDUCTION_17       ; // 控除項目17
		case 21 : return COL_DEDUCTION_18       ; // 控除項目18
		case 22 : return COL_DEDUCTION_19       ; // 控除項目19
		case 23 : return COL_DEDUCTION_20       ; // 控除項目20
		default:
			return "";
		}
		
	}
}
