---

# Business Logic — JBSbatKKAdHenkoHoyuDataChstuOtr.execute() [158 LOC]

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

## 1. Role

### JBSbatKKAdHenkoHoyuDataChstuOtr.execute()

This method is a **batch data extraction service** that migrates address data from multiple source system work tables into a unified change-preserved address table (`KK_T_CHG_AD_JGRTWK`). It handles three distinct service categories — **Address Masking Customers** (PROSCST), **Spare Equipment Delivery** (YBKIKI_HAISO), and **Preliminary Design** (SENKO_DSGN) — by querying each source table, copying the address fields along with their old values, and inserting them as change-preserving records. The class header describes this as a "location mask master latest record extraction part" that operates on "change target address code work" data. After processing all three sources, the method updates the work table's transfer status to "Processing Completed" (value `9`) for the given address code, then commits the transaction. It acts as a **shared batch utility** called by the broader address modification/hoyu (change registration) batch flow, functioning as a data transformer that bridges legacy source work tables into a consolidated change-log address entity.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execute(inMap)"])
    START --> GET_AD_CD["Get AD_CD from inMap"]
    GET_AD_CD --> SECTION1["Processing Section 1: Address Masking Customer Data"]
    SECTION1 --> QUERY_PROSCST["Query CK_T_PROSCST with KK_SELECT_003"]
    QUERY_PROSCST --> LOOP_PROSCST{"Has next PROSCST row?"}
    LOOP_PROSCST -- Yes --> SEQ_PROSCST["Get next sequence number"]
    SEQ_PROSCST --> MAP_PROSCST["Build inDbMap with source data"]
    MAP_PROSCST --> SET_SCHEMA_CK["Set CHG_TG_SCHEMA_ID = CK0051"]
    SET_SCHEMA_CK --> SET_KMK_NAME_CK["Set CHG_TG_KMK_NM_EINM = PROSCST_AD_CD"]
    SET_KMK_NAME_CK --> COPY_PROSCST_FIELDS["Copy address fields from PROSCST row"]
    COPY_PROSCST_FIELDS --> SET_OLD_CK["Set OLD_* from PROSCST_AD_CD fields"]
    SET_OLD_CK --> SET_STATUS_PROSCST["Set AD_TOHAIGO_TRN_STAT_CD = 0 (Not Processed)"]
    SET_STATUS_PROSCST --> INSERT_PROSCST["Insert into KK_T_CHG_AD_JGRTWK"]
    INSERT_PROSCST --> LOOP_PROSCST
    LOOP_PROSCST -- No --> SECTION2["Processing Section 2: Spare Equipment Delivery"]
    SECTION2 --> QUERY_YBKIKI["Query DK_T_YBKIKI_HAISO with KK_SELECT_001"]
    QUERY_YBKIKI --> LOOP_YBKIKI{"Has next YBKIKI row?"}
    LOOP_YBKIKI -- Yes --> SEQ_YBKIKI["Get next sequence number"]
    SEQ_YBKIKI --> MAP_YBKIKI["Build inDbMap with source data"]
    MAP_YBKIKI --> SET_SCHEMA_DK["Set CHG_TG_SCHEMA_ID = DK0061"]
    SET_SCHEMA_DK --> SET_KMK_NAME_DK["Set CHG_TG_KMK_NM_EINM = YBKIKI_HISOS_AD_CD"]
    SET_KMK_NAME_DK --> COPY_YBKIKI_FIELDS["Copy address fields from YBKIKI row"]
    COPY_YBKIKI_FIELDS --> SET_OLD_DK["Set OLD_* from YBKIKI_HISOS_* fields"]
    SET_OLD_DK --> SET_STATUS_YBKIKI["Set AD_TOHAIGO_TRN_STAT_CD = 0 (Not Processed)"]
    SET_STATUS_YBKIKI --> INSERT_YBKIKI["Insert into KK_T_CHG_AD_JGRTWK"]
    INSERT_YBKIKI --> LOOP_YBKIKI
    LOOP_YBKIKI -- No --> SECTION3["Processing Section 3: Preliminary Design"]
    SECTION3 --> QUERY_SENKO["Query KU_T_SENKO_DSGN with KK_SELECT_001"]
    QUERY_SENKO --> LOOP_SENKO{"Has next SENKO row?"}
    LOOP_SENKO -- Yes --> SEQ_SENKO["Get next sequence number"]
    SEQ_SENKO --> MAP_SENKO["Build inDbMap with source data"]
    MAP_SENKO --> SET_SCHEMA_KU["Set CHG_TG_SCHEMA_ID = KU0101"]
    SET_SCHEMA_KU --> SET_KMK_NAME_KU["Set CHG_TG_KMK_NM_EINM = SETPLACE_AD_CD"]
    SET_KMK_NAME_KU --> COPY_SENKO_FIELDS["Copy address fields from SENKO row"]
    COPY_SENKO_FIELDS --> SET_OLD_SENKO["Set OLD_* from SETPLACE_* fields"]
    SET_OLD_SENKO --> SET_STATUS_SENKO["Set AD_TOHAIGO_TRN_STAT_CD = 0 (Not Processed)"]
    SET_STATUS_SENKO --> INSERT_SENKO["Insert into KK_T_CHG_AD_JGRTWK"]
    INSERT_SENKO --> LOOP_SENKO
    LOOP_SENKO -- No --> SECTION4["Processing Section 4: Update Work Table Status"]
    SECTION4 --> SET_STATUS_WK["Set CKADGAI_CHG_AD_TRN_STAT_CD = 9 (Processing Completed)"]
    SET_STATUS_WK --> SET_WHERE_AD_CD["Set WHERE AD_CD = input AD_CD"]
    SET_WHERE_AD_CD --> UPDATE_WK["Update KK_T_CHGTGAD_CD_WK"]
    UPDATE_WK --> COMMIT["Commit transaction via super.commit()"]
    COMMIT --> RETURN["Return null"]
    RETURN --> END_NODE(["Return / Next"])
