zhangqian
2023-08-18 6556134a5790821f93fa65ce15186f51111e768c
一些表数据初始化
1个文件已修改
23 ■■■■■ 已修改文件
model/faultType.go 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/faultType.go
@@ -12,18 +12,18 @@
    // FaultType 故障类别
    FaultType struct {
        Id   int    `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        Name   string    `json:"name" gorm:"column:name"`
        Name string `json:"name" gorm:"column:name"`
    }
    // FaultTypeSearch 故障类别搜索条件
    FaultTypeSearch struct {
        FaultType
        Orm *gorm.DB
        QueryClass  constvar.FaultTypeQueryClass
        KeywordType constvar.FaultTypeKeywordType
        Keyword     string
        PageNum  int
        PageSize int
        Orm         *gorm.DB
        QueryClass  constvar.FaultTypeQueryClass
        KeywordType constvar.FaultTypeKeywordType
        Keyword     string
        PageNum     int
        PageSize    int
    }
)
@@ -130,6 +130,13 @@
    if total != 0 {
        return nil
    }
    records := []*FaultType{}
    records := []*FaultType{
        {1, "设备安装"},
        {2, "设备调教"},
        {3, "设备升级"},
        {4, "电气故障"},
        {5, "设备故障"},
        {6, "设备良品率低"},
    }
    return slf.CreateBatch(records)
}