guoyu/Study-Vue-redis/log/Sql/验证字典数据状态.sql
2025-12-03 18:58:36 +08:00

29 lines
833 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.

-- ============================================
-- 验证学员状态字典数据
-- 检查字典数据的status字段是否为'0'(启用状态)
-- ============================================
-- 查询所有学员状态字典数据包括status字段
SELECT
`dict_sort`,
`dict_label`,
`dict_value`,
`dict_type`,
`status`,
`remark`,
CASE
WHEN `status` = '0' THEN '✅ 启用'
WHEN `status` = '1' THEN '❌ 停用'
ELSE '⚠️ 未知状态'
END AS ``
FROM `sys_dict_data`
WHERE `dict_type` = 'study_student_status'
ORDER BY `dict_sort`;
-- 如果发现有status不为'0'的字典执行下面的SQL更新为启用状态
-- UPDATE `sys_dict_data`
-- SET `status` = '0'
-- WHERE `dict_type` = 'study_student_status'
-- AND `status` != '0';