# Business Logic — JBSbatKKAdChgPlaceNoChgRnki.executeKK_T_ADCHG_DTL_KK_SELECT_023() [9 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKAdChgPlaceNoChgRnki` |
| Layer | Service (Batch Service — `eo.business.service`) |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKAdChgPlaceNoChgRnki.executeKK_T_ADCHG_DTL_KK_SELECT_023()

This method is a private data-access helper that executes a database SELECT query against the **Address Change Details table** (`KK_T_ADCHG_DTL`) using a predefined SQL definition key (`KK_SELECT_023`). Its business purpose is to retrieve address change detail records identified by an **Address Change Number** (`ADCHG_NO`) passed as a bound variable. The method follows a simple delegation pattern: it receives a parameter array from the caller, wraps the relevant bound variable value into a `JBSbatCommonDBInterface` container, and delegates the SQL execution to the `JBSbatSQLAccess` instance (`db_KK_T_ADCHG_DTL`) configured for this table. It does not implement conditional branches, CRUD branching, or complex business logic — its role is purely to encapsulate a single database read operation within the batch service, ensuring callers do not need to construct DB interface objects or manage SQL key literals directly. This method is called exclusively by `getBfSvcKeiNo()` to resolve the **pre-change service contract number** (`CHBF_SKBT_NO`) during the address change processing workflow, where the system needs to trace the history of a service contract that has undergone address reassignment.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeKK_T_ADCHG_DTL_KK_SELECT_023(param)"])
    STEP1["Create JBSbatCommonDBInterface paramList"]
    STEP2["Set param[0].toString() into paramList via setValue"]
    STEP3["Execute DB select: db_KK_T_ADCHG_DTL.selectBySqlDefine(paramList, KK_SELECT_023)"]
    END(["Return / Next"])

    START --> STEP1 --> STEP2 --> STEP3 --> END
```

**Comments:**
- **Step 1**: A new `JBSbatCommonDBInterface` list object is instantiated to hold bind variables for the SQL query.
- **Step 2**: The first element of the incoming `param` array (`param[0]`) is converted to a String and stored into `paramList` via the `setValue()` method. This binds the **Address Change Number** to the query.
- **Step 3**: The pre-configured SQL access instance `db_KK_T_ADCHG_DTL` executes the `selectBySqlDefine()` method, passing the bind variable list and the SQL definition key `KK_SELECT_023`. This triggers the actual database SELECT against table `KK_T_ADCHG_DTL`.
- The method returns `void` — results are consumed by the caller (`getBfSvcKeiNo()`) via `db_KK_T_ADCHG_DTL.selectNext()` on the subsequent line.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `Object[]` | Array of bind variable values for the SQL query. `param[0]` contains the **Address Change Number** (`ADCHG_NO`) used to look up address change detail records. Per the Javadoc, the array is also expected to carry the **Service Contract Number** at index 1 in some call patterns, though the implementation only reads `param[0]`. |

**External state read by this method:**
| Field | Type | Business Description |
|-------|------|---------------------|
| `db_KK_T_ADCHG_DTL` | `JBSbatSQLAccess` | Pre-initialized SQL access instance connected to the `KK_T_ADCHG_DTL` table. Provides `selectBySqlDefine()` for executing parameterized SELECT queries. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatCommonDBInterface.setValue` | — | — | Sets the Address Change Number bind variable into the parameter list for the SQL query. |
| R | `db_KK_T_ADCHG_DTL.selectBySqlDefine` | — | `KK_T_ADCHG_DTL` (住所変更明細 — Address Change Details) | Executes the `KK_SELECT_023` SQL definition to SELECT address change detail records from the table, using the bound Address Change Number as the filter criterion. |

## 5. Dependency Trace

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

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

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKAdChgPlaceNoChgRnki | `JBSbatKKAdChgPlaceNoChgRnki.execute()` → `getBfSvcKeiNo(svcKeiNo)` → `executeKK_T_ADCHG_DTL_KK_SELECT_023(new String[]{svcKeiNo})` | `selectBySqlDefine [R] KK_T_ADCHG_DTL` |

**Details:**
- The caller `getBfSvcKeiNo(String svcKeiNo)` receives a service contract number (`SVC_KEI_NO`) from the main `execute()` batch processing loop, then invokes this method to query the address change details table.
- The `execute()` method processes records from intermediate files (宅内機器型式コード — indoor equipment model code, 機器製造番号 — equipment serial number, etc.) and for each record, calls `getBfSvcKeiNo()` to resolve the pre-change service contract number.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(bind variable list creation)` (L417)

> Creates a `JBSbatCommonDBInterface` instance to hold the bind variables for the SQL query. The Javadoc comment says "バインド変数のリストを生成します" (Generate the bind variable list).

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

**Block 2** — [EXEC] `(bind variable assignment)` (L418)

> Converts the first element of the `param` array to String and sets it as the bound variable value in the parameter list. This is the Address Change Number that will filter the SQL SELECT.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramList.setValue(param[0].toString());` // Store param[0] (Address Change Number) as bind variable [-> ADCHG_NO] |

**Block 3** — [CALL] `(DB access execution)` (L421)

> Executes the SQL SELECT query against the Address Change Details table. The Javadoc comment says "DBアクセスを実行します" (Execute DB access). The `KK_SELECT_023` SQL key maps to a pre-defined SQL statement that selects from `KK_T_ADCHG_DTL`.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `db_KK_T_ADCHG_DTL.selectBySqlDefine(paramList, KK_T_ADCHG_DTL_KK_SELECT_023);` // Execute SELECT on KK_T_ADCHG_DTL using SQL key KK_SELECT_023 [-> SQL_KEY="KK_SELECT_023"] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `ADCHG_NO` | Field | Address Change Number (住所変更番号) — unique identifier for an address change record in the `KK_T_ADCHG_DTL` table |
| `ADCHG_DTL_NO` | Field | Address Change Detail Number (住所変更明細番号) — unique identifier for a specific detail line within an address change |
| `CHBF_SKBT_NO` | Field | Pre-Change Identification Number (変更前識別番号) — the service contract number before address reassignment |
| `SVC_KEI_NO` | Field | Service Contract Number (サービス契約番号) — the identifier for a service contract line item |
| `KK_T_ADCHG_DTL` | Entity | Address Change Details Table (住所変更明細) — core table storing address change detail records for K-Opticom's telecom service management |
| `KK_SELECT_023` | Constant | SQL Definition Key — predefined SELECT statement identifier for querying the address change details table |
| `JBSbatCommonDBInterface` | Type | Database bind variable interface — a list-like container used to hold SQL bind parameter values before passing them to `selectBySqlDefine()` |
| `JBSbatSQLAccess` | Type | SQL access class — provides `selectBySqlDefine()`, `selectNext()` and other DB operations for querying the address change details table |
| `JBSbatKKAdChgPlaceNoChgRnki` | Class | Address Change Place No Change Number Batch Service — a batch service that processes address change records where the service contract number remains unchanged despite address modification |
| `paramList` | Variable | Local bind variable list — holds the Address Change Number value passed to the SQL query |
| `K-Opticom` | Business term | Japanese telecommunications provider; the domain context for all entities in this codebase |
