bug:修改报警日志参数
This commit is contained in:
parent
c4ba4a34f9
commit
6a8a6c0fff
@ -38,6 +38,9 @@ func (a *EnvMonitorDevice) Query(ctx context.Context, params schema.EnvMonitorDe
|
|||||||
if params.Type != nil && *params.Type != 0 {
|
if params.Type != nil && *params.Type != 0 {
|
||||||
db = db.Where("type=?", *params.Type)
|
db = db.Where("type=?", *params.Type)
|
||||||
}
|
}
|
||||||
|
if params.WorkshopID != 0 {
|
||||||
|
db = db.Where("workshop_id=?", params.WorkshopID)
|
||||||
|
}
|
||||||
var list schema.EnvMonitorDevices
|
var list schema.EnvMonitorDevices
|
||||||
pageResult, err := util.WrapPageQuery(ctx, db, params.PaginationParam, opt.QueryOptions, &list)
|
pageResult, err := util.WrapPageQuery(ctx, db, params.PaginationParam, opt.QueryOptions, &list)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -151,13 +151,13 @@ func (a *EnvMonitorDeviceWarningLog) Create(ctx context.Context, item *schema.En
|
|||||||
case 1:
|
case 1:
|
||||||
typeStr = "水温"
|
typeStr = "水温"
|
||||||
case 2:
|
case 2:
|
||||||
typeStr = "电导率"
|
typeStr = "溶解氧"
|
||||||
case 3:
|
case 3:
|
||||||
typeStr = "氨氮"
|
typeStr = "氨氮"
|
||||||
case 4:
|
case 4:
|
||||||
typeStr = "溶解氧"
|
|
||||||
case 5:
|
|
||||||
typeStr = "PH值"
|
typeStr = "PH值"
|
||||||
|
case 5:
|
||||||
|
typeStr = "电导率"
|
||||||
case 6:
|
case 6:
|
||||||
typeStr = "视频监控"
|
typeStr = "视频监控"
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ type EnvMonitorDeviceQueryParam struct {
|
|||||||
util.PaginationParam
|
util.PaginationParam
|
||||||
DeviceName string `form:"device_name"`
|
DeviceName string `form:"device_name"`
|
||||||
Type *int `form:"type"`
|
Type *int `form:"type"`
|
||||||
|
WorkshopID int64 `form:"workshop_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Defining the query options for the `EnvMonitorDevice` struct.
|
// Defining the query options for the `EnvMonitorDevice` struct.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user