12345678910111213141516171819202122232425 |
- package crm
- import (
- "hongze/fms_api/global"
- "time"
- )
- // SysDepartment 系统部门表
- type SysDepartment struct {
- DepartmentId int `gorm:"primaryKey;column:department_id;type:int(11);not null" json:"department_id"`
- DepartmentName string `gorm:"unique;column:department_name;type:varchar(255);default:''" json:"department_name"` // 部门名称
- CreateTime time.Time `gorm:"column:create_time;type:datetime" json:"create_time"` // 创建时间
- }
- func (m *SysDepartment) TableName() string {
- return "sys_department"
- }
- func (m *SysDepartment) List(condition string, pars []interface{}) (list []*SysDepartment, err error) {
- list = make([]*SysDepartment, 0)
- err = global.MYSQL["report"].Model(m).
- Where(condition, pars...).
- Find(&list).Error
- return
- }
|