Files
yunzerwebsiteallinone/go/models/backend_oa_compensation.go
2026-08-29 22:06:00 +08:00

98 lines
8.1 KiB
Go

package models
import "time"
// BackendOaCompensationScheme 员工薪酬方案表 yz_backend_oa_compensation_schemes。
// 一个员工可保留多份历史方案,生效中的方案由 effective_date 与 status 共同决定。
type BackendOaCompensationScheme struct {
ID uint64 `orm:"column(id);pk;auto" json:"id"`
Tid uint64 `orm:"column(tid)" json:"tid"`
EmployeeID uint64 `orm:"column(employee_id)" json:"employee_id"`
SchemeName string `orm:"column(scheme_name);size(100)" json:"scheme_name"`
EffectiveDate time.Time `orm:"column(effective_date);type(date)" json:"effective_date"`
ExpiryDate *time.Time `orm:"column(expiry_date);null;type(date)" json:"expiry_date"`
BaseSalary float64 `orm:"column(base_salary);type(decimal);digits(12);decimals(2);default(0)" json:"base_salary"`
PostAllowance float64 `orm:"column(post_allowance);type(decimal);digits(12);decimals(2);default(0)" json:"post_allowance"`
PerformanceSalary float64 `orm:"column(performance_salary);type(decimal);digits(12);decimals(2);default(0)" json:"performance_salary"`
TransportAllowance float64 `orm:"column(transport_allowance);type(decimal);digits(12);decimals(2);default(0)" json:"transport_allowance"`
MealAllowance float64 `orm:"column(meal_allowance);type(decimal);digits(12);decimals(2);default(0)" json:"meal_allowance"`
CommunicationAllowance float64 `orm:"column(communication_allowance);type(decimal);digits(12);decimals(2);default(0)" json:"communication_allowance"`
SocialInsuranceBase float64 `orm:"column(social_insurance_base);type(decimal);digits(12);decimals(2);default(0)" json:"social_insurance_base"`
HousingFundBase float64 `orm:"column(housing_fund_base);type(decimal);digits(12);decimals(2);default(0)" json:"housing_fund_base"`
SocialInsuranceRate float64 `orm:"column(social_insurance_rate);type(decimal);digits(6);decimals(4);default(0)" json:"social_insurance_rate"`
HousingFundRate float64 `orm:"column(housing_fund_rate);type(decimal);digits(6);decimals(4);default(0)" json:"housing_fund_rate"`
Status int8 `orm:"column(status);default(1)" json:"status"`
Remark string `orm:"column(remark);type(text);null" json:"remark"`
IsDeleted int8 `orm:"column(is_deleted);default(0)" json:"is_deleted"`
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
UpdateTime *time.Time `orm:"column(update_time);null;type(datetime)" json:"update_time"`
DeleteTime *time.Time `orm:"column(delete_time);null;type(datetime)" json:"delete_time"`
}
func (m *BackendOaCompensationScheme) TableName() string {
return "yz_backend_oa_compensation_schemes"
}
// BackendOaPayroll 月度薪资单主表 yz_backend_oa_compensation_payrolls。
// EmployeeName / Department / Position 为生成时的快照,避免组织架构变更影响历史工资单。
type BackendOaPayroll struct {
ID uint64 `orm:"column(id);pk;auto" json:"id"`
Tid uint64 `orm:"column(tid)" json:"tid"`
EmployeeID uint64 `orm:"column(employee_id)" json:"employee_id"`
SchemeID *uint64 `orm:"column(scheme_id);null" json:"scheme_id"`
PayrollMonth string `orm:"column(payroll_month);size(7)" json:"payroll_month"`
EmployeeName string `orm:"column(employee_name);size(50)" json:"employee_name"`
Department string `orm:"column(department);size(100)" json:"department"`
Position string `orm:"column(position);size(100)" json:"position"`
BaseSalary float64 `orm:"column(base_salary);type(decimal);digits(12);decimals(2);default(0)" json:"base_salary"`
PostAllowance float64 `orm:"column(post_allowance);type(decimal);digits(12);decimals(2);default(0)" json:"post_allowance"`
PerformanceSalary float64 `orm:"column(performance_salary);type(decimal);digits(12);decimals(2);default(0)" json:"performance_salary"`
TransportAllowance float64 `orm:"column(transport_allowance);type(decimal);digits(12);decimals(2);default(0)" json:"transport_allowance"`
MealAllowance float64 `orm:"column(meal_allowance);type(decimal);digits(12);decimals(2);default(0)" json:"meal_allowance"`
CommunicationAllowance float64 `orm:"column(communication_allowance);type(decimal);digits(12);decimals(2);default(0)" json:"communication_allowance"`
OvertimePay float64 `orm:"column(overtime_pay);type(decimal);digits(12);decimals(2);default(0)" json:"overtime_pay"`
Bonus float64 `orm:"column(bonus);type(decimal);digits(12);decimals(2);default(0)" json:"bonus"`
OtherAddition float64 `orm:"column(other_addition);type(decimal);digits(12);decimals(2);default(0)" json:"other_addition"`
LeaveDeduction float64 `orm:"column(leave_deduction);type(decimal);digits(12);decimals(2);default(0)" json:"leave_deduction"`
LateDeduction float64 `orm:"column(late_deduction);type(decimal);digits(12);decimals(2);default(0)" json:"late_deduction"`
OtherDeduction float64 `orm:"column(other_deduction);type(decimal);digits(12);decimals(2);default(0)" json:"other_deduction"`
SocialInsurance float64 `orm:"column(social_insurance);type(decimal);digits(12);decimals(2);default(0)" json:"social_insurance"`
HousingFund float64 `orm:"column(housing_fund);type(decimal);digits(12);decimals(2);default(0)" json:"housing_fund"`
PersonalIncomeTax float64 `orm:"column(personal_income_tax);type(decimal);digits(12);decimals(2);default(0)" json:"personal_income_tax"`
GrossSalary float64 `orm:"column(gross_salary);type(decimal);digits(12);decimals(2);default(0)" json:"gross_salary"`
TotalDeduction float64 `orm:"column(total_deduction);type(decimal);digits(12);decimals(2);default(0)" json:"total_deduction"`
NetSalary float64 `orm:"column(net_salary);type(decimal);digits(12);decimals(2);default(0)" json:"net_salary"`
Status int8 `orm:"column(status);default(0)" json:"status"`
ConfirmedAt *time.Time `orm:"column(confirmed_at);null;type(datetime)" json:"confirmed_at"`
PaidAt *time.Time `orm:"column(paid_at);null;type(datetime)" json:"paid_at"`
Remark string `orm:"column(remark);type(text);null" json:"remark"`
IsDeleted int8 `orm:"column(is_deleted);default(0)" json:"is_deleted"`
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
UpdateTime *time.Time `orm:"column(update_time);null;type(datetime)" json:"update_time"`
DeleteTime *time.Time `orm:"column(delete_time);null;type(datetime)" json:"delete_time"`
}
func (m *BackendOaPayroll) TableName() string {
return "yz_backend_oa_compensation_payrolls"
}
// BackendOaPayrollItem 薪资单自定义增减项 yz_backend_oa_compensation_payroll_items。
type BackendOaPayrollItem struct {
ID uint64 `orm:"column(id);pk;auto" json:"id"`
Tid uint64 `orm:"column(tid)" json:"tid"`
PayrollID uint64 `orm:"column(payroll_id)" json:"payroll_id"`
ItemName string `orm:"column(item_name);size(100)" json:"item_name"`
ItemType int8 `orm:"column(item_type);default(1)" json:"item_type"`
Amount float64 `orm:"column(amount);type(decimal);digits(12);decimals(2);default(0)" json:"amount"`
Remark string `orm:"column(remark);size(500);null" json:"remark"`
SortOrder int `orm:"column(sort_order);default(0)" json:"sort_order"`
IsDeleted int8 `orm:"column(is_deleted);default(0)" json:"is_deleted"`
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
UpdateTime *time.Time `orm:"column(update_time);null;type(datetime)" json:"update_time"`
DeleteTime *time.Time `orm:"column(delete_time);null;type(datetime)" json:"delete_time"`
}
func (m *BackendOaPayrollItem) TableName() string {
return "yz_backend_oa_compensation_payroll_items"
}