# Business Logic — JBSbatTUBmpSwchSodTrn.executeKK_T_SVKEIUW_EOH_TEL_TU_SELECT_001() [10 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatTUBmpSwchSodTrn` |
| Layer | Service (Batch service — part of the phone number change SOD automation module) |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatTUBmpSwchSodTrn.executeKK_T_SVKEIUW_EOH_TEL_TU_SELECT_001()

This method performs a **database read operation to retrieve the telephone number** associated with a service contract detail record in the **KK_T_SVKEIUW_EOH_TEL** table (Service Contract Details — eo Light Phone). It is a private utility method used exclusively within the **phone number change Service Order Data (SOD) automation** processing pipeline. Specifically, it is called during the dual-direction phone number change flow (ANK-4494-00-00), where the batch needs to look up the telephone number from an existing service contract detail before processing a phone number change request. The method follows a standard SQL access pattern: it accepts an array of bind variable values, constructs a `JBSbatCommonDBInterface` result carrier, populates it with the bind parameters, and then delegates the actual SQL execution to `JBSbatSQLAccess.selectBySqlDefine` using the SQL key `TU_SELECT_001`. This method implements the **delegation design pattern**, wrapping a raw database query behind a named business method with typed parameters.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeKK_T_SVKEIUW_EOH_TEL_TU_SELECT_001 param"])
    STEP1["Generate bind variable list: JBSbatCommonDBInterface paramList"]
    STEP2["Set param[0] value: param[0].toString()"]
    STEP3["Set param[1] value: param[1].toString()"]
    STEP4["DB Access: db_KK_T_SVKEIUW_EOH_TEL.selectBySqlDefine with SQL key TU_SELECT_001"]
    END_NODE(["Return / Next"])

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

The method follows a linear, straightforward processing pattern with no conditional branches or loops:

1. **Bind Variable List Generation** — A new `JBSbatCommonDBInterface` object is instantiated to serve as the bind variable carrier for the SQL query parameters.
2. **Bind Parameter Assignment** — The first two elements of the incoming `param` array are converted to strings and set as values in the bind variable list using `setValue()`. Both `param[0]` and `param[1]` are assigned, which correspond to the **service contract detail number** (SVC_KEI_UCWK_NO) used as a bind variable for the SQL query.
3. **Database Access** — The `selectBySqlDefine` method on the `db_KK_T_SVKEIUW_EOH_TEL` accessor is invoked with the populated bind variable list and the SQL key `TU_SELECT_001`, executing a SELECT query against the `KK_T_SVKEIUW_EOH_TEL` table.

**CRITICAL — Constant Resolution:**
- `KK_T_SVKEIUW_EOH_TEL_TU_SELECT_001 = "TU_SELECT_001"` — The SQL definition key used to identify the pre-defined SELECT query. This key maps to a SQL template that selects the telephone number from the service contract details (eo light phone) table.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `Object[]` | Array of bind variable values for the SQL SELECT query. The array must contain at least 2 elements: `param[0]` is the service contract detail number (used as the primary search key), and `param[1]` is the service contract detail number again (used as a secondary bind variable for the query). The caller populates both positions with the same value — the `SVC_KEI_UCWK_NO` (service contract detail number) extracted from the input map during the phone number change processing flow. |

**Instance fields / external state read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `db_KK_T_SVKEIUW_EOH_TEL` | `JBSbatSQLAccess` | Database access accessor for the `KK_T_SVKEIUW_EOH_TEL` table (Service Contract Details — eo Light Phone). Initialized in the parent class setup with the table name constant `D_TBL_NAME_KK_T_SVKEIUW_EOH_TEL = "KK_T_SVKEIUW_EOH_TEL"`. |

## 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_SVKEIUW_EOH_TEL.selectBySqlDefine` | (Framework SQL Access) | `KK_T_SVKEIUW_EOH_TEL` | Executes a SQL SELECT query using the `TU_SELECT_001` SQL definition key to retrieve service contract detail records (eo light phone) matching the bind variable (service contract detail number). |
| - | `JBSbatCommonDBInterface.setValue` | JDKStructuredMap | - | Sets bind variable values into the parameter list carrier. Called twice — once for `param[0]` and once for `param[1]`, both containing the service contract detail number. |

**Classification rationale:**
- `selectBySqlDefine` is a **Read (R)** operation — it executes a SELECT query via the `JBSbatSQLAccess` framework layer to query the `KK_T_SVKEIUW_EOH_TEL` table.
- `setValue` calls are **internal setup (no CRUD)** — they populate the bind variable carrier but do not perform any database operation.

## 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_SVKEIUW_EOH_TEL`

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

