Merge pull request 'fix query audit bug' (#121) from feat-20240117-001-Robin into test

Reviewed-on: #121
This commit is contained in:
chenhao 2024-02-07 14:44:21 +08:00
commit f7a823dfd6
1 changed files with 12 additions and 12 deletions

View File

@ -2492,13 +2492,13 @@ func (m *Mongo) GetImageAuditTaskList(ctx *gin.Context, req *imageaudittaskproto
query["associative_data_base"] = util.DerefString(req.AssociativeDatabase)
}
if req.AssociativeTableName != nil {
query["associative_tabel_name"] = util.DerefString(req.AssociativeTableName)
query["associative_table_name"] = util.DerefString(req.AssociativeTableName)
}
if req.AssociativeTableId != nil {
query["associative_tabel_id"] = util.DerefInt64(req.AssociativeTableId)
query["associative_table_id"] = util.DerefInt64(req.AssociativeTableId)
}
if req.AssociativeTableColumn != nil {
query["associative_tabel_column"] = util.DerefString(req.AssociativeTableColumn)
query["associative_table_column"] = util.DerefString(req.AssociativeTableColumn)
}
if req.BatchId != nil {
query["batch_id"] = util.DerefString(req.BatchId)
@ -2706,13 +2706,13 @@ func (m *Mongo) GetTextAuditTaskList(ctx *gin.Context, req *textaudittaskproto.O
query["associative_data_base"] = util.DerefString(req.AssociativeDatabase)
}
if req.AssociativeTableName != nil {
query["associative_tabel_name"] = util.DerefString(req.AssociativeTableName)
query["associative_table_name"] = util.DerefString(req.AssociativeTableName)
}
if req.AssociativeTableId != nil {
query["associative_tabel_id"] = util.DerefInt64(req.AssociativeTableId)
query["associative_table_id"] = util.DerefInt64(req.AssociativeTableId)
}
if req.AssociativeTableColumn != nil {
query["associative_tabel_column"] = util.DerefString(req.AssociativeTableColumn)
query["associative_table_column"] = util.DerefString(req.AssociativeTableColumn)
}
if req.BatchId != nil {
query["batch_id"] = util.DerefString(req.BatchId)
@ -2801,10 +2801,10 @@ func (m *Mongo) GetAlignedImageAuditTaskList(ctx *gin.Context, req *alignedaudit
query["associative_data_base"] = util.DerefString(req.AssociativeDatabase)
}
if req.AssociativeTableName != nil {
query["associative_tabel_name"] = util.DerefString(req.AssociativeTableName)
query["associative_table_name"] = util.DerefString(req.AssociativeTableName)
}
if req.AssociativeTableId != nil {
query["associative_tabel_id"] = util.DerefInt64(req.AssociativeTableId)
query["associative_table_id"] = util.DerefInt64(req.AssociativeTableId)
}
if req.BatchId != nil {
query["batch_id"] = util.DerefString(req.BatchId)
@ -2814,7 +2814,7 @@ func (m *Mongo) GetAlignedImageAuditTaskList(ctx *gin.Context, req *alignedaudit
"$in": []int64{util.DerefInt64(req.Status), consts.ImageAudit_ForAlignment},
}
}
sortClause := []string{"associative_data_base", "associative_tabel_name", "associative_tabel_id", "associative_table_column"}
sortClause := []string{"associative_data_base", "associative_table_name", "associative_table_id", "associative_table_column"}
err := col.Find(ctx, query).Sort(sortClause...).Skip(int64(req.Offset)).Limit(int64(req.Limit)).All(&list)
if err == qmgo.ErrNoSuchDocuments {
err = nil
@ -2837,10 +2837,10 @@ func (m *Mongo) GetAlignedTextAuditTaskList(ctx *gin.Context, req *alignedauditt
query["associative_data_base"] = util.DerefString(req.AssociativeDatabase)
}
if req.AssociativeTableName != nil {
query["associative_tabel_name"] = util.DerefString(req.AssociativeTableName)
query["associative_table_name"] = util.DerefString(req.AssociativeTableName)
}
if req.AssociativeTableId != nil {
query["associative_tabel_id"] = util.DerefInt64(req.AssociativeTableId)
query["associative_table_id"] = util.DerefInt64(req.AssociativeTableId)
}
if req.BatchId != nil {
query["batch_id"] = util.DerefString(req.BatchId)
@ -2850,7 +2850,7 @@ func (m *Mongo) GetAlignedTextAuditTaskList(ctx *gin.Context, req *alignedauditt
"$in": []int64{util.DerefInt64(req.Status), consts.TextAudit_ForAlignment},
}
}
sortClause := []string{"associative_data_base", "associative_tabel_name", "associative_tabel_id", "associative_table_column"}
sortClause := []string{"associative_data_base", "associative_table_name", "associative_table_id", "associative_table_column"}
err := col.Find(ctx, query).Sort(sortClause...).Skip(int64(req.Offset)).Limit(int64(req.Limit)).All(&list)
if err == qmgo.ErrNoSuchDocuments {
err = nil