# Business Logic — JBSbatKKCampaignIktAdd.executeKK_T_MSKM_PKINSERT() [65 LOC]

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

## 1. Role

### JBSbatKKCampaignIktAdd.executeKK_T_MSKM_PKINSERT()

This method performs a primary-key-based insert of a single application (subscription) record into the `KK_T_MSKM` table. It is the data-access layer's dedicated "register all fields" operation — it accepts a flat `Object[]` array containing exactly 57 values (one per column of the application master table) and maps each index to its corresponding database column name. The method follows a **delegation** design pattern: it builds a structured `JBSbatCommonDBInterface` item by wrapping the raw array into typed key-value pairs, then delegates the actual SQL execution to `db_KK_T_MSKM.insertByPrimaryKeys()`. Within the larger system, this method serves as a building block called by `execute()` — the batch entry point for campaign application registration — enabling the batch job to persist a newly formed application record with all fields populated (a full-row insert). The method is private, meaning it is an internal utility of `JBSbatKKCampaignIktAdd` and is not exposed as a public API.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeKK_T_MSKM_PKINSERT(setParam)"])
    START --> B1["B1: Create setMap"]
    B1 --> B2["B2: Map 57 fields from setParam[] to setMap"]
    B2 --> B3["B3: DB Access — insertByPrimaryKeys"]
    B3 --> END_NODE(["Return / Next"])
