# Business Logic — JBSbatKKFmtcelSodUpdInfCst.executeKK_T_ADCHG_DTL_KK_SELECT_020() [11 LOC]

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

## 1. Role

### JBSbatKKFmtcelSodUpdInfCst.executeKK_T_ADCHG_DTL_KK_SELECT_020()

This method serves as a **database accessor for address change detail records** (住所変更明細), specifically executing a SQL query via the `KK_SELECT_020` SQL key against the `KK_T_ADCHG_DTL` (Address Change Detail Table). The method binds three positional parameters — address change number, address change detail type code, and work case status — into a `JBSbatCommonDBInterface` parameter list and delegates the actual SQL execution to `db_KK_T_ADCHG_DTL.selectBySqlDefine()`. It operates as a **private delegation method**, used by other batch processing methods in this class (and mirrored identically across several related batch classes) to query address change detail information. In the broader system, this supports **address change processing workflows** in the K-Opticom customer core system, where address modifications trigger downstream validation and state checks on work cases. The method is currently commented-out in the active processing path (see caller context at line 199, deleted under OM-2014-0001680), indicating it was used to skip processing when a work case status equals "900" (Work Cancellation — 工事案件ステータス＝900(中止)), but the check was removed from production flow.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeKK_T_ADCHG_DTL_KK_SELECT_020(Object[] param)"])
    START --> S1["Create JBSbatCommonDBInterface paramList"]
    S1 --> S2["Bind param[0] - Address Change Number"]
    S2 --> S3["Bind param[1] - Address Change Detail Type Code"]
    S3 --> S4["Bind param[2] - Work Case Status"]
    S4 --> S5["Execute selectBySqlDefine(paramList, KK_SELECT_020)"]
    S5 --> END_NODE(["Return void / Next"])
```

| Step | Description |
|------|-------------|
| S1 | Create a new `JBSbatCommonDBInterface` instance named `paramList` to serve as the bind variable container. This is the parameter list object passed to the SQL access layer. (Japanese: バイントリストを生成します — "Generate bind list") |
| S2 | Extract `param[0]` as a string and bind it as the **Address Change Number** (住所変更番号). This identifies the specific address change record set to query. |
| S3 | Extract `param[1]` as a string and bind it as the **Address Change Detail Type Code** (住所変更明細種別コード). This classifies the type of detail within the address change (e.g., `ADCHG_DTL_SBT_CD_KOJIAK_NO` for work case details). |
| S4 | Extract `param[2]` as a string and bind it as the **Work Case Status** (工事案件ステータス). This indicates the current state of the work case (e.g., "900" means Work Cancellation — 中止). |
| S5 | Execute the SQL define `KK_SELECT_020` against the `KK_T_ADCHG_DTL` table via `db_KK_T_ADCHG_DTL.selectBySqlDefine()`. This performs a read (R) operation on the database, populating the SQL access object with query results. |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `Object[]` | Positional bind variable array containing three values passed in order: (0) Address Change Number — the unique identifier for an address change record; (1) Address Change Detail Type Code — the classification code for the detail type (e.g., `ADCHG_DTL_SBT_CD_KOJIAK_NO` for work case details); (2) Work Case Status — the current status code of the work case (e.g., "900" for Cancellation, 中止). |

**Instance fields read by this method:**
| Field | Type | Business Description |
|-------|------|---------------------|
| `db_KK_T_ADCHG_DTL` | `JBSbatSQLAccess` | Database access object for the Address Change Detail table (`KK_T_ADCHG_DTL`), used to execute SQL queries against address change detail records. |

**Constants used:**
| Constant | Value | Business Meaning |
|----------|-------|-----------------|
| `KK_T_ADCHG_DTL_KK_SELECT_020` | `"KK_SELECT_020"` | SQL define key identifying the SELECT query definition for address change detail retrieval. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JBSbatCommonDBInterface()` | JDKStructuredMap (constructor) | - | Creates a new bind variable list object to hold SQL parameter values. |
| R | `db_KK_T_ADCHG_DTL.selectBySqlDefine(paramList, KK_T_ADCHG_DTL_KK_SELECT_020)` | `KK_T_ADCHG_DTL` | `KK_T_ADCHG_DTL` | Executes the SQL define `KK_SELECT_020` against the Address Change Detail table to read address change detail records matching the three bind parameters (address change number, detail type code, work case status). |