**Caller context:** The `execute()` method in the same class (`JBSbatTUBmpSwchSodTrn`) calls this method during the **phone number change SOD automation** processing flow (specifically added in ANK-4494-00-00 for dual-direction phone number support). The caller prepares the bind parameters by extracting `SVC_KEI_UCWK_NO` from the input map (`inMap`) and passes them as a two-element array. After the select returns, the caller retrieves the `telno` (telephone number) from the result via `db_KK_T_SVKEIUW_EOH_TEL.selectNext()`.

## 6. Per-Branch Detail Blocks

**Block 1** — PROCESSING `(bind variable list generation)` (L645)

> Creates a new `JBSbatCommonDBInterface` object to serve as the bind variable carrier for the SQL query parameters.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramList = new JBSbatCommonDBInterface();` // Generate bind variable list — creates a new parameter carrier object [JBSbatCommonDBInterface] |

**Block 2** — EXEC `(set first bind variable)` (L646)

> Assigns the first element of the incoming param array as a string value into the bind variable list. The caller populates `param[0]` with the service contract detail number (`SVC_KEI_UCWK_NO`).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramList.setValue(param[0].toString());` // Set param[0] as bind variable — service contract detail number |

**Block 3** — EXEC `(set second bind variable)` (L647)

> Assigns the second element of the incoming param array as a string value into the bind variable list. The caller populates `param[1]` with the same service contract detail number (`SVC_KEI_UCWK_NO`).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramList.setValue(param[1].toString());` // Set param[1] as bind variable — service contract detail number |

**Block 4** — CALL `(database SELECT query)` (L651)

> Executes a SQL SELECT query against the `KK_T_SVKEIUW_EOH_TEL` table using the SQL definition key `TU_SELECT_001`. The bind variable list `paramList` (containing the service contract detail number in both parameter slots) is passed as the first argument, and the static SQL key constant `KK_T_SVKEIUW_EOH_TEL_TU_SELECT_001 = "TU_SELECT_001"` is passed as the second argument. The result is stored back into the `db_KK_T_SVKEIUW_EOH_TEL` accessor, from which the caller can retrieve the telephone number.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `db_KK_T_SVKEIUW_EOH_TEL.selectBySqlDefine(paramList, KK_T_SVKEIUW_EOH_TEL_TU_SELECT_001)` // Execute SELECT query [R] KK_T_SVKEIUW_EOH_TEL |
| | | `[-> KK_T_SVKEIUW_EOH_TEL_TU_SELECT_001 = "TU_SELECT_001"]` // SQL definition key |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `SVC_KEI_UCWK_NO` | Field | Service contract detail number — internal tracking ID for a specific line item within a service contract. Used as the primary key to identify and retrieve a particular service contract detail record. |
| `KK_T_SVKEIUW_EOH_TEL` | Entity/DB | Service Contract Details — eo Light Phone table — stores service contract detail records specifically for the "eo Light Phone" service product line. |
| `TU_SELECT_001` | Constant | SQL definition key — the identifier for a pre-defined SQL SELECT query template that retrieves service contract detail records (eo light phone) by their service contract detail number. |
| `JBSbatCommonDBInterface` | Class | Database bind variable interface — a framework class used to carry bind variable values to/from SQL queries. Used as a parameter carrier for both input parameters (bind variables) and output results (query results). |
| `JBSbatSQLAccess` | Class | SQL access framework class — provides database query execution methods (`selectBySqlDefine`, `selectNext`, `close`) for a specific table. Initialized with a table name constant and used to perform CRUD operations. |
| SOD | Acronym | Service Order Data — telecom order fulfillment records. In this system, SOD data relates to service ordering, changes, and cancellations. |
| Phone Number Change | Business term | Phone number change process (番ポ切替) — a batch process that automates the handling of service order data when a customer changes their phone number (number portability or reassignment). |
| ANK-4494-00-00 | Change ticket | Dual-direction phone number support enhancement — a change ticket that added support for dual-direction phone number changes, including the retrieval of telephone numbers from service contract details. |
| `param[0]`, `param[1]` | Parameter | Bind variable positions — both contain the service contract detail number. In the SQL query, these serve as bind variables for filtering the service contract detail records. |
| eo Light Phone (eo光電話) | Business term | A light telephone service product line offered under the "eo" brand. Service contract details for this product are stored in the `KK_T_SVKEIUW_EOH_TEL` table. |
| `execute()` | Method | Batch entry point method in `JBSbatTUBmpSwchSodTrn` — the main processing method that orchestrates the phone number change SOD automation, including calling `executeKK_T_SVKEIUW_EOH_TEL_TU_SELECT_001` for telephone number lookup. |
