---
title: "JBSbatKKCourseChgFixTgCst.executeKK_T_IDO_RSV_KK_SELECT_007"
description: "Batch method that binds reservation date parameters and executes a database SELECT on the abnormal reservation table (KK_T_IDO_RSV)."
tags:
  - batch
  - service
  - dao
  - select
  - koptBatch
---

# Business Logic — JBSbatKKCourseChgFixTgCst.executeKK_T_IDO_RSV_KK_SELECT_007() [11 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKCourseChgFixTgCst` |
| Layer | Batch (Package: `eo.business.service`, sourced from `koptBatch`) |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKCourseChgFixTgCst.executeKK_T_IDO_RSV_KK_SELECT_007()

This method is a **batch-side data access helper** that performs a **database SELECT query against the abnormal reservation table** (`KK_T_IDO_RSV`) to retrieve **migration reservation records** (異動予約) matching a given operation date. It is not a standalone business entry point; rather, it is a **dedicated DAO-like delegate** called by the parent batch method `execute()` to fetch abnormal reservation data for the current operation date. The method implements the **parameter binding + SQL dispatch pattern**: it constructs a `JBSbatCommonDBInterface` list, binds three identical values (the operation date — 運用日) into it as bind variables, and then delegates the actual SQL execution to the injected `JBSbatSQLAccess` instance (`db_KK_T_IDO_RSV`) via the `selectBySqlDefine` method, using the SQL key `"KK_SELECT_007"`. Its role in the larger system is to **surface abnormal reservation records** that the batch can then iterate over to drive subsequent course-change/fix processing (e.g., writing interface files for reassignment or cancellation of reservations whose migration could not proceed normally).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeKK_T_IDO_RSV_KK_SELECT_007(params)"])
    STEP1(["Generate paramList (JBSbatCommonDBInterface)"])
    STEP2(["Set param[0] value to paramList"])
    STEP3(["Set param[1] value to paramList"])
    STEP4(["Set param[2] value to paramList"])
    STEP5(["Execute DB selectBySqlDefine"])
    END_NODE(["Return / Next"])

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> STEP3
    STEP3 --> STEP4
    STEP4 --> STEP5
    STEP5 --> END_NODE
```

**Processing narrative:**

1. **Generate bind variable list** — Creates a fresh `JBSbatCommonDBInterface` instance (`paramList`) to hold the bind variables for the SQL query. The Javadoc comment says 「バインド変数のリストを生成します」 ("Generates a list of bind variables").
2. **Bind param[0]** — Converts the first element of the incoming `param` array to a string and appends it as a bind variable. Based on the caller, this is the **operation date** (運用日) used in a `WHERE` clause condition (e.g., `YYYYMMDD >= ?`).
3. **Bind param[1]** — Converts the second element (also the operation date) and appends it as a second bind variable (e.g., `YYYYMMDD <= ?`).
4. **Bind param[2]** — Converts the third element (also the operation date) and appends it as a third bind variable (e.g., for an `IN` or comparison clause).
5. **Execute DB SELECT** — Invokes `db_KK_T_IDO_RSV.selectBySqlDefine(paramList, "KK_SELECT_007")` to execute the pre-defined SQL. The Javadoc says 「SQLKEY(KK_SELECT_007)でDBアクセスを行います」 ("Performs DB access with SQL key KK_SELECT_007").
6. **Return** — Method returns `void`; control returns to the caller.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `Object[]` | An array of 3 bind variable values used to construct the `WHERE` clause of the SQL query. Each element represents the **operation date** (運用日) formatted as a `String` (e.g., `"20250701"`). Based on the caller, all three positions receive the identical `opeDate` value, which is used for date-range comparison conditions against the `KK_T_IDO_RSV` table's date columns (e.g., filtering reservations whose applicable date falls within the specified date window). |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `db_KK_T_IDO_RSV` | `JBSbatSQLAccess` | Database access handler for the abnormal reservation table (`KK_T_IDO_RSV`), injected by the framework. |

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis graph:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `db_KK_T_IDO_RSV.selectBySqlDefine` | - | `KK_T_IDO_RSV` | Executes the pre-defined SQL query `KK_SELECT_007` to read abnormal reservation records, binding the operation date values from `paramList` as query parameters. |

**Classification rationale:**
- The method name `selectBySqlDefine` and the SQL key `KK_SELECT_007` clearly indicate a **Read** operation.
- The entity/table is `KK_T_IDO_RSV` (異動予約 / Migration Reservation), a table that stores reservation records for service course changes that could not proceed normally and require reprocessing or reassignment.

## 5. Dependency Trace

### Pre-computed evidence from code analysis graph:

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `selectBySqlDefine` [-]

### Caller Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKCourseChgFixTgCst.execute()` | `execute()` -> `executeKK_T_IDO_RSV_KK_SELECT_007(whereKkTIdoRsvParam)` | `selectBySqlDefine [R] KK_T_IDO_RSV` |

