Documentation ¶
Index ¶
- Variables
- func UpdateCreateDate(domain interface{}) error
- type Bus
- type BusBrand
- type ChargeRecord
- func (*ChargeRecord) BeforeCreate(scope *gorm.Scope) error
- func (chargeRecord *ChargeRecord) Create() error
- func (ChargeRecord) Query(query map[string]interface{}) []ChargeRecord
- func (ChargeRecord) QueryAll() []ChargeRecord
- func (chargeRecord *ChargeRecord) QueryByID() error
- func (chargeRecord *ChargeRecord) Update() error
- type Department
- type Dictionary
- type Domain
- type DriverType
- type JobType
- type LineFareIncome
- type Staff
- func (*Staff) BeforeCreate(scope *gorm.Scope) error
- func (staff *Staff) Create() error
- func (staff Staff) IsQualified() (result bool)
- func (staff Staff) NeedUpgrade() (result bool)
- func (Staff) Query(query map[string]interface{}, isNot bool) []Staff
- func (staff Staff) QueryByJoin(joins, conditions []string) []Staff
- func (staff *Staff) QueryUnique() error
- func (staff Staff) String() string
- func (staff *Staff) Update() error
- func (staff *Staff) UpdateToResign() error
- type StaffResign
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Gdb *gorm.DB
)
View Source
var RecordAlreadyExistError error = errors.New("domain: create new record failed, this record already exist.")
View Source
var RecordNotFoundError error = errors.New("domain: record not found in DB.")
Functions ¶
func UpdateCreateDate ¶
func UpdateCreateDate(domain interface{}) error
Types ¶
type Bus ¶
type Bus struct { Domain BusLicense string CustomId string RegisterDate time.Time VehicleIDNumber string `gorm:"column:VIN"` EngineNo string PersonsCapacity int BrandID string BusBrand BusBrand `gorm:"save_associations:false"` }
func (*Bus) QueryByLicense ¶
type ChargeRecord ¶
type ChargeRecord struct { Domain RecordStaffID string RecordStaff Staff BusID string Bus Bus RecordDate time.Time Mileage float32 ChargedTWH float32 `gorm:"column:charged_TWH"` RemainPercent float32 FinalPercent float32 }
func (*ChargeRecord) BeforeCreate ¶
func (*ChargeRecord) BeforeCreate(scope *gorm.Scope) error
func (*ChargeRecord) Create ¶
func (chargeRecord *ChargeRecord) Create() error
func (ChargeRecord) Query ¶
func (ChargeRecord) Query(query map[string]interface{}) []ChargeRecord
func (ChargeRecord) QueryAll ¶
func (ChargeRecord) QueryAll() []ChargeRecord
func (*ChargeRecord) QueryByID ¶
func (chargeRecord *ChargeRecord) QueryByID() error
func (*ChargeRecord) Update ¶
func (chargeRecord *ChargeRecord) Update() error
type Department ¶
type Department Dictionary
func (*Department) Create ¶
func (department *Department) Create() error
func (Department) QueryAll ¶
func (Department) QueryAll() []Department
func (Department) TableName ¶
func (Department) TableName() string
func (*Department) Update ¶
func (department *Department) Update() error
type Dictionary ¶
func (*Dictionary) BeforeCreate ¶
func (*Dictionary) BeforeCreate(scope *gorm.Scope) error
func (Dictionary) Query ¶
func (Dictionary) Query(query map[string]interface{}) []Dictionary
func (*Dictionary) QueryUnique ¶
func (dic *Dictionary) QueryUnique() error
type DriverType ¶
type DriverType Dictionary
func (*DriverType) Create ¶
func (driverType *DriverType) Create() error
func (DriverType) QueryAll ¶
func (DriverType) QueryAll() []DriverType
func (DriverType) TableName ¶
func (DriverType) TableName() string
func (*DriverType) Update ¶
func (driverType *DriverType) Update() error
type JobType ¶
type JobType Dictionary
type LineFareIncome ¶
type LineFareIncome struct { Domain LineNo int CarryingAmount float32 ActualAmount float32 WornCoinAmount float32 BusNumbers int CountingDate time.Time CountingStaff1ID string `gorm:"ForeignKey:CountingStaff1ID"` CountingStaff1 Staff CountingStaff2ID string `gorm:"ForeignKey:CountingStaff2ID"` CountingStaff2 Staff RecordStaffID string RecordStaff Staff `gorm:"ForeignKey:RecordStaffID"` }
func (*LineFareIncome) BeforeCreate ¶
func (*LineFareIncome) BeforeCreate(scope *gorm.Scope) error
func (*LineFareIncome) Create ¶
func (fareIncome *LineFareIncome) Create() error
func (LineFareIncome) Query ¶
func (LineFareIncome) Query(query map[string]interface{}) []LineFareIncome
func (LineFareIncome) QueryAll ¶
func (fareIncome LineFareIncome) QueryAll() []LineFareIncome
func (*LineFareIncome) Update ¶
func (fareIncome *LineFareIncome) Update() error
type Staff ¶
type Staff struct { Domain Name string JobTypeID string JobType JobType `gorm:"ForeignKey:JobTypeID"` OnboardTime time.Time PersonalID string DriverTypeID string DriverType DriverType `gorm:"ForeignKey:DriverTypeID"` IsInternship bool IsMultitimeHired bool IsResign bool FirstOnboardTime time.Time Phone string DepartmentID string Department Department `gorm:"ForeignKey:DepartmentID"` EmergencyContact string EmergencyContactPhone string EmergencyContactRelation string }
func (Staff) IsQualified ¶
func (Staff) NeedUpgrade ¶
func (Staff) QueryByJoin ¶
func (*Staff) QueryUnique ¶
func (*Staff) UpdateToResign ¶
type StaffResign ¶
type StaffResign struct { Domain StaffID string `gorm:"ForeignKey:staff_id"` Staff Staff ResignDate time.Time ResignReason string }
func (*StaffResign) BeforeCreate ¶
func (*StaffResign) BeforeCreate(scope *gorm.Scope) error
func (*StaffResign) Create ¶
func (staffResign *StaffResign) Create() error
func (StaffResign) Query ¶
func (StaffResign) Query(query map[string]interface{}) []StaffResign
func (StaffResign) QueryAll ¶
func (staffResign StaffResign) QueryAll() []StaffResign
func (*StaffResign) Update ¶
func (staffResign *StaffResign) Update() error
Click to show internal directories.
Click to hide internal directories.