```

**CRITICAL — Constant Resolution:**

| Constant | Value | Business Meaning |
|----------|-------|------------------|
| `HENKO_ADD_CD_MI` | `"0"` | Address change processing status — Not Processed |
| `HENKO_ADD_CD_ZM` | `"9"` | Address change processing status — Processing Completed |
| `SEQ_KETA` | (format specifier) | Sequence output width/format for sequence generation |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `inMap` | `JBSbatServiceInterfaceMap` | The input message (denmun) carrying batch parameters. Contains the `AD_CD` (address code) field used to filter address records across all source tables. |

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

| Field | Type | Business Description |
|-------|------|---------------------|
| `commonItem` | `JBSbatCommonItem` | Batch-common parameter object (inherited from `JBSbatBusinessService`). Provides the database `Connection` used for sequence generation. |
| `SEQ_NAME` | `String` (constant) | `"SEQ_CHG_AD_JGRTWK_NO"` — Oracle sequence name for generating unique change record numbers. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JZMBatCommon.getInMapData` | JZMBatCommon | — | Reads the `AD_CD` (address code) from the input parameter map. |
| R | `db_CK_T_PROSCST.selectBySqlDefine` | — | `CK_T_PROSCST` | Executes `KK_SELECT_003` query against `CK_T_PROSCST` (Address Masking Customer source table) filtered by `AD_CD`. |
| R | `db_CK_T_PROSCST.selectNext` | — | `CK_T_PROSCST` | Iterates through the result set, fetching each row of address masking customer data. |
| R | `JCCOracleSeqUtil.getFormatedNextSeq` | JCCOracleSeq | — | Retrieves the next formatted sequence number for the change record key. |
| R | `map.getString` | — | — | Extracts typed string values from the result map for each address field (PCD, STATE_NM, CITY_NM, etc.). |
| C | `db_CHG_AD_JGRTWK.insertByPrimaryKeys` | — | `KK_T_CHG_AD_JGRTWK` | Inserts a complete change-preserved address record with both new and old address values. |
| R | `db_DK_T_YBKIKI_HAISO.selectBySqlDefine` | — | `DK_T_YBKIKI_HAISO` | Executes `KK_SELECT_001` query against the spare equipment delivery source table. |
| R | `db_DK_T_YBKIKI_HAISO.selectNext` | — | `DK_T_YBKIKI_HAISO` | Iterates through spare equipment delivery address rows. |
| R | `db_KU_T_SENKO_DSGN.selectBySqlDefine` | — | `KU_T_SENKO_DSGN` | Executes `KK_SELECT_001` query against the preliminary design source table. |
| R | `db_KU_T_SENKO_DSGN.selectNext` | — | `KU_T_SENKO_DSGN` | Iterates through preliminary design address rows. |
| U | `db_CHGTGAD_CD_WK.updateByPrimaryKeys` | — | `KK_T_CHGTGAD_CD_WK` | Updates the work table row for the given `AD_CD`, setting the transfer status to "Processing Completed" (`9`). |
| - | `super.commit` | JBSbatBusiness | — | Commits the entire transaction for all inserts and the final update. |

