select like

This commit is contained in:
殷勇 2023-09-13 15:04:01 +08:00
parent 0317dc9f5e
commit 386a55fcfa

View File

@ -90,14 +90,14 @@ func (this *dbPool) SelectLike(
fields []string,
whereKv [][]string,
likeWhere [][]string,
start int64,
limit int,
cb QueryResultCb) {
var params []string
sql := fmt.Sprintf("SELECT %s FROM %s WHERE 1=1 ", this.joinSelectFields(fields), tblName)
sql := fmt.Sprintf("SELECT %s FROM %s WHERE idx > %d", this.joinSelectFields(fields), tblName, start)
this.joinWhere(&sql, &params, whereKv)
this.joinWhereLike(&sql, &params, likeWhere)
sql = fmt.Sprintf("%s LIMIT %d", sql, limit)
sql = fmt.Sprintf("%s ORDER BY idx ASC LIMIT %d", sql, limit)
this.internalQuery(dataSource, sql, params, cb)
}