# Business Logic — JBSbatKKCourseChgFixTgCst.executeKK_T_IDO_RSV_KK_SELECT_030() [15 LOC]

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

## 1. Role

### JBSbatKKCourseChgFixTgCst.executeKK_T_IDO_RSV_KK_SELECT_030()

This method is a private batch utility that performs a database SELECT query against the `KK_T_IDO_RSV` (Reservation/Movement Reservation) table using a predefined SQL key (`KK_SELECT_030`). It serves as the data access layer for retrieving disputed or pending reservation records during a batch processing run. The method receives an `Object[]` array containing seven bind parameters — all of which are date values representing the "Reservation Application Date" (予約適用年月日) — packages them into a `JBSbatCommonDBInterface` holder, and delegates the actual SQL execution to the `db_KK_T_IDO_RSV.selectBySqlDefine()` method. It implements the common batch DAO (Data Access Object) delegation pattern used throughout the `JBSbatKKCourseChgFixTgCst` class, where every `executeKK_T_*_KK_SELECT_*` method follows this identical template: accept a bind-variable array, populate a parameter list, and invoke `selectBySqlDefine`. Within the larger system, this method is called from the `execute()` method of the same class to search for disputed reservations (異動予約検索) by matching the operating date (opeDate) across all seven date columns of the reservation table.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeKK_T_IDO_RSV_KK_SELECT_030(param)"])
    CREATE["Create JBSbatCommonDBInterface paramList"]
    SET0["paramList.setValue(param[0].toString())"]
    SET1["paramList.setValue(param[1].toString())"]
    SET2["paramList.setValue(param[2].toString())"]
    SET3["paramList.setValue(param[3].toString())"]
    SET4["paramList.setValue(param[4].toString())"]
    SET5["paramList.setValue(param[5].toString())"]
    SET6["paramList.setValue(param[6].toString())"]
    EXEC["db_KK_T_IDO_RSV.selectBySqlDefine(paramList, KK_SELECT_030)"]
    END_NODE(["Return / Next"])

    START --> CREATE
    CREATE --> SET0
    SET0 --> SET1
    SET1 --> SET2
    SET2 --> SET3
    SET3 --> SET4
    SET4 --> SET5
    SET5 --> SET6
    SET6 --> EXEC
    EXEC --> END_NODE
```

**Processing Description:**

This method has no conditional branches, loops, or error handling of its own. It follows a strictly linear flow:

1. **Bind Parameter Preparation (Lines 837–844):** Creates a new `JBSbatCommonDBInterface` instance (`paramList`) to hold the bind variables. Iteratively converts each of the seven `Object` elements in the `param` array to `String` via `toString()` and adds them to the parameter list via `setValue()`. Each `setValue()` call appends one bind variable value in order, corresponding to the seven date columns in the SQL query.

2. **SQL Execution (Line 847):** Invokes `db_KK_T_IDO_RSV.selectBySqlDefine(paramList, KK_T_IDO_RSV_KK_SELECT_030)` to execute a predefined SQL SELECT statement (SQL key `"KK_SELECT_030"`) against the `KK_T_IDO_RSV` table, passing the populated parameter list. The `db_KK_T_IDO_RSV` is an instance of `JBSbatSQLAccess`, a framework-provided database access class. This method does not capture or return the result set directly — the result is retrieved separately via `selectNext()` by the caller.

3. **Return:** The method returns `void` — the caller retrieves results through the `db_KK_T_IDO_RSV` access object's result interface.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `Object[]` | An array of 7 bind variable values. All seven elements represent the **Reservation Application Date** (予約適用年月日 — the date from which a reservation/movement becomes effective). In practice, the caller passes `this.opeDate` (the batch processing operating date) for all seven positions, meaning the query searches for reservations whose application date matches the current operating date across all seven date columns in the `KK_T_IDO_RSV` table. Each element is converted to `String` via `toString()` before being passed to the SQL layer. |

**External state accessed by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `db_KK_T_IDO_RSV` | `JBSbatSQLAccess` | Database access object for the `KK_T_IDO_RSV` (Reservation/Movement Reservation) table. Initialized elsewhere in the class and used here to execute the SQL query. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatCommonDBInterface.setValue` | — | — | Appends a bind variable value to the parameter list via `setValue()` on the `paramList` object. Seven calls for the seven date bind parameters. |
| R | `db_KK_T_IDO_RSV.selectBySqlDefine` | — | `KK_T_IDO_RSV` | Executes the SQL SELECT query with SQL key `KK_SELECT_030` against the Reservation/Movement Reservation table. Populates the result set in the access object for the caller to retrieve via `selectNext()`. |

### Detailed analysis:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `db_KK_T_IDO_RSV.selectBySqlDefine(paramList, KK_SELECT_030)` | — | `KK_T_IDO_RSV` | Executes a database SELECT query against the `KK_T_IDO_RSV` table (Reservation/Movement Reservation table) using the SQL key `KK_SELECT_030`. The seven date bind variables restrict the query to reservation records whose application date columns match the operating date. This is a Read (R) operation — it retrieves data without modifying the database. |

## 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` [R] `KK_T_IDO_RSV`

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

**Call Chain Details:**
- **`JBSbatKKCourseChgFixTgCst.execute()`** (Batch entry point): This is the main batch processing entry method in the same class. Within the execution flow, it builds a 7-element string array (`whereKkTIdoRsvParam_030`) where every element is set to `this.opeDate` (the operating date of the batch run), then calls `executeKK_T_IDO_RSV_KK_SELECT_030()` to perform the disputed reservation search (異動予約検索). After the call, the caller retrieves results via `db_KK_T_IDO_RSV.selectNext()` and iterates over them in a `while` loop.