## 5. Dependency Trace

No callers were found in the codebase that reference `JBSbatKKAdHenkoHoyuDataChstuOtr`. This method appears to be a **standalone batch service** invoked directly by the batch scheduling framework (not by a screen or CBS intermediary). It belongs to the same module family as `JBSbatKKAdHenkoHoyuDataChstu` (the main address change handler) and `JBSbatKKAdHenkoHoyuDataChstuMan` (manual variant), suggesting it is part of a batch orchestration pipeline that processes address change registrations.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch (direct invocation) | Batch Scheduler -> `JBSbatKKAdHenkoHoyuDataChstuOtr.execute` | `KK_T_CHG_AD_JGRTWK [C]` x3, `KK_T_CHGTGAD_CD_WK [U]` |

**Terminal endpoints reached from this method:**

| # | Method / Entity | CRUD | Table / Entity | Description |
|---|----------------|------|----------------|-------------|
| 1 | `selectBySqlDefine` (PROSCST) | R | `CK_T_PROSCST` | Read address masking customer source records |
| 2 | `selectBySqlDefine` (YBKIKI) | R | `DK_T_YBKIKI_HAISO` | Read spare equipment delivery source records |
| 3 | `selectBySqlDefine` (SENKO) | R | `KU_T_SENKO_DSGN` | Read preliminary design source records |
| 4 | `insertByPrimaryKeys` (PROSCST) | C | `KK_T_CHG_AD_JGRTWK` | Insert change-preserved PROSCST address records |
| 5 | `insertByPrimaryKeys` (YBKIKI) | C | `KK_T_CHG_AD_JGRTWK` | Insert change-preserved YBKIKI_HAISO address records |
| 6 | `insertByPrimaryKeys` (SENKO) | C | `KK_T_CHG_AD_JGRTWK` | Insert change-preserved SENKO_DSGN address records |
| 7 | `updateByPrimaryKeys` | U | `KK_T_CHGTGAD_CD_WK` | Mark address code work table as fully processed |

## 6. Per-Branch Detail Blocks

**Block 1** — [INITIALIZATION] (L79)

