# `Sp_BtnRepair_UpdateNotUsed` (procedure)

> 变更从表数据


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sProInParam` | `varchar(10000)` |
| 2 | IN | `sMakePerson` | `varchar(100)` |
| 3 | IN | `sUserId` | `varchar(100)` |
| 4 | IN | `sBrId` | `varchar(100)` |
| 5 | IN | `sSuId` | `varchar(100)` |
| 6 | OUT | `sReturn` | `varchar(1000)` |
| 7 | OUT | `sCode` | `int` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_BtnRepair_UpdateNotUsed`'`._

## Narrative

**Business context:** 产品报价 / 变更从表数据 — bulk "批量修改" dialog handler on the 产品报价 (product-quotation) slave grid. Lets the quotation owner overwrite the obsolete-row flag `bNotUsed` plus the six quoted-price components on selected `eleproductpriceslave` lines in one click.

**What it does:** Parses per-row `sId` plus per-field values from `$.changeValue`: `bNotUsed`, `dQuoMaterialsPrice`, `dAssistMaterialsPrice`, `dQuoPrintPrice`, `dQuoPrintAfterPrice`, `dQuoManualPrice`, `dQuoFreightPrice`. For each row id, `UPDATE eleproductpriceslave SET ...` with `IFNULL(p_x, 0)` (defaults to 0 when not supplied — so a partial dialog blanks unset price components to zero).

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "批量修改" dialog on the 产品报价从表 grid registers this procedure name. Built from the `sButtonParam.sql` template. Sibling of the `Sp_BtnRepair_Update*` family.

Caveat: blanking semantics — every price column is `IFNULL(p_x, 0)`, so any field the user does not edit in the dialog will be reset to 0 rather than preserved.
