You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.9 KiB
70 lines
2.9 KiB
|
4 days ago
|
// Code generated by sql2gorm. DO NOT EDIT.
|
||
|
|
package teamlog
|
||
|
|
|
||
|
|
import (
|
||
|
|
"appPlatform/overall"
|
||
|
|
"strings"
|
||
|
|
)
|
||
|
|
|
||
|
|
// 公司值班表记录
|
||
|
|
type Companylog struct {
|
||
|
|
ID int64 `gorm:"column:id;type:bigint(20) unsigned;primary_key;AUTO_INCREMENT" json:"id"`
|
||
|
|
Orgid int64 `gorm:"column:orgid;type:bigint(20) unsigned;default:0;NOT NULL" json:"orgid"` // 行政组织ID
|
||
|
|
RunTime int64 `gorm:"column:runTime;type:bigint(20) unsigned;default:0;NOT NULL" json:"runTime"` // 执行时间
|
||
|
|
Years int `gorm:"column:years;type:int(5) unsigned;default:0;NOT NULL" json:"years"` // 年
|
||
|
|
Months int `gorm:"column:months;type:int(3) unsigned;default:0;NOT NULL" json:"months"` // 月
|
||
|
|
Days int `gorm:"column:days;type:int(3) unsigned;default:0;NOT NULL" json:"days"` // 日
|
||
|
|
Holiday int `gorm:"column:holiday;type:int(1) unsigned;default:2;NOT NULL" json:"holiday"` // 假日(1:是;2:否)
|
||
|
|
AllDay string `gorm:"column:allDay;type:mediumtext" json:"allDay"` // 全天值班人员
|
||
|
|
BaiTian string `gorm:"column:baiTian;type:mediumtext" json:"baiTian"` // 白天值班人员
|
||
|
|
Night string `gorm:"column:night;type:mediumtext" json:"night"` // 夜晚值班人员
|
||
|
|
SaveTime int64 `gorm:"column:saveTime;type:bigint(20);NOT NULL" json:"saveTime"` // 编辑时间
|
||
|
|
Morning string `gorm:"column:morning;type:mediumtext" json:"morning"` // 上午值班人员
|
||
|
|
Afternoon string `gorm:"column:afternoon;type:mediumtext" json:"afternoon"` // 下午值班人员
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *Companylog) TableName() string {
|
||
|
|
return "companylog"
|
||
|
|
}
|
||
|
|
|
||
|
|
// 编辑内容
|
||
|
|
func (cont *Companylog) EiteCont(whereMap interface{}, saveData interface{}) (err error) {
|
||
|
|
err = overall.CONSTANT_DB_TeamsLog.Model(&cont).Where(whereMap).Updates(saveData).Error
|
||
|
|
return
|
||
|
|
}
|
||
|
|
|
||
|
|
// 获取内容
|
||
|
|
func (cont *Companylog) GetCont(whereMap interface{}, field ...string) (err error) {
|
||
|
|
gormDb := overall.CONSTANT_DB_TeamsLog.Model(&cont)
|
||
|
|
if len(field) > 0 {
|
||
|
|
fieldStr := strings.Join(field, ",")
|
||
|
|
gormDb = gormDb.Select(fieldStr)
|
||
|
|
}
|
||
|
|
gormDb = gormDb.Where(whereMap)
|
||
|
|
err = gormDb.First(&cont).Error
|
||
|
|
return
|
||
|
|
}
|
||
|
|
|
||
|
|
// 根据条件获取总数
|
||
|
|
func (cont *Companylog) CountCont(whereMap interface{}) (countId int64) {
|
||
|
|
overall.CONSTANT_DB_TeamsLog.Model(&cont).Where(whereMap).Count(&countId)
|
||
|
|
return
|
||
|
|
}
|
||
|
|
|
||
|
|
// 读取全部信息
|
||
|
|
func (cont *Companylog) ContMap(whereMap interface{}, field ...string) (countAry []TeamsLog, err error) {
|
||
|
|
gormDb := overall.CONSTANT_DB_TeamsLog.Model(&cont)
|
||
|
|
if len(field) > 0 {
|
||
|
|
fieldStr := strings.Join(field, ",")
|
||
|
|
gormDb = gormDb.Select(fieldStr)
|
||
|
|
}
|
||
|
|
err = gormDb.Where(whereMap).Find(&countAry).Error
|
||
|
|
return
|
||
|
|
}
|
||
|
|
|
||
|
|
// 删除内容
|
||
|
|
func (cont *Companylog) DelCont(whereMap interface{}) (err error) {
|
||
|
|
err = overall.CONSTANT_DB_TeamsLog.Where(whereMap).Delete(&cont).Error
|
||
|
|
return
|
||
|
|
}
|