> Extract the address code from the input map and prepare for the first source (PROSCST).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JZMBatCommon.getInMapData(inMap, "AD_CD")` // Extract address code from input [-> AD_CD] |
| 2 | SET | `dbList = new JBSbatCommonDBInterface()` // Create parameter holder [-> Parameter setup for query] |
| 3 | EXEC | `dbList.setValue(strAdCd)` // Set address code filter |
| 4 | CALL | `db_CK_T_PROSCST.selectBySqlDefine(dbList, "KK_SELECT_003")` // Query PROSCST source table |

**Block 2** — [WHILE LOOP] `PROSCST rows` (L86)

> Iterate through address masking customer records. For each row: generate sequence, build change record, and insert.

| # | Type | Code |
|---|------|------|
| 1 | SET | `map = new JBSbatCommonDBInterface()` |
| 2 | SET | `while((map = db_CK_T_PROSCST.selectNext()) != null)` // Iterate PROSCST rows |

**Block 2.1** — [LOOP BODY — PROSCST] (L89)

> Build and insert a change-preserved record for each PROSCST row. Schema ID = "CK0051", Key Map Name = "PROSCST_AD_CD".

| # | Type | Code |
|---|------|------|
| 1 | SET | `inDbMap = new JBSbatCommonDBInterface()` // Parameter setup |
| 2 | CALL | `seqNo = JCCOracleSeqUtil.getFormatedNextSeq(commonItem.getConnection(), SEQ_NAME, "", HENKO_ADD_CD_SEQ)` // Get next sequence [-> SEQ_NAME = "SEQ_CHG_AD_JGRTWK_NO"] |
| 3 | SET | `inDbMap.setValue(CHG_AD_JGRTWK_NO, seqNo)` // Primary key assignment |
| 4 | SET | `inDbMap.setValue(CHG_TG_SCHEMA_ID, "CK0051")` // Change target schema identifier [-> Schema: PROSCST] |
| 5 | SET | `inDbMap.setValue(CHG_TG_KMK_NM_EINM, "PROSCST_AD_CD")` // Key map name [-> Source: Address Masking Customer] |
| 6 | SET | `inDbMap.setValue(PROSCST_NO, map.getString("PROSCST_NO"))` |
| 7 | SET | `inDbMap.setValue(AD_CD, map.getString("AD_CD"))` |
| 8 | SET | `inDbMap.setValue(PCD, map.getString("PCD"))` // Postal code |
| 9 | SET | `inDbMap.setValue(STATE_NM, map.getString("STATE_NM"))` // State/prefecture name |
| 10 | SET | `inDbMap.setValue(CITY_NM, map.getString("CITY_NM"))` // City name |
| 11 | SET | `inDbMap.setValue(OAZTSU_NM, map.getString("OAZTSU_NM"))` // District name |
| 12 | SET | `inDbMap.setValue(AZCHO_NM, map.getString("AZCHO_NM"))` // Block number name |
| 13 | SET | `inDbMap.setValue(AD_SHUSEI_CD, map.getString("AD_SHUSEI_CD"))` // Address consolidation code |
| 14 | SET | `inDbMap.setValue(NEW_AD_CD, map.getString("NEW_AD_CD"))` |
| 15 | SET | `inDbMap.setValue(NEW_PCD, map.getString("NEW_PCD"))` // New postal code |
| 16 | SET | `inDbMap.setValue(NEW_STATE_NM, map.getString("NEW_STATE_NM"))` |
| 17 | SET | `inDbMap.setValue(NEW_CITY_NM, map.getString("NEW_CITY_NM"))` |
| 18 | SET | `inDbMap.setValue(NEW_OAZTSU_NM, map.getString("NEW_OAZTSU_NM"))` |
| 19 | SET | `inDbMap.setValue(NEW_AZCHO_NM, map.getString("NEW_AZCHO_NM"))` |
| 20 | SET | `inDbMap.setValue(AD_CHG_SBT_CD, map.getString("AD_CHG_SBT_CD"))` // Address change content code |
| 21 | SET | `inDbMap.setValue(OLD_AD_CD, map.getString("PROSCST_AD_CD"))` // Old address code from PROSCST |
| 22 | SET | `inDbMap.setValue(OLD_PCD, map.getString("PROSCST_PCD"))` |
| 23 | SET | `inDbMap.setValue(OLD_STATE_NM, map.getString("PROSCST_STATE_NM"))` |
| 24 | SET | `inDbMap.setValue(OLD_CITY_NM, map.getString("PROSCST_CITY_NM"))` |
| 25 | SET | `inDbMap.setValue(OLD_OAZTSU_NM, map.getString("PROSCST_OAZTSU_NM"))` |
| 26 | SET | `inDbMap.setValue(OLD_AZCHO_NM, map.getString("PROSCST_AZCHO_NM"))` |
| 27 | SET | `inDbMap.setValue(OLD_BNCHIGO, map.getString("PROSCST_BNCHIGO"))` // Branch reference |
| 28 | SET | `inDbMap.setValue(AD_TOHAIGO_TRN_STAT_CD, HENKO_ADD_CD_MI)` // Status = 0 [-> "Not Processed"] |
| 29 | CALL | `count = db_CHG_AD_JGRTWK.insertByPrimaryKeys(inDbMap)` // Insert into KK_T_CHG_AD_JGRTWK |

**Block 3** — [PROCESSING SECTION 2: Spare Equipment Delivery] (L129)

> Reset query, query `DK_T_YBKIKI_HAISO`, iterate rows, build change records with Schema ID "DK0061", and insert.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dbList = new JBSbatCommonDBInterface()` // Reset parameter holder |
| 2 | EXEC | `dbList.setValue(strAdCd)` // Set address code filter |
| 3 | CALL | `db_DK_T_YBKIKI_HAISO.selectBySqlDefine(dbList, "KK_SELECT_001")` // Query YBKIKI_HAISO source |

