2026-07-27 00:18:42 +08:00
|
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"git.apinb.com/bsm-sdk/core/database"
|
|
|
|
|
|
"time"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// FinSettlement 对应 fin_settlement,保存结算单。
|
|
|
|
|
|
type FinSettlement struct {
|
2026-07-27 12:02:08 +08:00
|
|
|
|
Entity // 公共实体字段
|
2026-07-29 14:03:10 +08:00
|
|
|
|
SettlementNo string `gorm:"column:settlement_no;type:varchar(64);not null;uniqueIndex" json:"settlement_no"` // settlement_no 业务字段
|
|
|
|
|
|
SubjectType string `gorm:"column:subject_type;type:varchar(32);not null" json:"subject_type"` // subject_type 业务字段
|
|
|
|
|
|
SubjectID uint64 `gorm:"column:subject_id;not null;index" json:"subject_id"` // subject_id 业务字段
|
|
|
|
|
|
PeriodStart time.Time `gorm:"column:period_start;type:timestamptz;not null" json:"period_start"` // period_start 业务字段
|
|
|
|
|
|
PeriodEnd time.Time `gorm:"column:period_end;type:timestamptz;not null;check:period_end > period_start" json:"period_end"` // period_end 业务字段
|
2026-07-27 00:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func init() { database.AppendMigrate(&FinSettlement{}) }
|
|
|
|
|
|
func (table *FinSettlement) TableName() string { return "fin_settlement" }
|