20 lines
1.1 KiB
Go
20 lines
1.1 KiB
Go
package models
|
||
|
||
import (
|
||
"git.apinb.com/bsm-sdk/core/database"
|
||
"time"
|
||
)
|
||
|
||
// FinSettlement 对应 fin_settlement,保存结算单。
|
||
type FinSettlement struct {
|
||
Entity // 公共实体字段
|
||
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 业务字段
|
||
}
|
||
|
||
func init() { database.AppendMigrate(&FinSettlement{}) }
|
||
func (table *FinSettlement) TableName() string { return "fin_settlement" }
|