**Block 3.1** — [WHILE LOOP] `YBKIKI rows` (L135)

| # | Type | Code |
|---|------|------|
| 1 | SET | `map = new JBSbatCommonDBInterface()` |
| 2 | SET | `while((map = db_DK_T_YBKIKI_HAISO.selectNext()) != null)` |

**Block 3.2** — [LOOP BODY — YBKIKI] (L138)

> Build and insert a change-preserved record for each YBKIKI_HAISO row. Schema ID = "DK0061", Key Map Name = "YBKIKI_HISOS_AD_CD".

| # | Type | Code |
|---|------|------|
| 1 | SET | `inDbMap = new JBSbatCommonDBInterface()` |
| 2 | CALL | `seqNo = JCCOracleSeqUtil.getFormatedNextSeq(...)` // Get next sequence |
| 3 | SET | `inDbMap.setValue(CHG_AD_JGRTWK_NO, seqNo)` |
| 4 | SET | `inDbMap.setValue(CHG_TG_SCHEMA_ID, "DK0061")` [-> Schema: YBKIKI_HAISO] |
| 5 | SET | `inDbMap.setValue(CHG_TG_KMK_NM_EINM, "YBKIKI_HISOS_AD_CD")` [-> Source: Spare Equipment Delivery] |
| 6 | SET | `inDbMap.setValue(YBKIKI_HAISO_NO, map.getString("YBKIKI_HAISO_NO"))` |
| 7 | SET | `inDbMap.setValue(AD_CD, map.getString("AD_CD"))` |
| 8 | SET | `inDbMap.setValue(PCD, map.getString("PCD"))` |
| 9 | SET | `inDbMap.setValue(STATE_NM, map.getString("STATE_NM"))` |
| 10 | SET | `inDbMap.setValue(CITY_NM, map.getString("CITY_NM"))` |
| 11 | SET | `inDbMap.setValue(OAZTSU_NM, map.getString("OAZTSU_NM"))` |
| 12 | SET | `inDbMap.setValue(AZCHO_NM, map.getString("AZCHO_NM"))` |
| 13 | SET | `inDbMap.setValue(AD_SHUSEI_CD, map.getString("AD_SHUSEI_CD"))` |
| 14 | SET | `inDbMap.setValue(NEW_AD_CD, map.getString("NEW_AD_CD"))` |
| 15 | SET | `inDbMap.setValue(NEW_PCD, map.getString("NEW_PCD"))` |
| 16 | SET | `inDbMap.setValue(NEW_STATE_NM, map.getString("NEW_STATE_NM"))` |
| 17 | SET | `inDbMap.setValue(NEW_CITY_NM, map.getString("NEW_CITY_NM"))` |
| 18 | SET | `inDbMap.setValue(NEW_OAZTSU_NM, map.getString("NEW_OAZTSU_NM"))` |
| 19 | SET | `inDbMap.setValue(NEW_AZCHO_NM, map.getString("NEW_AZCHO_NM"))` |
| 20 | SET | `inDbMap.setValue(AD_CHG_SBT_CD, map.getString("AD_CHG_SBT_CD"))` |
| 21 | SET | `inDbMap.setValue(OLD_AD_CD, map.getString("YBKIKI_HISOS_AD_CD"))` // Old values from YBKIKI_HISOS_* |
| 22 | SET | `inDbMap.setValue(OLD_PCD, map.getString("YBKIKI_HISOS_PCD"))` |
| 23 | SET | `inDbMap.setValue(OLD_STATE_NM, map.getString("YBKIKI_HISOS_STATE_NM"))` |
| 24 | SET | `inDbMap.setValue(OLD_CITY_NM, map.getString("YBKIKI_HISOS_CITY_NM"))` |
| 25 | SET | `inDbMap.setValue(OLD_OAZTSU_NM, map.getString("YBKIKI_HISOS_OAZTSU_NM"))` |
| 26 | SET | `inDbMap.setValue(OLD_AZCHO_NM, map.getString("YBKIKI_HISOS_AZCHO_NM"))` |
| 27 | SET | `inDbMap.setValue(OLD_BNCHIGO, map.getString("YBKIKI_HISOS_BNCHIGO"))` |
| 28 | SET | `inDbMap.setValue(AD_TOHAIGO_TRN_STAT_CD, HENKO_ADD_CD_MI)` // [-> "0" (Not Processed)] |
| 29 | CALL | `count = db_CHG_AD_JGRTWK.insertByPrimaryKeys(inDbMap)` // Insert |

