| | |
| | | |
| | | type ( |
| | | SystemSet struct { |
| | | Id int `json:"id" gorm:"column:id;primaryKey;autoIncrement;not null"` |
| | | Name string `json:"name" gorm:"type:varchar(255);comment:名称"` |
| | | Value string `json:"value" gorm:"type:varchar(255);comment:值"` |
| | | SystemType string `json:"systemType" gorm:"type:varchar(255);comment:系统类型"` |
| | | Id int `json:"id" gorm:"column:id;primaryKey;autoIncrement;not null"` |
| | | Name string `json:"name" gorm:"type:varchar(255);comment:名称"` |
| | | Value string `json:"value" gorm:"type:varchar(255);comment:值"` |
| | | ModeType string `json:"modeType" gorm:"type:varchar(255);comment:模块类型"` |
| | | } |
| | | SystemSetSearch struct { |
| | | SystemSet |
| | |
| | | slf.Name = name |
| | | return slf |
| | | } |
| | | func (slf *SystemSetSearch) SetModeType(modeType string) *SystemSetSearch { |
| | | slf.ModeType = modeType |
| | | return slf |
| | | } |
| | | |
| | | func (slf *SystemSetSearch) build() *gorm.DB { |
| | | var db = slf.Orm.Table(slf.TableName()) |
| | |
| | | if slf.Name != "" { |
| | | db = db.Where("name = ?", slf.Name) |
| | | } |
| | | if slf.ModeType != "" { |
| | | db = db.Where("mode_type = ?", slf.ModeType) |
| | | } |
| | | |
| | | return db |
| | | } |