en_company_permission.go 858 B

12345678910111213141516171819202122
  1. package en_company_permission
  2. import (
  3. "hongze/hongze_yb_en_api/global"
  4. "time"
  5. )
  6. type EnCompanyPermission struct {
  7. EnCompanyPermissionNameId int `gorm:"primaryKey;column:en_company_permission_id" json:"en_company_permission_id"`
  8. EnCompanyId int `gorm:"column:en_company_id" json:"en_company_id"`
  9. EnPermissionId int `gorm:"column:en_permission_id" json:"en_permission_id"`
  10. CreateTime time.Time `gorm:"autoCreateTime;column:create_time" json:"create_time"` //创建时间
  11. }
  12. func (c *EnCompanyPermission) TableName() string {
  13. return "en_company_permission"
  14. }
  15. func (c *EnCompanyPermission) GetList(condition string, pars []interface{}) (list []*EnCompanyPermission, err error) {
  16. err = global.DEFAULT_MYSQL.Model(c).Where(condition, pars).Order("create_time DESC").Scan(&list).Error
  17. return
  18. }