36 lines
1.6 KiB
Go
36 lines
1.6 KiB
Go
|
|
package hr
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"WiiGoLibrary/framework/db/v1/utils/mssql/unique"
|
|||
|
|
"WiiGoLibrary/framework/hub/v1/dblib"
|
|||
|
|
"time"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
const Staff2OrganizationTable = "hr_r_staff2organization"
|
|||
|
|
|
|||
|
|
type Staff2OrganizationModel struct {
|
|||
|
|
RecordGuid unique.UUID `gorm:"column:RecordGuid;type:UNIQUEIDENTIFIER;primaryKey;not null;default:newid();" json:"RecordGuid"`
|
|||
|
|
ObjectGuid unique.UUID `gorm:"column:ObjectGuid;type:UNIQUEIDENTIFIER;not null;" json:"ObjectGuid"` // staff guid
|
|||
|
|
TargetGuid unique.UUID `gorm:"column:TargetGuid;type:UNIQUEIDENTIFIER;not null;" json:"TargetGuid"` // organization guid
|
|||
|
|
PositionGuid unique.UUID `gorm:"column:PositionGuid;type:UNIQUEIDENTIFIER;" json:"PositionGuid"` // position guid
|
|||
|
|
IsLeader bool `gorm:"column:IsLeader;type:BIT;default:0;" json:"IsLeader"` // 是否是组织负责人
|
|||
|
|
RecordType int16 `gorm:"column:RecordType;not null;" json:"RecordType"` // 0-主部门/岗位,1-兼职部门/岗位
|
|||
|
|
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(&Staff2OrganizationModel{})
|
|||
|
|
}
|
|||
|
|
func (am *Staff2OrganizationModel) TableName() string {
|
|||
|
|
return Staff2OrganizationTable
|
|||
|
|
}
|
|||
|
|
func Staff2OrganizationInstance() *Staff2OrganizationModel {
|
|||
|
|
return &Staff2OrganizationModel{
|
|||
|
|
RecordGuid: unique.NewV4(),
|
|||
|
|
RecordType: 0,
|
|||
|
|
RecordStatus: 0,
|
|||
|
|
}
|
|||
|
|
}
|