**Call chain description:**

The batch method `execute()` (the entry point of `JBSbatKKCourseChgFixTgCst`) constructs a `whereKkTIdoRsvParam` array containing three copies of `this.opeDate` (the operation date), then invokes `executeKK_T_IDO_RSV_KK_SELECT_007(whereKkTIdoRsvParam)`. After this method returns, the caller retrieves results via `db_KK_T_IDO_RSV.selectNext()` and iterates over the result set with a `while` loop to process each abnormal reservation record (reading fields like `SVC_KEI_NO` and `SVC_CD`).

**Downstream terminal operations from this method:**
- `selectBySqlDefine` → **R** (Read) on table `KK_T_IDO_RSV`

## 6. Per-Branch Detail Blocks

This method has **no conditional branches** (no if/else, no switch/case, no loops). It is a linear sequence of setup and invocation statements.

---

**Block 1** — [SET/EXEC] `(paramList creation)` (L744)

> Javadoc: 「バインド変数のリストを生成します」 ("Generates a list of bind variables")

| # | Type | Code |
|---|------|------|
| 1 | SET | `JBSbatCommonDBInterface paramList = new JBSbatCommonDBInterface();` // Create a new bind-variable list container |

---

**Block 2** — [EXEC] `(Bind param[0] — operation date)` (L745)

> Javadoc: 「引数でバイント変数を設定します」 ("Sets bind variables from arguments")

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramList.setValue(param[0].toString());` // Bind first operation date value |

---

**Block 3** — [EXEC] `(Bind param[1] — operation date)` (L746)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramList.setValue(param[1].toString());` // Bind second operation date value |

---

**Block 4** — [EXEC] `(Bind param[2] — operation date)` (L747)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramList.setValue(param[2].toString());` // Bind third operation date value |

---

**Block 5** — [CALL] `(DB SELECT execution)` (L750)

> Javadoc: 「DBアクセスを実行します」 ("Executes DB access")

| # | Type | Code |
|---|------|------|
| 1 | CALL | `db_KK_T_IDO_RSV.selectBySqlDefine(paramList, KK_T_IDO_RSV_KK_SELECT_007);` // Execute SQL key KK_SELECT_007 against KK_T_IDO_RSV table with bound date parameters |

---

**Block 6** — [RETURN] `(void return)` (L751)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` // Method ends; result remains accessible via db_KK_T_IDO_RSV.selectNext() for the caller |

---

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `KK_T_IDO_RSV` | Table | **Migration Reservation** (異動予約) — The database table storing reservation records for service course changes that could not proceed normally and require reprocessing, reassignment, or cancellation. |
| `KK_SELECT_007` | SQL Key | A pre-defined SQL SELECT statement identifier used to query the `KK_T_IDO_RSV` table by operation date. |
| `JBSbatCommonDBInterface` | Class | A framework data container that holds bind variable values (paramList) to be passed to SQL execution methods. |
| `JBSbatSQLAccess` | Class | A framework database access handler class that provides `selectBySqlDefine()` and `selectNext()` methods for executing pre-defined SQL and iterating over result sets. |
| `selectBySqlDefine` | Method | A framework method that executes a pre-defined SQL statement using the SQL key name and a list of bind variables. |
| `selectNext` | Method | A framework method that retrieves the next row from the result set of the most recent `selectBySqlDefine` call, returning a `JBSbatCommonDBInterface` map. |
| `opeDate` | Field | **Operation Date** (運用日) — The processing date for the batch job, formatted as `YYYYMMDD`. Used as a date-range filter when querying abnormal reservations. |
| `ido_rsv` | Abbreviation | Short for **Iidou Yoyaku** (異動予約) — Migration Reservation. Refers to records of service course changes that were reserved but did not complete normally. |
| `paramList` | Local var | Bind variable list — A container holding the date values that are bound into the SQL `WHERE` clause parameters. |
| `SVC_KEI_NO` | Field | **Service Detail Number** (サービス契約詳細番号) — The internal tracking number for a service contract detail line item. |
| `SVC_CD` | Field | **Service Code** (サービスコード) — The code identifying the type of service (e.g., FTTH, Mail, etc.). |
| `KOPT Batch` | Term | **Kouki Optics Batch** (高位光学バッチ) — The batch processing subsystem within the NTT service management platform that handles nightly/periodic data operations. |
| `JBSbatBusinessService` | Class | The base class for all batch business services in this framework. `JBSbatKKCourseChgFixTgCst` extends it to inherit common batch lifecycle methods (e.g., `execute()`). |
| `KK_T_IDO_RSV_KK_SELECT_007` | Constant | Static final string `"KK_SELECT_007"` — the SQL key used to look up the SELECT statement for abnormal reservation queries. |
