YZProjectCloud/docsql/2026/04/多考勤系统.md

33 lines
704 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 1.给attendance_cfg表中增加is_default int 1-默认0-非默认
更新历史数据
UPDATE attendance_cfg set is_default=1
更新历史数据
UPDATE pro_mobile_attendance_data pmad
INNER JOIN (
SELECT ac.project_id, ac.id AS cfg_id
FROM attendance_cfg ac
WHERE ac.is_default = 1 AND ac.enabled = 1
) ac ON pmad.project_id = ac.project_id
SET pmad.cfg_id = ac.cfg_id
WHERE pmad.att_device = 'device' AND pmad.cfg_id = 0;
### 2.attendance_ubi_data表增加cfg_id保存配置ID
更新历史数据
UPDATE attendance_ubi_data a
SET cfg_id = (
SELECT id
FROM attendance_cfg
WHERE project_id = a.projectid
AND com_id = a.comId
AND is_default = 1
AND enabled = 1
LIMIT 1
)
WHERE a.cfg_id IS NULL;