|
@@ -90,10 +90,11 @@ func (m *InspectionRecordList) AfterFind(scope *gorm.DB) (err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func GetInspectionRecordListByCondition(condition string, pars []interface{}, pageIndex int, pageSize int) (list []*InspectionRecordList, err error) {
|
|
|
+func GetInspectionRecordListByCondition(condition string, pars []interface{}, startSize int, pageSize int) (list []*InspectionRecordList, err error) {
|
|
|
sql := `SELECT r.*, t.name as terminal_name, s.source_name FROM edb_inspection_record r left join edb_terminal t on r.terminal_code = t.terminal_code
|
|
|
left join edb_source s on r.source = s.edb_source_id
|
|
|
- WHERE 1=1 ` + condition + ` ORDER BY inspection_time DESC`
|
|
|
+ WHERE 1=1 ` + condition + ` ORDER BY inspection_time DESC LIMIT ?,?`
|
|
|
+ pars = append(pars, startSize, pageSize)
|
|
|
err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&list).Error
|
|
|
return
|
|
|
}
|