Files
ccdi/sql/migration/2026-04-23-clean-legacy-staff-enterprise-relation-data.sql

11 lines
456 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 清理员工实体关系历史旧数据
-- 说明删除当前无法匹配任何员工亲属关系is_emp_family = 1的旧实体关联记录
-- 执行方式bin/mysql_utf8_exec.sh sql/migration/2026-04-23-clean-legacy-staff-enterprise-relation-data.sql
DELETE ser
FROM ccdi_staff_enterprise_relation ser
LEFT JOIN ccdi_staff_fmy_relation sfr
ON ser.person_id = sfr.relation_cert_no
AND sfr.is_emp_family = 1
WHERE sfr.id IS NULL;