bug:修改报警日志参数

This commit is contained in:
qi.zhou 2025-06-16 11:15:24 +08:00
parent c4ba4a34f9
commit 6a8a6c0fff
3 changed files with 7 additions and 3 deletions

View File

@ -38,6 +38,9 @@ func (a *EnvMonitorDevice) Query(ctx context.Context, params schema.EnvMonitorDe
if params.Type != nil && *params.Type != 0 {
db = db.Where("type=?", *params.Type)
}
if params.WorkshopID != 0 {
db = db.Where("workshop_id=?", params.WorkshopID)
}
var list schema.EnvMonitorDevices
pageResult, err := util.WrapPageQuery(ctx, db, params.PaginationParam, opt.QueryOptions, &list)
if err != nil {

View File

@ -151,13 +151,13 @@ func (a *EnvMonitorDeviceWarningLog) Create(ctx context.Context, item *schema.En
case 1:
typeStr = "水温"
case 2:
typeStr = "电导率"
typeStr = "溶解氧"
case 3:
typeStr = "氨氮"
case 4:
typeStr = "溶解氧"
case 5:
typeStr = "PH值"
case 5:
typeStr = "电导率"
case 6:
typeStr = "视频监控"
}

View File

@ -35,6 +35,7 @@ type EnvMonitorDeviceQueryParam struct {
util.PaginationParam
DeviceName string `form:"device_name"`
Type *int `form:"type"`
WorkshopID int64 `form:"workshop_id"`
}
// Defining the query options for the `EnvMonitorDevice` struct.