# `Sp_Del_BasicsTable_DataByCompany` (procedure)

> 根据模块sId删除模块（包含子模块）


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sCompanyName` | `varchar(100)` |

## Body

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

## Narrative

**Business context:** Tenant-scoped basic-data purge — deletes a single company's master data plus its `sysbrands` row, so a brand can be removed without affecting other tenants on the same database. Sibling of `Sp_Del_BasicsTable_Data` (which truncates everything) and `Sp_Del_BusinessTable_DataCompany` (the transactional twin).

**What it does:** Resolves `(sBrId, sSuId)` from `sysbrands` by `sName LIKE concat('%', sCompanyName, '%')`, deletes the matching `sysbrands` row, then runs `DELETE ... WHERE sBrandsId=sBrId AND sSubsidiaryId=sSuId` against the form/chart/permissions tables (`gdsconfigcharmaster/slave`, `gdsmoduleshow`, `gdsconfigformpersonalize`, `kpimodule`, `syssearch`, `sischeckphase*`, `eleteststandard`) and the same basic-data set as `Sp_Del_BasicsTable_Data` — `eleworkcenter`, `elecustomer*`, `sftlogininfo`, `siscustomer*`, `eleknifemould*`, `elemachine`, `elematerials*`, `eleprocess*`, `eleproduct*`, `elesupply*`, `eleteam*`, `eleemployee`, plus the `sis*` lookups (`sisbank`, `sisdeliver`, `sisdepart`, `sisexchangerates`, `sislevel`, `sislosstype`, `sismaterialsclassify`, `sispayment`, `sisposition`, `sisproperty`, `sissalesman`, `sissettlement`, `sistax`, `sisunit`, `siswarehouse`, `sisworkcenter`).

**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no `gdsconfigformmaster` data-source, no other routine references it. xly-src ships `script/del/Sp_Del_BasicsTable_DataByCompany.sql` — operators invoke it manually when retiring a single company.