**Classification details:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `db_KK_T_ADCHG_DTL.selectBySqlDefine` | `KK_T_ADCHG_DTL` | `KK_T_ADCHG_DTL` | Reads address change detail records from the database using the SQL key `KK_SELECT_020`. The query filters by address change number, detail type code, and work case status. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKFmtcelSodUpdInfCst` | (Same class, private method — referenced in commented code at line 199 within batch processing flow) | `db_KK_T_ADCHG_DTL.selectBySqlDefine [R] KK_T_ADCHG_DTL` |
| 2 | Batch: `JBSbatKKPlaceNoChgRnkiInfCst` | (Same method replicated, private method) | `db_KK_T_ADCHG_DTL.selectBySqlDefine [R] KK_T_ADCHG_DTL` |
| 3 | Batch: `JBSbatKKAdChgAddDataCst` | (Same method replicated, private method) | `db_KK_T_ADCHG_DTL.selectBySqlDefine [R] KK_T_ADCHG_DTL` |
| 4 | Batch: `JBSbatKKSodUpdInfCst` | (Same method replicated, private method) | `db_KK_T_ADCHG_DTL.selectBySqlDefine [R] KK_T_ADCHG_DTL` |
| 5 | Batch: `JBSbatKKSmtvlRnkiInfCst` | (Same method replicated, private method) | `db_KK_T_ADCHG_DTL.selectBySqlDefine [R] KK_T_ADCHG_DTL` |

**Notes:**
- All callers are **Batch** classes in the `eo.business.service` package, following the same naming pattern (`JBSbatKK*`). The method signature is **identically replicated** across these classes (same implementation, same constant name), suggesting a code generation or copy-paste pattern from a common template.
- In the primary caller `JBSbatKKFmtcelSodUpdInfCst`, the method call at line 199 is **currently commented out** (deleted under OM-2014-0001680, dated 2014/04/28), meaning this method is not actively invoked in the production flow of this class. The original purpose was to check for work case cancellation status (900) and skip processing if detected.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `Create paramList bind object` (L521)

> Create a new `JBSbatCommonDBInterface` instance to serve as the SQL bind variable list.
> Japanese: バイントリストを生成します — "Generate bind list."

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramList = new JBSbatCommonDBInterface()` // New bind variable container for SQL parameters |

**Block 2** — [EXEC] `Bind param[0]` (L522)

> Extract the address change number from the input array and bind it as the first SQL parameter.
> Japanese: 引数でバイント変数を設定します — "Set bind variables from arguments."

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramList.setValue(param[0].toString())` // param[0] = Address Change Number (住所変更番号) |

**Block 3** — [EXEC] `Bind param[1]` (L523)

> Extract the address change detail type code and bind it as the second SQL parameter.
> Japanese: 住所変更明細種別コード — "Address Change Detail Type Code."

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramList.setValue(param[1].toString())` // param[1] = Address Change Detail Type Code (住所変更明細種別コード). In caller context: `ADCHG_DTL_SBT_CD_KOJIAK_NO` (Work Case Detail Type Code) |

**Block 4** — [EXEC] `Bind param[2]` (L524)

> Extract the work case status and bind it as the third SQL parameter.
> Japanese: 工事案件ステータス — "Work Case Status."

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramList.setValue(param[2].toString())` // param[2] = Work Case Status (工事案件ステータス). In caller context: `KU_T_KOJIAK_KOJIAK_STAT` (e.g., "900" = 中止/Cancellation) |

**Block 5** — [CALL] `Execute SQL SELECT` (L527)

> Execute the SQL define `KK_SELECT_020` against the `KK_T_ADCHG_DTL` table. This is a Read (R) operation that queries address change detail records matching the three bind parameters. The SQL access object (`db_KK_T_ADCHG_DTL`) is an instance field initialized in the class setup to point to the `KK_T_ADCHG_DTL` table.
> Japanese: DBアクセスを実行します — "Execute DB access."

| # | Type | Code |
|---|------|------|
| 1 | CALL | `db_KK_T_ADCHG_DTL.selectBySqlDefine(paramList, KK_T_ADCHG_DTL_KK_SELECT_020)` // R — SQL key `KK_SELECT_020`, Table `KK_T_ADCHG_DTL` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|-----------------|
| `adchg_no` | Field | Address Change Number (住所変更番号) — Unique identifier for an address change record, linking related address change detail entries. |
| `adchg_dtl_sbt_cd` | Field | Address Change Detail Type Code (住所変更明細種別コード) — Classifies the type of detail within an address change. Example value: `ADCHG_DTL_SBT_CD_KOJIAK_NO` for work case details. |
| `kojiak_stat` | Field | Work Case Status (工事案件ステータス) — Status code of a work case. Value "900" means Cancellation (中止). |
| `KK_T_ADCHG_DTL` | DB Table | Address Change Detail Table (住所変更明細テーブル) — Core table storing address change line item details in the K-Opticom customer core system. |
| `KK_SELECT_020` | SQL Key | SQL define key — The SQL query definition identifier used to select address change detail records. |
| SOD | Acronym | Service Order Data — Related to service contract and order information in the telecom fulfillment domain. |
| KK | Acronym | K-Opticom — Brand/customer line of the NTT Group telecommunications service; prefix for domain-specific tables and processing. |
| JBSbat | Prefix | J Batch — Japanese naming convention prefix for batch processing service classes (J = Japanese, Bbat = Batch). |
| `JBSbatCommonDBInterface` | Class | Common Database Interface — Generic bind variable container used across the batch framework to pass SQL parameters. |
| `JBSbatSQLAccess` | Class | SQL Access Class — Framework class providing database access methods (selectBySqlDefine, insertByPrimaryKeys, etc.) for batch operations. |
| `KOJIAK` | Acronym | Work Case (工事案件) — A work order or construction case in the telecom service provisioning domain. |
| ADCHG | Acronym | Address Change (住所変更) — Process of modifying customer address information in the telecom system. |
| 中止 (Chushi) | Field Value | Cancellation — Work case status code "900" indicating the work case has been cancelled; triggers processing skip logic. |
