Files
group_xinghuo_jinrong/scripts/core/02-seed-base.sql
T

75 lines
3.5 KiB
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.
USE jinrong_core;
-- 客户风险等级 C1~C5
INSERT INTO core_risk_grade (code, grade_type, display_name, sort_order) VALUES
('C1', 'customer', '保守型 C1', 1),
('C2', 'customer', '稳健型 C2', 2),
('C3', 'customer', '平衡型 C3', 3),
('C4', 'customer', '成长型 C4', 4),
('C5', 'customer', '进取型 C5', 5);
-- 产品风险等级 R1~R5
INSERT INTO core_risk_grade (code, grade_type, display_name, sort_order) VALUES
('R1', 'product', '低风险 R1', 1),
('R2', 'product', '中低风险 R2', 2),
('R3', 'product', '中风险 R3', 3),
('R4', 'product', '中高风险 R4', 4),
('R5', 'product', '高风险 R5', 5);
INSERT INTO core_industry (industry_code, industry_name) VALUES
('IND-BOND', '债券固收'),
('IND-MIX', '混合平衡'),
('IND-TECH', '科技成长'),
('IND-CONS', '消费'),
('IND-MED', '医药健康'),
('IND-INDEX', '宽基指数'),
('IND-MONEY', '货币现金');
-- ========== 内部员工 · RBAC 种子 ==========
-- 5 理财代理人
INSERT INTO core_staff (staff_id, display_name, staff_type, roles) VALUES
('STAFF-10086', '张理财', 'advisor', '["advisor"]'),
('STAFF-10087', '李顾问', 'advisor', '["advisor"]'),
('STAFF-10088', '王经理', 'advisor', '["advisor"]'),
('STAFF-10089', '赵专员', 'advisor', '["advisor"]'),
('STAFF-10090', '刘助理', 'advisor', '["advisor"]');
-- 2 数据分析员
INSERT INTO core_staff (staff_id, display_name, staff_type, roles) VALUES
('STAFF-20001', '陈分析', 'analyst', '["analyst"]'),
('STAFF-20002', '周数据', 'analyst', '["analyst"]');
-- 2 风控专员
INSERT INTO core_staff (staff_id, display_name, staff_type, roles) VALUES
('STAFF-30001', '吴风控', 'risk_officer', '["risk_officer"]'),
('STAFF-30002', '郑监测', 'risk_officer', '["risk_officer"]');
-- 1 风控演示账号(网关演示用,roles 含 risk_demo · 见 docs/PRD/PRD-风控监测Agent.md §10.1)
INSERT INTO core_staff (staff_id, display_name, staff_type, roles) VALUES
('STAFF-90001', '风控演示账号', 'risk_officer', '["risk_officer", "risk_demo"]');
-- 2 合规专员(兼 advisor 审计台场景用 compliance 单角色)
INSERT INTO core_staff (staff_id, display_name, staff_type, roles) VALUES
('STAFF-40001', '孙合规', 'compliance', '["compliance"]'),
('STAFF-40002', '钱监察', 'compliance', '["compliance"]');
-- 1 运营 + 1 双角色(代理人+合规,测权限并集与归属最窄)
INSERT INTO core_staff (staff_id, display_name, staff_type, roles) VALUES
('STAFF-50001', '冯运营', 'ops', '["ops"]'),
('STAFF-10091', '双角色顾问', 'advisor', '["advisor", "compliance"]');
-- ========== 产品 12 只 ==========
INSERT INTO core_product (product_id, product_name, product_type, min_risk_code, industry_code, fee_rate) VALUES
('PROD-110022', '稳健债基 A', 'bond', 'R1', 'IND-BOND', 0.0030),
('PROD-110023', '信用债精选', 'bond', 'R2', 'IND-BOND', 0.0040),
('PROD-005827', '平衡混合一号', 'mixed', 'R3', 'IND-MIX', 0.0150),
('PROD-005828', '稳健增利混合', 'mixed', 'R2', 'IND-MIX', 0.0120),
('PROD-161725', '科技成长主题', 'stock', 'R4', 'IND-TECH', 0.0150),
('PROD-161726', '消费升级主题', 'stock', 'R4', 'IND-CONS', 0.0150),
('PROD-003095', '医药健康精选', 'stock', 'R4', 'IND-MED', 0.0120),
('PROD-510300', '沪深300指数', 'index', 'R3', 'IND-INDEX', 0.0050),
('PROD-510500', '中证500指数', 'index', 'R4', 'IND-INDEX', 0.0060),
('PROD-XYZ999', '进取成长五号', 'stock', 'R5', 'IND-TECH', 0.0180),
('PROD-000001', '现金宝货币', 'money', 'R1', 'IND-MONEY', 0.0010),
('PROD-000002', '同业存单基金', 'bond', 'R1', 'IND-BOND', 0.0020);