# `Sp_Bill_Used_Base` (procedure)

> 修改单独校验


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sTableName` | `varchar(100)` |
| 2 | IN | `sLoginId` | `varchar(100)` |
| 3 | IN | `sGuid` | `varchar(100)` |
| 4 | OUT | `sReturn` | `varchar(1000)` |
| 5 | IN | `sBrId` | `varchar(100)` |
| 6 | IN | `sSuId` | `varchar(100)` |
| 7 | IN | `sType` | `varchar(100)` |
| 8 | OUT | `sCode` | `int` |
| 9 | OUT | `sReturnIds` | `text` |

## Body

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

## Narrative

**Business context:** Cross-module / 修改单独校验 — customer-override hook for the "is this base-data row safe to modify?" guard. Comment header: `修改单独校验`. The stock-build body is a near-empty stub (declarations only, no checks); the proc exists so individual customer builds (e.g. `script/客户/千彩/Sp_Bill_Used_Base.sql`) can replace it with site-specific lock rules.

**What it does:** Stub body: declares `p_bUsed = 0`, sets `sCode = 1`, returns. The customer-override version at `script/客户/千彩/` reads `sftlogininfo.bBaseCnUpdat` for `sLoginId` (per-user override flag) and, if not granted, runs per-table `IF sTableName = LOWER('EleCustomer') THEN ...` blocks counting downstream references in `salsalesorderslave`, etc., setting `p_bUsed` and populating `sReturnIds` so the caller can refuse the edit.

**Invocation:** Status: appears orphaned in the stock build — no caller in any channel (form-master, gdsmodule hooks, other DB routines, xly-src `.java`/`.xml`). Designed to be a customer-extensible companion to `Sp_Bill_Used`, but never wired in the standard codebase. Customer 千彩 supplies a full override but does not patch any caller to invoke it — verify before assuming the guard runs.
