-- ===================================================== -- System Categories (for refund, reimbursement, etc.) -- ===================================================== INSERT INTO `system_categories` (`code`, `name`, `icon`, `type`, `is_system`) VALUES ('refund', '退款', 'mdi:cash-refund', 'income', 1), ('reimbursement', '报销', 'mdi:receipt-text-check', 'income', 1) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`), `icon`=VALUES(`icon`), `type`=VALUES(`type`); -- ===================================================== -- Default Categories Template Data -- These templates will be copied to new users on registration -- Icon names use Iconify format: mdi:icon-name -- Reference: https://icon-sets.iconify.design/mdi/ -- Colors use HEX format for realistic brand colors -- ===================================================== -- Clear existing template data (optional, for re-initialization) -- DELETE FROM `default_categories`; -- ===================================================== -- 支出类主分类 (Expense Parent Categories) -- ===================================================== INSERT INTO `default_categories` (`id`, `name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES -- 餐饮 (id=1) - 橙色系 (1, '餐饮', 'mdi:silverware-fork-knife', '#FF6B35', 'expense', NULL, 1, 1, NOW()), -- 交通 (id=2) - 蓝色系 (2, '交通', 'mdi:bus', '#3B82F6', 'expense', NULL, 2, 1, NOW()), -- 购物 (id=3) - 粉色系 (3, '购物', 'mdi:shopping', '#EC4899', 'expense', NULL, 3, 1, NOW()), -- 居住 (id=4) - 棕色系 (4, '居住', 'mdi:home', '#92400E', 'expense', NULL, 4, 1, NOW()), -- 娱乐 (id=5) - 紫色系 (5, '娱乐', 'mdi:gamepad-variant', '#8B5CF6', 'expense', NULL, 5, 1, NOW()), -- 医疗 (id=6) - 红色系 (6, '医疗', 'mdi:hospital-box', '#EF4444', 'expense', NULL, 6, 1, NOW()), -- 教育 (id=7) - 青色系 (7, '教育', 'mdi:school', '#06B6D4', 'expense', NULL, 7, 1, NOW()), -- 通讯 (id=8) - 蓝色系 (8, '通讯', 'mdi:cellphone', '#0EA5E9', 'expense', NULL, 8, 1, NOW()), -- 人情 (id=9) - 红色系 (9, '人情', 'mdi:gift', '#F43F5E', 'expense', NULL, 9, 1, NOW()), -- 金融 (id=10) - 金色系 (10, '金融', 'mdi:bank', '#F59E0B', 'expense', NULL, 10, 1, NOW()), -- 宠物 (id=11) - 棕色系 (11, '宠物', 'mdi:dog', '#A16207', 'expense', NULL, 11, 1, NOW()), -- 其他支出 (id=12) - 灰色系 (12, '其他支出', 'mdi:dots-horizontal-circle', '#6B7280', 'expense', NULL, 99, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`), `icon`=VALUES(`icon`), `color`=VALUES(`color`); -- ===================================================== -- 收入类主分类 (Income Parent Categories) -- ===================================================== INSERT INTO `default_categories` (`id`, `name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES -- 工作收入 (id=13) - 绿色系 (13, '工作收入', 'mdi:briefcase', '#10B981', 'income', NULL, 1, 1, NOW()), -- 投资收益 (id=14) - 金色系 (14, '投资收益', 'mdi:chart-line', '#F59E0B', 'income', NULL, 2, 1, NOW()), -- 被动收入 (id=15) - 紫色系 (15, '被动收入', 'mdi:cash-multiple', '#8B5CF6', 'income', NULL, 3, 1, NOW()), -- 其他收入 (id=16) - 蓝色系 (16, '其他收入', 'mdi:dots-horizontal-circle', '#3B82F6', 'income', NULL, 99, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`), `icon`=VALUES(`icon`), `color`=VALUES(`color`); -- ===================================================== -- 餐饮子分类 (parent_id = 1) -- ===================================================== INSERT INTO `default_categories` (`name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES ('早餐', 'mdi:food-croissant', '#FBBF24', 'expense', 1, 1, 1, NOW()), ('午餐', 'mdi:food', '#FB923C', 'expense', 1, 2, 1, NOW()), ('晚餐', 'mdi:food-turkey', '#F97316', 'expense', 1, 3, 1, NOW()), ('零食', 'mdi:cookie', '#FDE047', 'expense', 1, 4, 1, NOW()), ('饮料', 'mdi:coffee', '#A16207', 'expense', 1, 5, 1, NOW()), ('水果', 'mdi:fruit-grapes', '#84CC16', 'expense', 1, 6, 1, NOW()), ('外卖', 'mdi:bike-fast', '#EF4444', 'expense', 1, 7, 1, NOW()), ('聚餐', 'mdi:food-fork-drink', '#DC2626', 'expense', 1, 8, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`); -- ===================================================== -- 交通子分类 (parent_id = 2) -- ===================================================== INSERT INTO `default_categories` (`name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES ('地铁', 'mdi:subway-variant', '#3B82F6', 'expense', 2, 1, 1, NOW()), ('公交', 'mdi:bus', '#60A5FA', 'expense', 2, 2, 1, NOW()), ('打车', 'mdi:taxi', '#FBBF24', 'expense', 2, 3, 1, NOW()), ('滴滴出行', 'mdi:car-connected', '#FF6600', 'expense', 2, 4, 1, NOW()), ('加油', 'mdi:gas-station', '#EF4444', 'expense', 2, 5, 1, NOW()), ('停车', 'mdi:parking', '#6366F1', 'expense', 2, 6, 1, NOW()), ('高铁/火车', 'mdi:train', '#0369A1', 'expense', 2, 7, 1, NOW()), ('飞机', 'mdi:airplane', '#0EA5E9', 'expense', 2, 8, 1, NOW()), ('共享单车', 'mdi:bike', '#22C55E', 'expense', 2, 9, 1, NOW()), ('汽车保养', 'mdi:car-wrench', '#64748B', 'expense', 2, 10, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`); -- ===================================================== -- 购物子分类 (parent_id = 3) -- ===================================================== INSERT INTO `default_categories` (`name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES ('服饰', 'mdi:tshirt-crew', '#EC4899', 'expense', 3, 1, 1, NOW()), ('日用品', 'mdi:basket', '#F472B6', 'expense', 3, 2, 1, NOW()), ('电子数码', 'mdi:laptop', '#3B82F6', 'expense', 3, 3, 1, NOW()), ('美妆护肤', 'mdi:lipstick', '#F43F5E', 'expense', 3, 4, 1, NOW()), ('超市', 'mdi:cart', '#22C55E', 'expense', 3, 5, 1, NOW()), ('淘宝', 'mdi:shopping', '#FF4400', 'expense', 3, 6, 1, NOW()), ('京东', 'mdi:package-variant', '#E4002B', 'expense', 3, 7, 1, NOW()), ('拼多多', 'mdi:basket-outline', '#E02E24', 'expense', 3, 8, 1, NOW()), ('家电', 'mdi:television', '#0891B2', 'expense', 3, 9, 1, NOW()), ('母婴用品', 'mdi:baby-carriage', '#F9A8D4', 'expense', 3, 10, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`); -- ===================================================== -- 居住子分类 (parent_id = 4) -- ===================================================== INSERT INTO `default_categories` (`name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES ('房租', 'mdi:home-city', '#92400E', 'expense', 4, 1, 1, NOW()), ('房贷', 'mdi:bank', '#B45309', 'expense', 4, 2, 1, NOW()), ('水费', 'mdi:water', '#0EA5E9', 'expense', 4, 3, 1, NOW()), ('电费', 'mdi:flash', '#FBBF24', 'expense', 4, 4, 1, NOW()), ('燃气费', 'mdi:fire', '#F97316', 'expense', 4, 5, 1, NOW()), ('物业费', 'mdi:office-building', '#64748B', 'expense', 4, 6, 1, NOW()), ('宽带网络', 'mdi:wifi', '#3B82F6', 'expense', 4, 7, 1, NOW()), ('家居装修', 'mdi:hammer-wrench', '#A16207', 'expense', 4, 8, 1, NOW()), ('家政服务', 'mdi:broom', '#10B981', 'expense', 4, 9, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`); -- ===================================================== -- 娱乐子分类 (parent_id = 5) -- ===================================================== INSERT INTO `default_categories` (`name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES ('游戏', 'mdi:controller-classic', '#8B5CF6', 'expense', 5, 1, 1, NOW()), ('电影', 'mdi:movie-open', '#EF4444', 'expense', 5, 2, 1, NOW()), ('音乐', 'mdi:music', '#22C55E', 'expense', 5, 3, 1, NOW()), ('健身', 'mdi:dumbbell', '#F97316', 'expense', 5, 4, 1, NOW()), ('旅游', 'mdi:airplane', '#0EA5E9', 'expense', 5, 5, 1, NOW()), ('KTV', 'mdi:microphone', '#EC4899', 'expense', 5, 6, 1, NOW()), ('演唱会', 'mdi:party-popper', '#A855F7', 'expense', 5, 7, 1, NOW()), ('视频会员', 'mdi:youtube-subscription', '#EF4444', 'expense', 5, 8, 1, NOW()), ('网易云音乐', 'mdi:music-box', '#E60026', 'expense', 5, 9, 1, NOW()), ('B站', 'mdi:video', '#FB7299', 'expense', 5, 10, 1, NOW()), ('运动', 'mdi:soccer', '#22C55E', 'expense', 5, 11, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`); -- ===================================================== -- 医疗子分类 (parent_id = 6) -- ===================================================== INSERT INTO `default_categories` (`name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES ('门诊', 'mdi:stethoscope', '#EF4444', 'expense', 6, 1, 1, NOW()), ('药品', 'mdi:pill', '#F87171', 'expense', 6, 2, 1, NOW()), ('体检', 'mdi:clipboard-pulse', '#06B6D4', 'expense', 6, 3, 1, NOW()), ('住院', 'mdi:hospital-building', '#DC2626', 'expense', 6, 4, 1, NOW()), ('保健品', 'mdi:heart-pulse', '#F43F5E', 'expense', 6, 5, 1, NOW()), ('医疗保险', 'mdi:shield-plus', '#3B82F6', 'expense', 6, 6, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`); -- ===================================================== -- 教育子分类 (parent_id = 7) -- ===================================================== INSERT INTO `default_categories` (`name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES ('培训班', 'mdi:teach', '#06B6D4', 'expense', 7, 1, 1, NOW()), ('书籍', 'mdi:book-open-page-variant', '#92400E', 'expense', 7, 2, 1, NOW()), ('网课', 'mdi:laptop', '#8B5CF6', 'expense', 7, 3, 1, NOW()), ('考试报名', 'mdi:file-document-edit', '#64748B', 'expense', 7, 4, 1, NOW()), ('学费', 'mdi:school', '#3B82F6', 'expense', 7, 5, 1, NOW()), ('文具', 'mdi:pencil', '#FBBF24', 'expense', 7, 6, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`); -- ===================================================== -- 通讯子分类 (parent_id = 8) -- ===================================================== INSERT INTO `default_categories` (`name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES ('话费', 'mdi:phone', '#0EA5E9', 'expense', 8, 1, 1, NOW()), ('流量', 'mdi:signal-4g', '#3B82F6', 'expense', 8, 2, 1, NOW()), ('微信会员', 'mdi:wechat', '#07C160', 'expense', 8, 3, 1, NOW()), ('QQ会员', 'mdi:qqchat', '#12B7F5', 'expense', 8, 4, 1, NOW()), ('云服务', 'mdi:cloud', '#6366F1', 'expense', 8, 5, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`); -- ===================================================== -- 人情子分类 (parent_id = 9) -- ===================================================== INSERT INTO `default_categories` (`name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES ('微信红包', 'mdi:wechat', '#07C160', 'expense', 9, 1, 1, NOW()), ('支付宝红包', 'mdi:web', '#1677FF', 'expense', 9, 2, 1, NOW()), ('礼物', 'mdi:gift-outline', '#F43F5E', 'expense', 9, 3, 1, NOW()), ('请客吃饭', 'mdi:food-fork-drink', '#F97316', 'expense', 9, 4, 1, NOW()), ('份子钱', 'mdi:hand-heart', '#EC4899', 'expense', 9, 5, 1, NOW()), ('孝敬长辈', 'mdi:account-heart', '#EF4444', 'expense', 9, 6, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`); -- ===================================================== -- 金融子分类 (parent_id = 10) -- ===================================================== INSERT INTO `default_categories` (`name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES ('信用卡还款', 'mdi:credit-card', '#6366F1', 'expense', 10, 1, 1, NOW()), ('借款还款', 'mdi:cash-refund', '#EF4444', 'expense', 10, 2, 1, NOW()), ('花呗还款', 'mdi:web', '#1677FF', 'expense', 10, 3, 1, NOW()), ('白条还款', 'mdi:package-variant', '#E4002B', 'expense', 10, 4, 1, NOW()), ('保险费', 'mdi:shield-check', '#0EA5E9', 'expense', 10, 5, 1, NOW()), ('投资亏损', 'mdi:chart-line-variant', '#DC2626', 'expense', 10, 6, 1, NOW()), ('手续费', 'mdi:percent', '#64748B', 'expense', 10, 7, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`); -- ===================================================== -- 宠物子分类 (parent_id = 11) -- ===================================================== INSERT INTO `default_categories` (`name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES ('宠物食品', 'mdi:food-drumstick', '#A16207', 'expense', 11, 1, 1, NOW()), ('宠物用品', 'mdi:paw', '#D97706', 'expense', 11, 2, 1, NOW()), ('宠物医疗', 'mdi:hospital-marker', '#EF4444', 'expense', 11, 3, 1, NOW()), ('宠物美容', 'mdi:content-cut', '#EC4899', 'expense', 11, 4, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`); -- ===================================================== -- 工作收入子分类 (parent_id = 13) -- ===================================================== INSERT INTO `default_categories` (`name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES ('工资', 'mdi:briefcase', '#10B981', 'income', 13, 1, 1, NOW()), ('奖金', 'mdi:trophy', '#FBBF24', 'income', 13, 2, 1, NOW()), ('年终奖', 'mdi:gift', '#F59E0B', 'income', 13, 3, 1, NOW()), ('加班费', 'mdi:clock-time-four', '#3B82F6', 'income', 13, 4, 1, NOW()), ('兼职', 'mdi:briefcase-clock', '#8B5CF6', 'income', 13, 5, 1, NOW()), ('提成', 'mdi:percent', '#22C55E', 'income', 13, 6, 1, NOW()), ('稿费', 'mdi:pencil', '#F97316', 'income', 13, 7, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`); -- ===================================================== -- 投资收益子分类 (parent_id = 14) -- ===================================================== INSERT INTO `default_categories` (`name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES ('股票收益', 'mdi:chart-areaspline', '#EF4444', 'income', 14, 1, 1, NOW()), ('基金收益', 'mdi:chart-bell-curve-cumulative', '#8B5CF6', 'income', 14, 2, 1, NOW()), ('余额宝', 'mdi:wallet', '#1677FF', 'income', 14, 3, 1, NOW()), ('理财产品', 'mdi:cash-multiple', '#F59E0B', 'income', 14, 4, 1, NOW()), ('银行利息', 'mdi:bank', '#3B82F6', 'income', 14, 5, 1, NOW()), ('数字货币', 'mdi:bitcoin', '#F7931A', 'income', 14, 6, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`); -- ===================================================== -- 被动收入子分类 (parent_id = 15) -- ===================================================== INSERT INTO `default_categories` (`name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES ('房租收入', 'mdi:home-city', '#92400E', 'income', 15, 1, 1, NOW()), ('分红', 'mdi:cash-plus', '#22C55E', 'income', 15, 2, 1, NOW()), ('版权收入', 'mdi:copyright', '#6366F1', 'income', 15, 3, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`); -- ===================================================== -- 其他收入子分类 (parent_id = 16) -- ===================================================== INSERT INTO `default_categories` (`name`, `icon`, `color`, `type`, `parent_id`, `sort_order`, `is_active`, `created_at`) VALUES ('微信红包', 'mdi:wechat', '#07C160', 'income', 16, 1, 1, NOW()), ('支付宝红包', 'mdi:web', '#1677FF', 'income', 16, 2, 1, NOW()), ('报销', 'mdi:receipt-text-check', '#10B981', 'income', 16, 3, 1, NOW()), ('退款', 'mdi:cash-refund', '#3B82F6', 'income', 16, 4, 1, NOW()), ('中奖', 'mdi:star-shooting', '#F59E0B', 'income', 16, 5, 1, NOW()), ('闲鱼', 'mdi:fishbowl', '#FBBF24', 'income', 16, 6, 1, NOW()), ('借款收回', 'mdi:cash-check', '#22C55E', 'income', 16, 7, 1, NOW()), ('其他', 'mdi:dots-horizontal', '#6B7280', 'income', 16, 99, 1, NOW()) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`);