# Business Logic — JBSbatTUBmpSwchSodTrn.executeTU_T_BMP_KOJI_TU_SELECT_006() [13 LOC]

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

## 1. Role

### JBSbatTUBmpSwchSodTrn.executeTU_T_BMP_KOJI_TU_SELECT_006()

This method serves as a **database retrieval entry point** within the **Hanko (番ポ) Swap Service Order automatic processing** subsystem. Hanko swap is a telecom operations process where a customer's phone number (番ポ = 電話番号切り替え, "phone number porting/change") is reassigned from one service contract to another — typically during a service provider migration or plan change at K-Opticom.

Specifically, `executeTU_T_BMP_KOJI_TU_SELECT_006` executes a SQL SELECT query (identified by SQLKEY `TU_SELECT_006`) against the **TU_T_BMP_KOJI** (番ポ工事 table) to retrieve construction order and reservation application data associated with a Hanko swap work order. It acts as a **routing/dispatch data accessor** within the batch service: the method receives five pre-assembled binding variables as an `Object[]` parameter, wraps them into a structured `JBSbatCommonDBInterface` container, and delegates the actual database query to the `db_TU_T_BMP_KOJI` SQL access instance.

This method has **no conditional branches** — it performs a deterministic read operation each time it is invoked. It is a **shared internal utility** called by the batch orchestrator (`execute()`) as part of a larger batch workflow that processes Hanko swap service orders. The returned data from this SELECT is consumed downstream by the calling batch flow to make further processing decisions (e.g., applying service contract reservations, creating order details, or updating construction records).

**Design pattern:** Repository/Data Accessor — this method abstracts the database interaction behind a simple interface, allowing the batch orchestrator to remain decoupled from SQL details. The SQL query is defined externally via the string key `TU_SELECT_006`.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeTU_T_BMP_KOJI_TU_SELECT_006(Object[] param)"])
    C1["Create JBSbatCommonDBInterface paramList"]
    C2["Set paramList from param[0] through param[4]"]
    C3["Call db_TU_T_BMP_KOJI.selectBySqlDefine(paramList, TU_SELECT_006)"]
    END(["Return void"])
    START --> C1 --> C2 --> C3 --> END