```

**Processing summary:**

1. **B1 — Create setMap**: Instantiate a new `JBSbatCommonDBInterface` object to serve as the database insert item container.
2. **B2 — Map 57 fields from setParam[] to setMap**: For each of the 57 positions (indices 0 through 56), call `setMap.setValue()` with the column name constant and the corresponding element from the `setParam` array. This is a linear, unconditional mapping — every index is written regardless of nullity.
3. **B3 — DB Access — insertByPrimaryKeys**: Pass the populated map to `db_KK_T_MSKM.insertByPrimaryKeys()`, which executes the INSERT statement against the `KK_T_MSKM` table using the primary key columns.

This method contains **no conditional branches**, no loops, and no decision diamonds — it is a pure, linear data-mapping and delegate-insertion method.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `setParam` | `Object[]` | An ordered array of 57 field values representing all columns of the application (subscription) master record `KK_T_MSKM`. Index 0 is the application number (`MSKM_NO`), index 1 is the generation registration timestamp (`GENE_ADD_DTM`), and so on through index 56 (`DEL_TRN_ID`). The array must contain values in the exact column order defined by the Javadoc; a misaligned index produces an insert with data in the wrong column. |

**External state read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `db_KK_T_MSKM` | `JBSbatSQLAccess` | Database access object for the `KK_T_MSKM` (Application Master) table. Initialized in the batch setup phase with the table name constant `D_TBL_NAME_KK_T_MSKM`. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `db_KK_T_MSKM.insertByPrimaryKeys` | — | `KK_T_MSKM` | Inserts a new application record into the application master table using primary key columns. This is the sole terminal database operation. |
| - | `JBSbatCommonDBInterface.setValue` | — | — | Populates the database insert item with column-name-to-value mappings (57 key-value pairs total). |

### Per-method classification:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `insertByPrimaryKeys` | — | `KK_T_MSKM` | Creates a new application (subscription) record in the application master table. The primary key column is `MSKM_NO` (application number). |

## 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: `insertByPrimaryKeys` [C], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKCampaignIktAdd | `JBSbatKKCampaignIktAdd.execute()` -> `executeKK_T_MSKM_PKINSERT(setParam)` | `insertByPrimaryKeys [C] KK_T_MSKM` |

**Description:**

This method is called exclusively by the `execute()` method of the same class `JBSbatKKCampaignIktAdd`. It is a private helper that the batch job uses during the application registration flow. The call chain originates from the batch entry point `execute()`, which prepares the 57-element parameter array before invoking this method to persist the record. The sole terminal operation is the `insertByPrimaryKeys` call against the `KK_T_MSKM` table.

## 6. Per-Branch Detail Blocks

> This method has no conditional branches. The entire method is a single linear block.

**Block 1** — [PROCEDURE] (L1387)

> Create the database insert item and map all 57 fields from the parameter array.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setMap = new JBSbatCommonDBInterface();` // Create the insert item container |
| 2 | EXEC | `setMap.setValue("MSKM_NO", setParam[0]);` // Application number |
| 3 | EXEC | `setMap.setValue("GENE_ADD_DTM", setParam[1]);` // Generation registration date-time |
| 4 | EXEC | `setMap.setValue("MSKM_STAT", setParam[2]);` // Application status |
| 5 | EXEC | `setMap.setValue("SYSID", setParam[3]);` // SYSID |
| 6 | EXEC | `setMap.setValue("MSKM_SBT_CD", setParam[4]);` // Application type code |
| 7 | EXEC | `setMap.setValue("MSKMSHO_ARIV_YMD", setParam[5]);` // Application document arrival date |
| 8 | EXEC | `setMap.setValue("MSKM_UK_DTM", setParam[6]);` // Application reception date-time |
| 9 | EXEC | `setMap.setValue("MSKM_UK_TNT_USER_ID", setParam[7]);` // Application reception operator user ID |
| 10 | EXEC | `setMap.setValue("MSKM_YMD", setParam[8]);` // Application date |
| 11 | EXEC | `setMap.setValue("TTL_BUSINESS_CENTER_UK_NO", setParam[9]);` // Total business center reception number |
| 12 | EXEC | `setMap.setValue("TTL_BUSINESS_MSKM_OPT_CD", setParam[10]);` // Total business application trigger code |
| 13 | EXEC | `setMap.setValue("MSKM_RRKS_TELNO", setParam[11]);` // Application contact phone number |
| 14 | EXEC | `setMap.setValue("MSKM_JSSIS_SBT_CD", setParam[12]);` // Application implementer type code |
| 15 | EXEC | `setMap.setValue("CUST_YOBO_JIKO", setParam[13]);` // Customer request items |
| 16 | EXEC | `setMap.setValue("TEL_RRK_KIBOD_SBT_CD", setParam[14]);` // Telephone contact desired date type code |
| 17 | EXEC | `setMap.setValue("TEL_RRK_KIBO_TIME_CD", setParam[15]);` // Telephone contact desired time slot code |
| 18 | EXEC | `setMap.setValue("TAKCHO_KIBOD_SBT_CD", setParam[16]);` // Indoor survey desired date type code |
| 19 | EXEC | `setMap.setValue("TAKCHO_KIBO_TIME_CD", setParam[17]);` // Indoor survey desired time slot code |
| 20 | EXEC | `setMap.setValue("MSKM_PDING_DTM", setParam[18]);` // Application pending date-time |
| 21 | EXEC | `setMap.setValue("MSKM_PDING_RSN_CD", setParam[19]);` // Application pending reason code |
| 22 | EXEC | `setMap.setValue("MSKM_PDING_RLS_YMD", setParam[20]);` // Application pending release date |
| 23 | EXEC | `setMap.setValue("MSKM_RTRN_YMD", setParam[21]);` // Application return date |
| 24 | EXEC | `setMap.setValue("MSKM_RTRN_RSN_CD", setParam[22]);` // Application return reason code |
| 25 | EXEC | `setMap.setValue("KARI_MSKM_FLG", setParam[23]);` // Temporary application flag |
| 26 | EXEC | `setMap.setValue("MSKM_NAIYO_CFM_FIN_YMD", setParam[24]);` // Application content confirmation completion date |
| 27 | EXEC | `setMap.setValue("MSKM_CANCEL_YMD", setParam[25]);` // Application cancellation date |
| 28 | EXEC | `setMap.setValue("MSKM_CANCEL_RSN_CD", setParam[26]);` // Application cancellation reason code |
| 29 | EXEC | `setMap.setValue("MSKM_CANCEL_CL_YMD", setParam[27]);` // Application cancellation withdrawal date |
| 30 | EXEC | `setMap.setValue("REFERER", setParam[28]);` // Referrer |
| 31 | EXEC | `setMap.setValue("LAST_SCREEN_ID", setParam[29]);` // Last screen ID |
| 32 | EXEC | `setMap.setValue("MSKM_NYO_SHONIN_SHIN_YMD", setParam[30]);` // Application content approval application date |
| 33 | EXEC | `setMap.setValue("MSKM_NYO_SHONIN_YMD", setParam[31]);` // Application content approval date |
| 34 | EXEC | `setMap.setValue("KEPCO_CUSTINFO_JUJU_DOI_UM", setParam[32]);` // KEPCO customer information exchange consent yes/no |
| 35 | EXEC | `setMap.setValue("AGNT_SHUK_KMK_CD", setParam[33]);` // Agent aggregation item code |
| 36 | EXEC | `setMap.setValue("SHOSA_BF_RRK_JIKO_YH", setParam[34]);` // Pre-check contact items necessity |
| 37 | EXEC | `setMap.setValue("SHOSA_BF_RRK_JIKO", setParam[35]);` // Pre-check contact items |
| 38 | EXEC | `setMap.setValue("USE_SVC_KEIZK_SBT_CD", setParam[36]);` // Used service continuation type code |
| 39 | EXEC | `setMap.setValue("ANTENNA_RENT_KIBO_UM", setParam[37]);` // Antenna rental desired yes/no |
| 40 | EXEC | `setMap.setValue("RTRN_CHU_MSKM_ABDMNT_DTM", setParam[38]);` // Return-in-progress application discard date-time |
| 41 | EXEC | `setMap.setValue("CONSMBSN_MSKM_STAT_SKBT_CD", setParam[39]);` // Consumer business application status identification code |
| 42 | EXEC | `setMap.setValue("UK_TNTSHA_SKBT_CD", setParam[40]);` // Reception operator identification code |
| 43 | EXEC | `setMap.setValue("KOJI_REQ_INFO_RRK_JIKO", setParam[41]);` // Construction request information contact items |
| 44 | EXEC | `setMap.setValue("MSKM_ROUTE_SKBT_CD", setParam[42]);` // Application route identification code |
| 45 | EXEC | `setMap.setValue("AGNT_MSKM_TRTG_UM", setParam[43]);` // Agent application reception yes/no |
| 46 | EXEC | `setMap.setValue("ADD_DTM", setParam[44]);` // Registration date-time |
| 47 | EXEC | `setMap.setValue("ADD_OPEACNT", setParam[45]);` // Registration operator account |
| 48 | EXEC | `setMap.setValue("UPD_DTM", setParam[46]);` // Update date-time |
| 49 | EXEC | `setMap.setValue("UPD_OPEACNT", setParam[47]);` // Update operator account |
| 50 | EXEC | `setMap.setValue("DEL_DTM", setParam[48]);` // Deletion date-time |
| 51 | EXEC | `setMap.setValue("DEL_OPEACNT", setParam[49]);` // Deletion operator account |
| 52 | EXEC | `setMap.setValue("MK_FLG", setParam[50]);` // Invalid flag |
| 53 | EXEC | `setMap.setValue("ADD_UNYO_YMD", setParam[51]);` // Registration operation date |
| 54 | EXEC | `setMap.setValue("ADD_TRN_ID", setParam[52]);` // Registration process ID |
| 55 | EXEC | `setMap.setValue("UPD_UNYO_YMD", setParam[53]);` // Update operation date |
| 56 | EXEC | `setMap.setValue("UPD_TRN_ID", setParam[54]);` // Update process ID |
| 57 | EXEC | `setMap.setValue("DEL_UNYO_YMD", setParam[55]);` // Deletion operation date |
| 58 | EXEC | `setMap.setValue("DEL_TRN_ID", setParam[56]);` // Deletion process ID |