**Block 4** — [PROCESSING SECTION 3: Preliminary Design] (L181)

> Reset query, query `KU_T_SENKO_DSGN`, iterate rows, build change records with Schema ID "KU0101", and insert.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dbList = new JBSbatCommonDBInterface()` // Reset parameter holder |
| 2 | EXEC | `dbList.setValue(strAdCd)` // Set address code filter |
| 3 | CALL | `db_KU_T_SENKO_DSGN.selectBySqlDefine(dbList, "KK_SELECT_001")` // Query SENKO_DSGN source |

**Block 4.1** — [WHILE LOOP] `SENKO rows` (L187)

| # | Type | Code |
|---|------|------|
| 1 | SET | `map = new JBSbatCommonDBInterface()` |
| 2 | SET | `while((map = db_KU_T_SENKO_DSGN.selectNext()) != null)` |

**Block 4.2** — [LOOP BODY — SENKO] (L190)

> Build and insert a change-preserved record for each SENKO_DSGN row. Schema ID = "KU0101", Key Map Name = "SETPLACE_AD_CD".

| # | Type | Code |
|---|------|------|
| 1 | SET | `inDbMap = new JBSbatCommonDBInterface()` |
| 2 | CALL | `seqNo = JCCOracleSeqUtil.getFormatedNextSeq(...)` // Get next sequence |
| 3 | SET | `inDbMap.setValue(CHG_AD_JGRTWK_NO, seqNo)` |
| 4 | SET | `inDbMap.setValue(CHG_TG_SCHEMA_ID, "KU0101")` [-> Schema: SENKO_DSGN] |
| 5 | SET | `inDbMap.setValue(CHG_TG_KMK_NM_EINM, "SETPLACE_AD_CD")` [-> Source: Setup Location (Preliminary Design)] |
| 6 | SET | `inDbMap.setValue(SNKSKI_NO, map.getString("SNKSKI_NO"))` |
| 7 | SET | `inDbMap.setValue(AD_CD, map.getString("AD_CD"))` |
| 8 | SET | `inDbMap.setValue(PCD, map.getString("PCD"))` |
| 9 | SET | `inDbMap.setValue(STATE_NM, map.getString("STATE_NM"))` |
| 10 | SET | `inDbMap.setValue(CITY_NM, map.getString("CITY_NM"))` |
| 11 | SET | `inDbMap.setValue(OAZTSU_NM, map.getString("OAZTSU_NM"))` |
| 12 | SET | `inDbMap.setValue(AZCHO_NM, map.getString("AZCHO_NM"))` |
| 13 | SET | `inDbMap.setValue(AD_SHUSEI_CD, map.getString("AD_SHUSEI_CD"))` |
| 14 | SET | `inDbMap.setValue(NEW_AD_CD, map.getString("NEW_AD_CD"))` |
| 15 | SET | `inDbMap.setValue(NEW_PCD, map.getString("NEW_PCD"))` |
| 16 | SET | `inDbMap.setValue(NEW_STATE_NM, map.getString("NEW_STATE_NM"))` |
| 17 | SET | `inDbMap.setValue(NEW_CITY_NM, map.getString("NEW_CITY_NM"))` |
| 18 | SET | `inDbMap.setValue(NEW_OAZTSU_NM, map.getString("NEW_OAZTSU_NM"))` |
| 19 | SET | `inDbMap.setValue(NEW_AZCHO_NM, map.getString("NEW_AZCHO_NM"))` |
| 20 | SET | `inDbMap.setValue(AD_CHG_SBT_CD, map.getString("AD_CHG_SBT_CD"))` |
| 21 | SET | `inDbMap.setValue(OLD_AD_CD, map.getString("SETPLACE_AD_CD"))` // Old values from SETPLACE_* |
| 22 | SET | `inDbMap.setValue(OLD_PCD, map.getString("SETPLACE_PCD"))` |
| 23 | SET | `inDbMap.setValue(OLD_STATE_NM, map.getString("SETPLACE_STATE_NM"))` |
| 24 | SET | `inDbMap.setValue(OLD_CITY_NM, map.getString("SETPLACE_CITY_NM"))` |
| 25 | SET | `inDbMap.setValue(OLD_OAZTSU_NM, map.getString("SETPLACE_OAZTSU_NM"))` |
| 26 | SET | `inDbMap.setValue(OLD_AZCHO_NM, map.getString("SETPLACE_AZCHO_NM"))` |
| 27 | SET | `inDbMap.setValue(OLD_BNCHIGO, map.getString("SETPLACE_AD_BNCHIGO"))` |
| 28 | SET | `inDbMap.setValue(AD_TOHAIGO_TRN_STAT_CD, HENKO_ADD_CD_MI)` // [-> "0" (Not Processed)] |
| 29 | CALL | `count = db_CHG_AD_JGRTWK.insertByPrimaryKeys(inDbMap)` // Insert |

**Block 5** — [PROCESSING SECTION 4: Update Work Table Status] (L223)

> Update the address code work table to mark processing as complete. Comment: "変更対象住所コードワークの処理ステータスの更新" (Update processing status of change target address code work) — "パラメータを設定（SET句）" (Set parameters for SET clause).

| # | Type | Code |
|---|------|------|
| 1 | SET | `valueMap = new JBSbatCommonDBInterface()` // Parameter setup for SET clause |
| 2 | SET | `valueMap.setValue(CKADGAI_CHG_AD_TRN_STAT_CD, HENKO_ADD_CD_ZM)` // [-> "9" (Processing Completed)] |
| 3 | SET | `whereMap = new JBSbatCommonDBInterface()` // Parameter setup for WHERE clause |
| 4 | SET | `whereMap.setValue(AD_CD, strAdCd)` // Filter by input address code |
| 5 | CALL | `db_CHGTGAD_CD_WK.updateByPrimaryKeys(whereMap, valueMap)` // Update: "UPDATE文を実行する" (Execute UPDATE statement) |
| 6 | CALL | `super.commit()` // Commit: "住所コード単位でコミットする" (Commit per address code unit) |
| 7 | RETURN | `return null` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `AD_CD` | Field | Address Code — unique identifier for an address record across source systems |
| `PCD` | Field | Postal Code — Japanese postal code for the address |
| `STATE_NM` | Field | State/Prefecture Name — prefecture or state-level name (e.g., "Tokyo") |
| `CITY_NM` | Field | City Name — city-level name (e.g., "Shinjuku-ku") |
| `OAZTSU_NM` | Field | District Name — district-level name (oazutsu is a Japanese transliteration of "azabu/district") |
| `AZCHO_NM` | Field | Block Number Name — block/chome-level address detail |
| `AD_SHUSEI_CD` | Field | Address Consolidation Code — indicates whether the address has been consolidated under Japan's address reform system |
| `NEW_AD_CD` | Field | New Address Code — updated address code after address reform |
| `NEW_PCD` / `NEW_STATE_NM` / etc. | Field | New address fields — the post-reform values for each address component |
| `OLD_*` fields | Field | Old address fields (OLD_AD_CD, OLD_PCD, etc.) — the pre-reform values preserved for audit/history |
| `AD_CHG_SBT_CD` | Field | Address Change Content Code — code describing the type of address change |
| `OLD_BNCHIGO` / `NEW_BNCHIGO` | Field | Branch Reference — branch/no. code for address disambiguation |
| `AD_TOHAIGO_TRN_STAT_CD` | Field | Address Transfer Processing Status Code — tracks whether an address record has been processed for transfer (0=Not Processed, 2=In Progress, 3=Notification Required, 4=Update Impossible, 9=Completed) |
| `CHG_AD_JGRTWK_NO` | Field | Change Address Registration Work Number — primary key sequence for records in `KK_T_CHG_AD_JGRTWK` |
| `CHG_TG_SCHEMA_ID` | Field | Change Target Schema ID — identifies which source system the address record came from (CK0051, DK0061, KU0101) |
| `CHG_TG_KMK_NM_EINM` | Field | Change Target Key Map Name (English) — the Japanese-style key identifier for the source table (PROSCST_AD_CD, YBKIKI_HISOS_AD_CD, SETPLACE_AD_CD) |
| `CKADGAI_CHG_AD_TRN_STAT_CD` | Field | Outside/External Change Address Transfer Status Code — status field in the work table `KK_T_CHGTGAD_CD_WK` |
| `CK_T_PROSCST` | Table | Address Masking Customer source table — contains address data from the PROSCST (address masking) system |
| `DK_T_YBKIKI_HAISO` | Table | Spare Equipment Delivery source table — contains address data from the YBKIKI (spare/backup equipment) delivery system |
| `KU_T_SENKO_DSGN` | Table | Preliminary Design source table — contains address data from the SENKO (setup/preliminary design) system |
| `KK_T_CHG_AD_JGRTWK` | Table | Change Address Registration Work table — the target table where change-preserved address records from all three sources are consolidated |
| `KK_T_CHGTGAD_CD_WK` | Table | Change Target Address Code Work table — the work table tracking which address codes have been processed; its status is updated to "Completed" by this method |
| `SEQ_CHG_AD_JGRTWK_NO` | Sequence | Oracle database sequence that generates unique primary key values for `KK_T_CHG_AD_JGRTWK` records |
| `HENKO_ADD_CD_MI` | Constant | Processing status "Not Processed" = "0" |
| `HENKO_ADD_CD_CHU` | Constant | Processing status "In Progress" = "2" |
| `HENKO_ADD_CD_YOU` | Constant | Processing status "Notification Required" = "3" |
| `HENKO_ADD_CD_FUKA` | Constant | Processing status "Update Impossible" = "4" |
| `HENKO_ADD_CD_ZM` | Constant | Processing status "Processing Completed" = "9" |
| PROSCST | Acronym | Address Masking Customer — a customer classification in the telecom system (PROSCST) |
| YBKIKI | Acronym | Spare Equipment (backup/prepared equipment) — relates to YBKIKI_HAISO (spare equipment delivery) |
| SENKO | Acronym | Preliminary Design (SETPLACE) — the pre-installation design phase for telecom services |
| KK | Acronym | K-Opticom — the telecom operator domain prefix (e.g., KK_T_*) |
| CHG | Acronym | Change — refers to address change/registration processing |
| JGRTWK | Acronym | Registration Work — refers to work-table records being registered |
| inMap | Parameter | Input denmun (message) — the service interface map carrying batch input parameters |
| denmun | Term | Japanese term for "message" or "data packet" — the input data structure for batch services |
| initial() | Method | Initialization method that sets up `JBSbatSQLAccess` objects for all five tables and configures common parameters |

---