```

**Processing Flow:**

1. **Create binding variable list** — Instantiate `JBSbatCommonDBInterface` (the framework's parameter list container for prepared SQL statements).
2. **Set binding values (5 elements)** — Extract each element from the `param` array via `.toString()` and append it sequentially to the `paramList`. The five values correspond to Hanko construction finalization date/time and service contract reservation application dates, in order.
3. **Execute DB access** — Call `db_TU_T_BMP_KOJI.selectBySqlDefine(paramList, TU_SELECT_006)` to perform the SQL SELECT query. The `TU_SELECT_006` SQL key references a pre-defined SQL query stored in the framework's SQL definition registry.

There are **no conditional branches**, loops, or error-handling blocks within this method. It is a straight-line data accessor.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `Object[]` | An array of 5 binding variable values passed in strict positional order. These values serve as WHERE clause parameters for the SQL SELECT query against the TU_T_BMP_KOJI table. Each element is converted to a string via `toString()`. The five values are: `param[0]` = Hanko construction finalization date/time, `param[1]` = Service contract breakdown reservation application date, `param[2]` = Service contract reservation application date, `param[3]` = Service contract reservation application date, `param[4]` = Hanko construction finalization date/time. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `db_TU_T_BMP_KOJI` | `JBSbatSQLAccess` | SQL access instance configured for the TU_T_BMP_KOJI (番ポ工事) table. Provides the `selectBySqlDefine()` method for executing parameterized SELECT queries. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `db_TU_T_BMP_KOJI.selectBySqlDefine` | TU_SELECT_006 | `TU_T_BMP_KOJI` | Executes a parameterized SELECT query (SQLKEY `TU_SELECT_006`) against the TU_T_BMP_KOJI table to retrieve Hanko construction order records matching the five binding variables. |

**Classification reasoning:**
- **R (Read)**: The method calls `selectBySqlDefine`, which is a read operation. The SQLKEY `TU_SELECT_006` maps to a SELECT statement defined in the SQL definition file.
- **Entity/DB**: `TU_T_BMP_KOJI` — confirmed from the class field `D_TBL_NAME_TU_T_BMP_KOJI = "TU_T_BMP_KOJI"` (line 52) and the SQL access instance name `db_TU_T_BMP_KOJI`.
- **SC Code**: `TU_SELECT_006` — this is a SQLKEY identifier rather than a traditional SC code. The query definition resides in the framework's external SQL registry, not in a Java SC class.

## 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] `TU_T_BMP_KOJI`

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

**Caller analysis:** The method is called exclusively by `JBSbatTUBmpSwchSodTrn.execute()`, which is the batch entry point (main orchestration method) for the Hanko swap SOD automatic processing batch job. The batch orchestrator calls this method as part of its conditional processing flow to retrieve Hanko construction data for a specific work order.

## 6. Per-Branch Detail Blocks

### Block 1 — PROCESSING (binding variable list creation) (L571)

> Create the JBSbatCommonDBInterface parameter list and populate it with the five binding variable values from the param array.

| # | Type | Code |
|---|------|------|
| 1 | SET | `JBSbatCommonDBInterface paramList = new JBSbatCommonDBInterface();` // Instantiate the binding variable list container [CONSTANT: TU_SELECT_006 referenced below] |
| 2 | EXEC | `paramList.setValue(param[0].toString());` // Set Hanko construction finalization date/time (番ポ工事確定年月日時) |
| 3 | EXEC | `paramList.setValue(param[1].toString());` // Set Service contract breakdown reservation application date (サービス契約内訳予約適用年月日) |
| 4 | EXEC | `paramList.setValue(param[2].toString());` // Set Service contract reservation application date (サービス契約予約適用年月日) |
| 5 | EXEC | `paramList.setValue(param[3].toString());` // Set Service contract reservation application date (サービス契約予約適用年月日) |
| 6 | EXEC | `paramList.setValue(param[4].toString());` // Set Hanko construction finalization date/time (番ポ工事確定年月日時) |

### Block 2 — DB ACCESS (L577)

> Execute the SQL SELECT query against the TU_T_BMP_KOJI table using the prepared parameter list.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `db_TU_T_BMP_KOJI.selectBySqlDefine(paramList, TU_T_BMP_KOJI_TU_SELECT_006);` // Execute DB SELECT [-> TU_SELECT_006 SQLKEY, Entity: TU_T_BMP_KOJI] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| Hanko (番ポ) | Business term | Phone number swap/porting (電話番号切り替え) — the process of reassigning a customer's phone number from one service contract to another, typically during provider migration or plan changes. |
| BMP | Acronym | Batch processing module identifier; "BMP" stands for Batch Main Processing in the K-Opticom system naming convention. |
| KOJI (工事) | Field | Construction/installation work — refers to the physical or logical installation work associated with a service change order. |
| TU_T_BMP_KOJI | Table | Hanko construction work table (番ポ工事) — stores records of Hanko swap construction orders, including finalization dates, reservation application dates, and associated service contract details. |
| TU_SELECT_006 | SQL Key | SQL definition key identifier — references a pre-defined SELECT query in the framework's SQL registry that retrieves Hanko construction records. |
| paramList | Field | JBSbatCommonDBInterface — a framework class that acts as a parameter container for prepared SQL statements, holding binding variable values in order. |
| setValue | Method | Framework method on JBSbatCommonDBInterface that appends a string value to the binding variable list in order. |
| selectBySqlDefine | Method | Framework method on JBSbatSQLAccess that executes a parameterized SQL query using a SQL key and a parameter list. |
| JBSbatCommonDBInterface | Class | Framework class representing a list of database binding (バインド変数) variables passed to SQL execution methods. |
| JBSbatSQLAccess | Class | Framework class providing database access operations (SELECT, INSERT, UPDATE, DELETE) via SQL key-based query definitions. |
| 番ポ工事確定年月日時 | Field (Japanese) | Hanko construction finalization date/time — the timestamp when the Hanko swap construction work was confirmed/finalized. Appears as param[0] and param[4]. |
| サービス契約内訳予約適用年月日 | Field (Japanese) | Service contract breakdown reservation application date — the date when a reservation was applied to the detailed breakdown of a service contract. param[1]. |
| サービス契約予約適用年月日 | Field (Japanese) | Service contract reservation application date — the date when a reservation was applied to a service contract. param[2] and param[3]. |
| JBSbatBusinessService | Class | Base class for batch business services; provides common infrastructure for batch processing including transaction management and logging. |
| SOD | Acronym | Service Order Data — the customer-facing order/contract entity in the K-Opticom system. |
| BIND (バインド変数) | Field | Binding variable — a parameter placeholder value in prepared SQL statements that is substituted at execution time. |