**Block 2** — [PROCEDURE] (L1447)

> Execute the database insert using primary keys.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `db_KK_T_MSKM.insertByPrimaryKeys(setMap);` // Insert application record into KK_T_MSKM table |

**Block 3** — [RETURN] (L1449)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `// Method ends (void return)` // No explicit return statement; control returns to caller |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `MSKM_NO` | Field | Application number — unique identifier for a campaign subscription application |
| `MSKM` | Acronym | 申込 (Application/Subscription) — refers to customer campaign application records |
| `GENE_ADD_DTM` | Field | Generation registration date-time — when the application record was initially created |
| `MSKM_STAT` | Field | Application status — current lifecycle state of the application (e.g., pending, approved, cancelled) |
| `MSKM_SBT_CD` | Field | Application type code — classifies the type of application (e.g., new, change) |
| `MSKMSHO_ARIV_YMD` | Field | Application document arrival date — when the physical application form was received |
| `MSKM_UK_DTM` | Field | Application reception date-time — when the application was formally processed by staff |
| `MSKM_UK_TNT_USER_ID` | Field | Application reception operator user ID — the staff member who received the application |
| `MSKM_YMD` | Field | Application date — the date the customer submitted the application |
| `TTL_BUSINESS_CENTER_UK_NO` | Field | Total business center reception number — reference number from the central business center |
| `TTL_BUSINESS_MSKM_OPT_CD` | Field | Total business application trigger code — what prompted this application (e.g., direct, referral) |
| `MSKM_RRKS_TELNO` | Field | Application contact phone number — customer's phone number for contact |
| `MSKM_JSSIS_SBT_CD` | Field | Application implementer type code — type of entity implementing the application |
| `CUST_YOBO_JIKO` | Field | Customer request items — special notes or requests from the customer |
| `TEL_RRK_KIBOD_SBT_CD` | Field | Telephone contact desired date type code — preferred date type for callback |
| `TEL_RRK_KIBO_TIME_CD` | Field | Telephone contact desired time slot code — preferred time slot for callback |
| `TAKCHO_KIBOD_SBT_CD` | Field | Indoor survey desired date type code — preferred date type for indoor inspection |
| `TAKCHO_KIBO_TIME_CD` | Field | Indoor survey desired time slot code — preferred time slot for indoor inspection |
| `MSKM_PDING_DTM` | Field | Application pending date-time — when the application was placed on hold |
| `MSKM_PDING_RSN_CD` | Field | Application pending reason code — reason the application is on hold |
| `MSKM_PDING_RLS_YMD` | Field | Application pending release date — when the pending status is lifted |
| `MSKM_RTRN_YMD` | Field | Application return date — date the application was returned for correction |
| `MSKM_RTRN_RSN_CD` | Field | Application return reason code — reason for returning the application |
| `KARI_MSKM_FLG` | Field | Temporary application flag — indicates whether this is a provisional application |
| `MSKM_NAIYO_CFM_FIN_YMD` | Field | Application content confirmation completion date — when the application content was verified |
| `MSKM_CANCEL_YMD` | Field | Application cancellation date — date the application was cancelled |
| `MSKM_CANCEL_RSN_CD` | Field | Application cancellation reason code — reason for cancellation |
| `MSKM_CANCEL_CL_YMD` | Field | Application cancellation withdrawal date — date a cancellation was retracted |
| `MSKM_NYO_SHONIN_SHIN_YMD` | Field | Application content approval application date — date approval was requested |
| `MSKM_NYO_SHONIN_YMD` | Field | Application content approval date — date approval was granted |
| `KEPCO_CUSTINFO_JUJU_DOI_UM` | Field | KEPCO customer information exchange consent yes/no — whether customer consented to share info with KEPCO |
| `AGNT_SHUK_KMK_CD` | Field | Agent aggregation item code — code for agent-level aggregated reporting |
| `SHOSA_BF_RRK_JIKO_YH` | Field | Pre-check contact items necessity — whether pre-check contact is required |
| `SHOSA_BF_RRK_JIKO` | Field | Pre-check contact items — details of items discussed before the formal check |
| `USE_SVC_KEIZK_SBT_CD` | Field | Used service continuation type code — type of service continuation (e.g., existing to new) |
| `ANTENNA_RENT_KIBO_UM` | Field | Antenna rental desired yes/no — whether customer wants to rent an antenna |
| `RTRN_CHU_MSKM_ABDMNT_DTM` | Field | Return-in-progress application discard date-time — when an application in return status was discarded |
| `CONSMBSN_MSKM_STAT_SKBT_CD` | Field | Consumer business application status identification code — specialized status code for consumer applications |
| `UK_TNTSHA_SKBT_CD` | Field | Reception operator identification code — identifies the type of reception operator |
| `KOJI_REQ_INFO_RRK_JIKO` | Field | Construction request information contact items — notes related to construction requests |
| `MSKM_ROUTE_SKBT_CD` | Field | Application route identification code — how the application was submitted (e.g., online, phone) |
| `AGNT_MSKM_TRTG_UM` | Field | Agent application reception yes/no — whether the application was received through an agent |
| `ADD_DTM` | Field | Registration date-time — timestamp of the record creation |
| `ADD_OPEACNT` | Field | Registration operator account — the operator account that created the record |
| `UPD_DTM` | Field | Update date-time — timestamp of the last record update |
| `UPD_OPEACNT` | Field | Update operator account — the operator account that last modified the record |
| `DEL_DTM` | Field | Deletion date-time — timestamp of record deletion (soft delete) |
| `DEL_OPEACNT` | Field | Deletion operator account — the operator account that deleted the record |
| `MK_FLG` | Field | Invalid flag — marks the record as invalid (logical delete flag) |
| `ADD_UNYO_YMD` | Field | Registration operation date — the business date associated with registration |
| `ADD_TRN_ID` | Field | Registration process ID — unique identifier for the registration transaction |
| `UPD_UNYO_YMD` | Field | Update operation date — the business date associated with the update |
| `UPD_TRN_ID` | Field | Update process ID — unique identifier for the update transaction |
| `DEL_UNYO_YMD` | Field | Deletion operation date — the business date associated with deletion |
| `DEL_TRN_ID` | Field | Deletion process ID — unique identifier for the deletion transaction |
| `KK_T_MSKM` | DB Table | Application Master Table — the core table storing campaign subscription application records |
| `ZM_M_CD_NM_KANRI` | DB Table | Code Name Management Table — system table for managing code-to-name mappings |
| `JBSbatCommonDBInterface` | Class | Database insert/update interface — framework class that holds column-value pairs for DB operations |
| `JBSbatSQLAccess` | Class | SQL access abstraction — framework class providing DB CRUD operations |
| `insertByPrimaryKeys` | Method | Primary-key-based insert — framework method that generates an INSERT statement using primary key columns |
| KEPCO | Acronym | Korea Electric Power Corporation — utility company integration for customer information exchange |
| 申込 (Shin'you) | Business term | Application/Subscription — a customer's formal request to sign up for a campaign or service |
| 宅内調査 (Takunai Chosa) | Business term | Indoor survey — an on-site inspection of a customer's premises for service installation |
| 差し戻し (Sashimodoshi) | Business term | Return — the process of sending an application back to the applicant for correction |
| 仮申込 (Kari Shin'you) | Business term | Temporary application — a provisional application pending full validation |
