# Business Logic — JBSbatKKNrkeFinKikiHktgi.executeKK_T_KKTK_SVC_KEI_KK_SELECT_280() [19 LOC]

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

## 1. Role

### JBSbatKKNrkeFinKikiHktgi.executeKK_T_KKTK_SVC_KEI_KK_SELECT_280()

This method serves as a **database read gateway** for the **device migration service contract** workflow within the K-Optical batch processing system. Specifically, it queries the `KK_T_KKTK_SVC_KEI` table (Equipment-Provided Service Contract table) to retrieve the current service contract record for a **transfer destination** (migrating-to) service contract line item — used when a customer migrates their service from an old equipment configuration to a new one (the "nrke" / 乗換 migration process).

The method operates as a **SQL parameter binding and delegation pattern**: it assembles a list of 12 bound variables (binding variables / バインド変数) — including the transfer destination service contract number, batch operation date, and various dummy equipment identifiers — then delegates the actual SQL execution to the `JBSbatSQLAccess.selectBySqlDefine()` method using the pre-defined SQL key `KK_SELECT_280`.

It is a **private helper method** called by the main `execute()` batch processing method, which iterates over service contract migration records. This method is one of two parallel SELECT queries executed per migration record (the other being `executeKK_T_SVC_KEI_KK_SELECT_386`, which queries the main service contract table `KK_T_SVC_KEI`).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeKK_T_KKTK_SVC_KEI_KK_SELECT_280 params"])
    CREATE_PARAM["Create JBSbatCommonDBInterface paramList"]
    SET_PARAM_1["paramList.setValue(nrkeSakiSvcKeiNo)
Transfer Dest. Service Contract No."]
    SET_PARAM_2["paramList.setValue(opeDate)
Batch Operation Date"]
    SET_PARAM_3["paramList.setValue(opeDate)
Batch Operation Date"]
    SET_PARAM_4["paramList.setValue(opeDate)
Batch Operation Date"]
    SET_PARAM_5["paramList.setValue(onuDummyKiki)
ONU Dummy Device"]
    SET_PARAM_6["paramList.setValue(tknrtDummyKiki)
TKNRT Dummy Device"]
    SET_PARAM_7["paramList.setValue(hgwDummyKiki)
HGW Dummy Device"]
    SET_PARAM_8["paramList.setValue(nrkeSakiSvcKeiNo)
Transfer Dest. Service Contract No."]
    SET_PARAM_9["paramList.setValue(opeDate)
Batch Operation Date"]
    SET_PARAM_10["paramList.setValue(meshDummyKiki)
Mesh Wi-Fi Dummy Device"]
    SET_PARAM_11["paramList.setValue(mlanDummyKiki)
Wireless LAN Relay Dummy Device"]
    DB_SELECT["db_KK_T_KKTK_SVC_KEI_SAKI.selectBySqlDefine
paramList, KK_SELECT_280"]
    END_NODE(["Return void"])

    START --> CREATE_PARAM
    CREATE_PARAM --> SET_PARAM_1
    SET_PARAM_1 --> SET_PARAM_2
    SET_PARAM_2 --> SET_PARAM_3
    SET_PARAM_3 --> SET_PARAM_4
    SET_PARAM_4 --> SET_PARAM_5
    SET_PARAM_5 --> SET_PARAM_6
    SET_PARAM_6 --> SET_PARAM_7
    SET_PARAM_7 --> SET_PARAM_8
    SET_PARAM_8 --> SET_PARAM_9
    SET_PARAM_9 --> SET_PARAM_10
    SET_PARAM_10 --> SET_PARAM_11
    SET_PARAM_11 --> DB_SELECT
    DB_SELECT --> END_NODE
```

**Processing Summary:**

The method follows a strict linear sequential flow with no conditional branches:

1. **Create parameter list** — Instantiates a new `JBSbatCommonDBInterface` object (`paramList`), which acts as a bind-variable list for SQL execution.
2. **Bind 12 variables** — Sequentially adds 12 bound variable values to the parameter list in a specific order matching the SQL query's placeholder positions.
3. **Execute SQL SELECT** — Calls `db_KK_T_KKTK_SVC_KEI_SAKI.selectBySqlDefine()` with the populated parameter list and the SQL key `"KK_SELECT_280"`, which triggers a database SELECT query against the `KK_T_KKTK_SVC_KEI` table.
4. **Return** — The method returns `void`; results are left in the SQL access object for the caller to fetch via `selectNext()`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `nrkeSakiSvcKeiNo` | `String` | Transfer destination service contract number — the service contract line item number for the new (migrating-to) service configuration. Used as both the primary filter condition and bound to the SQL query twice (first and eighth positions). |
| 2 | `onuDummyKiki` | `String` | ONU (Optical Network Unit) dummy device code — the dummy/placeholder equipment code used in batch testing when actual ONU device information is not available. |
| 3 | `tknrtDummyKiki` | `String` | TKNRT (multi-function router) dummy device code — the dummy/placeholder multi-function router equipment code used during batch processing. |
| 4 | `hgwDummyKiki` | `String` | HGW (Home Gateway) dummy device code — the dummy/placeholder home gateway equipment code used during batch processing. |
| 5 | `meshDummyKiki` | `String` | Mesh Wi-Fi dummy device code — the dummy/placeholder mesh Wi-Fi router equipment code used during batch processing. |
| 6 | `mlanDummyKiki` | `String` | Wireless LAN relay device (mid中继) dummy code — the dummy/placeholder wireless LAN repeater/relay equipment code used during batch processing. |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `this.opeDate` | `String` | Batch operation date — the processing date for the batch job, inherited from `JBSbatBusinessService`. Set during initialization from `commonItem.getOpeDate()`. |

**External state used:**

| Field | Type | Description |
|-------|------|-------------|
| `db_KK_T_KKTK_SVC_KEI_SAKI` | `JBSbatSQLAccess` | SQL access object instance configured to query the `KK_T_KKTK_SVC_KEI` (Equipment-Provided Service Contract) table. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatSQLAccess.selectBySqlDefine` | - | `KK_T_KKTK_SVC_KEI` | Executes a SELECT query via SQL key `KK_SELECT_280` on the Equipment-Provided Service Contract table to retrieve the transfer destination service contract record. |
| - | `JDKStructuredMap.setValue` (via JBSbatCommonDBInterface) | - | - | Binds parameter values to the SQL query's bind variable positions (12 sequential inserts). |

**Classification reasoning:**

- **R (Read):** `selectBySqlDefine()` performs a database SELECT operation. The SQL key `KK_SELECT_280` maps to a pre-defined SQL statement targeting `KK_T_KKTK_SVC_KEI`. No data is modified — this is a pure read operation.

### Table / Entity Details:

| Entity / DB Table | Description |
|-------------------|-------------|
| `KK_T_KKTK_SVC_KEI` | Equipment-Provided Service Contract table — stores records of service contracts associated with equipment-provided (customer-supplied via the ISP) service lines, including transfer/migration destination contract information. |

### SQL Key Details:

| SQL Key | Description |
|---------|-------------|
| `KK_SELECT_280` | Pre-defined SQL SELECT statement that queries `KK_T_KKTK_SVC_KEI` using the 12 bind variables (service contract number, batch operation date, and dummy equipment codes). The SQL key is stored as the constant `KK_T_KKTK_SVC_KEI_KK_SELECT_280 = "KK_SELECT_280"` at line 132 of the source file. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKNrkeFinKikiHktgi.execute()` | `execute()` -> `executeKK_T_KKTK_SVC_KEI_KK_SELECT_280(nrkeSakiSvcKeiNo, onuDummyKiki, tknrtDummyKiki, hgwDummyKiki, meshDummyKiki, mlanDummyKiki)` | `selectBySqlDefine [R] KK_T_KKTK_SVC_KEI` |

**Call Chain Details:**

The `executeKK_T_KKTK_SVC_KEI_KK_SELECT_280()` method is called from the batch class's own `execute()` method (same class, line 639) during the main service contract migration processing loop. The caller passes the transfer destination service contract number (`sakiSvcKeiNo`) along with dummy device codes looked up from the work parameter management table (`ZM_M_WORK_PARAM_KNRI`) via `humeiModelCdMap`.

**Terminal operations reached from this method:**

The method ultimately reaches one terminal database operation:
- `db_KK_T_KKTK_SVC_KEI_SAKI.selectBySqlDefine` → performs **R (Read)** on table **`KK_T_KKTK_SVC_KEI`** using SQL key **`KK_SELECT_280`**.

## 6. Per-Branch Detail Blocks

This method contains **no conditional branches** (no if/else, switch, loops, or try/catch). It is a purely linear execution. Below is the single processing block:

**Block 1** — [TOP-LEVEL SEQUENCE] `(no condition)` (L1619-L1637)

> This is the sole processing block. It creates a parameter list, binds 12 values, and executes a database SELECT query.

| # | Type | Code | Description |
|---|------|------|-------------|
| 1 | EXEC | `JBSbatCommonDBInterface paramList = new JBSbatCommonDBInterface()` | Create bind-variable list for SQL execution (バインド変数のリストを生成します / Generate bind variable list) |
| 2 | SET | `paramList.setValue(nrkeSakiSvcKeiNo)` | Bind position 0: Transfer destination service contract number (乗換先サービス契約番号) |
| 3 | SET | `paramList.setValue(this.opeDate)` | Bind position 1: Batch operation date (バッチ運用日付) |
| 4 | SET | `paramList.setValue(this.opeDate)` | Bind position 2: Batch operation date (バッチ運用日付) |
| 5 | SET | `paramList.setValue(this.opeDate)` | Bind position 3: Batch operation date (バッチ運用日付) |
| 6 | SET | `paramList.setValue(onuDummyKiki)` | Bind position 4: ONU dummy device (ONUダミー機器) |
| 7 | SET | `paramList.setValue(tknrtDummyKiki)` | Bind position 5: TKNRT dummy device (多機能ルーターダミー機器) |
| 8 | SET | `paramList.setValue(hgwDummyKiki)` | Bind position 6: HGW dummy device (HGWDummy device) |
| 9 | SET | `paramList.setValue(nrkeSakiSvcKeiNo)` | Bind position 7: Transfer destination service contract number (乗換先サービス契約番号) |
| 10 | SET | `paramList.setValue(this.opeDate)` | Bind position 8: Batch operation date (バッチ運用日付) |
| 11 | SET | `paramList.setValue(meshDummyKiki)` | Bind position 9: Mesh Wi-Fi dummy device (メッシュWi-Fiダミー機器) |
| 12 | SET | `paramList.setValue(mlanDummyKiki)` | Bind position 10: Wireless LAN relay dummy device (無線LAN中継機ダミー機器) |
| 13 | CALL | `db_KK_T_KKTK_SVC_KEI_SAKI.selectBySqlDefine(paramList, KK_T_KKTK_SVC_KEI_KK_SELECT_280)` | Execute SQL SELECT via SQL key `KK_SELECT_280` (SQLKEY(KK_SELECT_280)でDBアクセスを行います / Access DB with SQLKEY KK_SELECT_280). DB access is executed (DBアクセスを実行します). |

**Note on bind variable ordering:** The 12 bound variables follow the order specified in the Javadoc comment (lines 1620-1622). The batch operation date (`opeDate`) is bound at positions 1, 2, 3, and 8 — suggesting the SQL query uses the operation date in multiple WHERE conditions or JOIN clauses. The transfer destination service contract number (`nrkeSakiSvcKeiNo`) is bound at positions 0 and 7 — used as both the primary key filter and possibly in a secondary filter or JOIN condition.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `nrkeSakiSvcKeiNo` | Field | Transfer destination service contract number — the service contract line item number for the new (migrating-to) service configuration after equipment migration. |
| `onuDummyKiki` | Field | ONU (Optical Network Unit) dummy device code — placeholder equipment identifier used when actual ONU device info is unavailable during batch processing. |
| `tknrtDummyKiki` | Field | TKNRT (multi-function router) dummy device code — placeholder identifier for a multi-function router device. |
| `hgwDummyKiki` | Field | HGW (Home Gateway) dummy device code — placeholder identifier for a home gateway device. |
| `meshDummyKiki` | Field | Mesh Wi-Fi dummy device code — placeholder identifier for a mesh Wi-Fi router. |
| `mlanDummyKiki` | Field | Wireless LAN relay (repeater) dummy device code — placeholder identifier for a wireless LAN repeater device. |
| `opeDate` | Field | Batch operation date — the processing date set for the batch job execution, inherited from `JBSbatBusinessService`. |
| `paramList` | Field | Bind-variable parameter list — a `JBSbatCommonDBInterface` object holding values to be bound to SQL query placeholders. |
| `KK_T_KKTK_SVC_KEI` | Table | Equipment-Provided Service Contract table — stores service contract records associated with equipment-provided service lines. |
| `KK_SELECT_280` | SQL Key | Pre-defined SQL SELECT statement for querying `KK_T_KKTK_SVC_KEI` with 12 bind variables for transfer destination service contract lookups. |
| `db_KK_T_KKTK_SVC_KEI_SAKI` | Field | SQL access object instance configured for the `KK_T_KKTK_SVC_KEI` table, used for SAKE (destination / 先 side) queries in migration processing. |
| バインド変数 | Term | Bind variable — a placeholder value in a SQL query that is filled at execution time. |
| 乗換先 | Term | Transfer destination — the new service configuration after a customer's equipment migration. |
| 業務パラメータ管理 | Term | Business parameter management — the system that stores operational parameters, accessed via `ZM_M_WORK_PARAM_KNRI`. |
| 不明機器 | Term | Unknown/unidentified device — refers to dummy device codes used when the actual device type is not determinable. |
| ONU | Acronym | Optical Network Unit — optical telecommunications device that terminates optical fiber lines and delivers data. |
| TKNRT | Acronym | Multi-function router device type (Japanese abbreviation). |
| HGW | Acronym | Home Gateway — a residential gateway device combining router, modem, and Wi-Fi functions. |
| SQLKEY | Acronym | SQL Key — a pre-defined named SQL statement stored in the SQL definition file, referenced by a constant string at runtime. |
