39 lines
1.4 KiB
Go
39 lines
1.4 KiB
Go
|
|
package hr
|
||
|
|
|
||
|
|
import (
|
||
|
|
"WiiGoLibrary/framework/db/v1/utils/mssql/unique"
|
||
|
|
"WiiGoLibrary/framework/db/v1/utils/tool"
|
||
|
|
"WiiGoLibrary/framework/hub/v1/dblib"
|
||
|
|
"time"
|
||
|
|
)
|
||
|
|
|
||
|
|
const StaffTable = "hr_u_staff"
|
||
|
|
|
||
|
|
type StaffModel struct {
|
||
|
|
RecordGuid unique.UUID `gorm:"column:RecordGuid;type:UNIQUEIDENTIFIER;primaryKey;not null;default:newid();" json:"RecordGuid"`
|
||
|
|
UserGuid unique.UUID `gorm:"column:UserGuid;type:UNIQUEIDENTIFIER;" json:"UserGuid"`
|
||
|
|
Account string `gorm:"column:Account;type:NVARCHAR(50);" json:"Account"`
|
||
|
|
StaffName string `gorm:"column:StaffName;type:NVARCHAR(50);" json:"StaffName"`
|
||
|
|
JobID int64 `gorm:"column:JobID;type:BIGINT;not null;" json:"JobID"`
|
||
|
|
RecordType int16 `gorm:"column:RecordType;not null;" json:"RecordType"`
|
||
|
|
RecordStatus int16 `gorm:"column:RecordStatus;not null;default:0;" json:"RecordStatus"`
|
||
|
|
CreateTime time.Time `gorm:"column:CreateTime;type:DATETIME;default:CURRENT_TIMESTAMP;<-:create;" json:"CreateTime"`
|
||
|
|
UpdateTime time.Time `gorm:"column:UpdateTime;type:DATETIME;default:CURRENT_TIMESTAMP;autoUpdateTime;" json:"UpdateTime"`
|
||
|
|
}
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
dblib.DBIns.RegisterAutoMigrateModel(&StaffModel{})
|
||
|
|
}
|
||
|
|
func (am *StaffModel) TableName() string {
|
||
|
|
return StaffTable
|
||
|
|
}
|
||
|
|
func StaffInstance() *StaffModel {
|
||
|
|
return &StaffModel{
|
||
|
|
RecordGuid: unique.NewV4(),
|
||
|
|
UserGuid: unique.NilUUID,
|
||
|
|
JobID: tool.GenerateID(),
|
||
|
|
RecordType: 0,
|
||
|
|
RecordStatus: 0,
|
||
|
|
}
|
||
|
|
}
|