批量更新功能

This commit is contained in:
2026-09-14 16:15:44 +08:00
parent 6f106e43af
commit a26c98b92b
79 changed files with 4529 additions and 724 deletions
+19
View File
@@ -0,0 +1,19 @@
-- =============================================================
-- CRM units: mark system default units as not editable/deletable
-- Table: yz_backend_crm_unit
-- is_default = 1 -> system default unit (seeded by the system,
-- cannot be edited or deleted by tenants)
-- is_default = 0 -> tenant custom unit (full CRUD)
-- Existing seeded default units (matched by name) are marked below;
-- the backend also self-heals the flag on first use after upgrade.
-- Run: mysql --default-character-set=utf8mb4 -h<host> -P<port> -u<user> -p <db> < alter_crm_unit_default.sql
-- (re-running only reports "Duplicate column name", which is safe)
-- =============================================================
ALTER TABLE `yz_backend_crm_unit`
ADD COLUMN `is_default` TINYINT NOT NULL DEFAULT 0 COMMENT '1=system default unit (read-only), 0=tenant custom' AFTER `status`;
-- Mark seeded default units (same list as backend crmDefaultUnits)
UPDATE `yz_backend_crm_unit`
SET `is_default` = 1
WHERE `name` IN ('套', '台', '个', '件', '批', '次', '项', '人月', '人天', '年', '月', '米', '平方米', '吨', '千克', '箱');