# school_salary 表文档 ## 表概述 **表名**: school_salary **功能**: 薪资管理表,负责管理教务系统中员工的薪资计算、发放状态、绩效奖金、扣款项目等薪资管理功能 ## 字段说明 ``` Field Type Collation Null Key Default Extra Privileges Comment id int NULL NO PRI NULL auto_increment select,insert,update,references 工资编号 staff_id int NULL NO MUL NULL select,insert,update,references 员工ID base_salary decimal(10,2) NULL NO NULL select,insert,update,references 底薪 performance_bonus decimal(10,2) NULL YES NULL select,insert,update,references 销售绩效 deductions decimal(10,2) NULL NO NULL select,insert,update,references 扣款 other_subsidies decimal(10,2) NULL YES 0.00 select,insert,update,references 其他补贴 payment_status enum('pending','paid') utf8mb4_general_ci NO NULL select,insert,update,references 发放状态: pending-待发放, paid-已发放 payment_method enum('bank_transfer','cash') utf8mb4_general_ci YES NULL select,insert,update,references 发放方式: bank_transfer-银行转账, cash-现金 remarks text utf8mb4_general_ci YES NULL select,insert,update,references 备注 salary_month date NULL NO NULL select,insert,update,references 工资月份 department_id int NULL YES NULL select,insert,update,references 部门ID campus_id int NULL YES MUL NULL select,insert,update,references 校区ID process_id int NULL YES MUL NULL select,insert,update,references 关联的审批流程ID created_at timestamp NULL YES CURRENT_TIMESTAMP DEFAULT_GENERATED select,insert,update,references 创建时间 updated_at timestamp NULL YES CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP select,insert,update,references 修改时间 status int NULL NO MUL 1 select,insert,update,references 已核算状态:1未核算 2已核算 attendance decimal(4,2) NULL YES NULL select,insert,update,references 出勤天数 work_salary decimal(10,2) NULL YES NULL select,insert,update,references 出勤工资 mgr_performance decimal(10,2) NULL YES NULL select,insert,update,references 管理绩效 social_security decimal(10,2) NULL YES NULL select,insert,update,references 社保 individual_income_tax decimal(10,2) NULL YES NULL select,insert,update,references 个税 gross_salary decimal(10,2) NULL YES NULL select,insert,update,references 应发工资 net_salary decimal(10,2) NULL YES NULL select,insert,update,references 实发工资 full_attendance_days tinyint NULL YES NULL select,insert,update,references 满勤天数 ``` ## 功能用途 ### 主要功能 - **薪资结构管理**: 管理底薪、绩效奖金、补贴等薪资组成部分 - **薪资计算**: 自动计算应发工资和实发工资 - **扣款管理**: 管理社保、个税、其他扣款项目 - **发放状态跟踪**: 跟踪薪资的发放状态和发放方式 - **考勤关联**: 基于考勤数据计算出勤工资 - **绩效集成**: 集成销售绩效和管理绩效 - **审批流程**: 支持薪资审批流程管理 - **多维度统计**: 按月份、部门、校区进行薪资统计 - **核算状态**: 跟踪薪资的核算和确认状态 ### 业务场景 - **月度薪资**: 每月定期计算和发放员工薪资 - **绩效奖励**: 根据业绩表现发放绩效奖金 - **考勤薪资**: 基于实际出勤计算薪资 - **薪资审批**: 薪资发放前的审批流程 - **财务核算**: 薪资成本的财务核算和统计 - **税务申报**: 个税计算和申报 - **社保缴费**: 社保费用的计算和缴纳 - **薪资调整**: 员工薪资结构的调整和变更 - **报表分析**: 薪资成本分析和人力成本控制 ## 关联关系 ### 主要关联表 - `school_personnel`: 人员信息表 (staff_id) - `school_campus`: 校区信息表 (campus_id) - `school_department`: 部门信息表 (department_id) - `school_attendance`: 考勤信息表 (考勤数据关联) - `school_performance_records`: 绩效记录表 (绩效数据关联) - `school_approval_process`: 审批流程表 (process_id) - `school_salary_adjustment`: 薪资调整表 (薪资变更记录) - `school_tax_record`: 税务记录表 (个税申报) ### 关联说明 - **员工关联**: staff_id关联具体员工,确定薪资归属 - **校区关联**: campus_id确定员工所属校区,支持分校区薪资管理 - **部门关联**: department_id关联员工部门,支持部门薪资统计 - **考勤关联**: 通过考勤数据计算出勤天数和出勤工资 - **绩效关联**: 集成绩效记录计算绩效奖金 - **审批关联**: process_id关联薪资审批流程 - **财务关联**: 与财务系统集成进行成本核算 ## 索引建议 - **主键索引**: id (已存在) - **外键索引**: - staff_id (已存在,员工薪资查询) - campus_id (已存在,校区薪资查询) - process_id (已存在,审批流程查询) - **业务索引**: - payment_status (发放状态查询) - status (已存在,核算状态查询) - salary_month (薪资月份查询) - department_id (部门薪资查询) - **复合索引**: - (staff_id, salary_month) (员工月度薪资查询) - (campus_id, salary_month) (校区月度薪资统计) - (department_id, salary_month) (部门月度薪资统计) - (payment_status, salary_month) (月度发放状态查询) - (status, salary_month) (月度核算状态查询) - **时间索引**: - created_at (创建时间查询) - updated_at (更新时间查询) ## 注意事项 - **金额精度**: 所有金额字段使用decimal(10,2)确保财务精度 - **薪资计算**: gross_salary = base_salary + performance_bonus + mgr_performance + other_subsidies - **实发计算**: net_salary = gross_salary - deductions - social_security - individual_income_tax - **状态流转**: payment_status从pending到paid需要严格控制 - **核算状态**: status字段控制薪资的核算确认流程 - **月份唯一性**: 同一员工同一月份只能有一条薪资记录 - **考勤关联**: attendance字段需要与考勤表数据保持一致 - **绩效同步**: performance_bonus需要与绩效记录表同步 - **审批流程**: 薪资发放前必须完成相应的审批流程 - **权限控制**: 薪资信息访问需要严格的权限控制 - **数据安全**: 薪资数据属于敏感信息,需要加密存储和传输 - **税务合规**: individual_income_tax计算需要符合税法规定 - **社保计算**: social_security需要按照社保政策计算 - **发放记录**: 薪资发放后需要保留完整的发放记录 - **调薪处理**: 薪资调整需要记录调整原因和审批信息 - **财务对账**: 薪资数据需要与财务系统定期对账 - **备份恢复**: 薪资数据需要定期备份和灾难恢复机制