## 6. Per-Branch Detail Blocks

> This method has no conditional branches. It follows a single linear execution path.

**Block 1** — PROCESS `(no condition)` (L837)

> Creates a new `JBSbatCommonDBInterface` instance to hold the bind variable values for the SQL query.

| # | Type | Code |
|---|------|------|
| 1 | SET | `JBSbatCommonDBInterface paramList = new JBSbatCommonDBInterface();` // Bind variable list creation (バインド変数のリストを生成します) |

**Block 2** — PROCESS `(no condition)` (L838–L844)

> Converts each of the seven elements in the `param` array to `String` and appends them to the parameter list. All seven values represent the Reservation Application Date (予約適用年月日).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramList.setValue(param[0].toString());` // Set bind var 0: Reservation Application Date (予約適用年月日) |
| 2 | EXEC | `paramList.setValue(param[1].toString());` // Set bind var 1: Reservation Application Date (予約適用年月日) |
| 3 | EXEC | `paramList.setValue(param[2].toString());` // Set bind var 2: Reservation Application Date (予約適用年月日) |
| 4 | EXEC | `paramList.setValue(param[3].toString());` // Set bind var 3: Reservation Application Date (予約適用年月日) |
| 5 | EXEC | `paramList.setValue(param[4].toString());` // Set bind var 4: Reservation Application Date (予約適用年月日) |
| 6 | EXEC | `paramList.setValue(param[5].toString());` // Set bind var 5: Reservation Application Date (予約適用年月日) |
| 7 | EXEC | `paramList.setValue(param[6].toString());` // Set bind var 6: Reservation Application Date (予約適用年月日) |

**Block 3** — CALL `(no condition)` (L847)

> Executes the SQL SELECT query against the `KK_T_IDO_RSV` table using the SQL key `KK_SELECT_030`. The caller will subsequently retrieve results via `selectNext()`.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `db_KK_T_IDO_RSV.selectBySqlDefine(paramList, KK_T_IDO_RSV_KK_SELECT_030);` // Execute DB access (DBアクセスを実行します) |
| 2 | RETURN | *(void return — method end)* |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `KK_T_IDO_RSV` | Table | Reservation/Movement Reservation table — stores records of service reservation and movement operations in the batch processing system. The `KK_` prefix indicates a core batch table. |
| `KK_SELECT_030` | SQL Key | Predefined SQL SELECT query key that maps to a specific SQL statement for querying the `KK_T_IDO_RSV` table. Used to search for reservation records by application date. |
| `RSV_APLY_YMD` | Field | Reservation Application Date — the date from which a reservation becomes effective. This is the primary search column for `KK_SELECT_030`. |
| `IDO_RSV_NO` | Field | Reservation/Movement Reservation Number — the unique identifier for a reservation/movement record. |
| `IDO_DIV` | Field | Movement Reservation Division — a classification code indicating the type/category of the reservation/movement operation. |
| `IDO_RSV_DTL_CD` | Field | Movement Reservation Detail Code — a code specifying the detail type of the reservation/movement. |
| `IDO_RSV_HANEI_YMD` | Field | Movement Reservation Return/Reversal Date — the date when a reservation/movement was reversed or returned. |
| `IDO_RSV_CL_YMD` | Field | Movement Reservation Cancellation Date — the date when a reservation/movement was cancelled. |
| `IDO_RSV_STAT_CD` | Field | Movement Reservation Status Code — the current status of the reservation/movement record. |
| `MSKM_DTL_NO` | Field | Application Detail Number — the detail line number associated with the reservation application. |
| `SVC_KEI_NO` | Field | Service Contract Number — the unique identifier for a service contract. |
| `SVC_KEI_UCWK_NO` | Field | Service Contract Internal Detail Number — an internal tracking number for service contract details. |
| `opeDate` | Field | Operating Date — the batch processing execution date. This is the value passed as all seven bind parameters to the method. |
| `JBSbatCommonDBInterface` | Class | Database interface common class — a generic container for SQL bind variables, used to pass parameter values to the `selectBySqlDefine()` method. |
| `JBSbatSQLAccess` | Class | SQL access framework class — the data access layer abstraction used to execute SQL queries against the database. |
| `setValue()` | Method | Appends a value to the bind variable list in a `JBSbatCommonDBInterface` instance. Called once per bind parameter. |
| `selectBySqlDefine()` | Method | Executes a pre-defined SQL query (identified by SQL key) against the database, using the bind variables from the provided parameter list. |
| `selectNext()` | Method | Retrieves the next row from the result set populated by `selectBySqlDefine()`. Called by the caller after this method returns. |
| 異動予約 (Ido Yoyaku) | Japanese term | Movement Reservation — a reservation record representing a service change, transfer, or movement operation that has been requested but may need processing or reversal. |
| 予約適用年月日 (Yoyaku Tekiyo Nengetsuhi) | Japanese term | Reservation Application Date — the date from which a reservation's effects take effect. |
| バインド変数 (Baindo Hen-su) | Japanese term | Bind Variable — a placeholder value in a SQL query that is substituted at execution time. |
| DBアクセス (DB Akusesu) | Japanese term | DB Access — the database access operation (SQL execution). |
