
com.gitee.qdbp.jdbc.stream.SqlOnIdPairPagingStream Maven / Gradle / Ivy
package com.gitee.qdbp.jdbc.stream;
import java.util.Map;
import org.springframework.jdbc.core.RowMapper;
import com.gitee.qdbp.able.jdbc.paging.PageList;
import com.gitee.qdbp.able.jdbc.paging.Paging;
import com.gitee.qdbp.jdbc.api.SqlDao;
/**
* 同时设置queryId/countId, 分页后续操作: list / resultAs
*
* @author zhaohuihua
* @version 20210530
*/
public class SqlOnIdPairPagingStream {
protected final SqlDao dao;
protected final String queryId;
protected final String countId;
protected final Object params;
protected final Paging paging;
SqlOnIdPairPagingStream(SqlDao dao, String queryId, String countId, Object params, Paging paging) {
this.dao = dao;
this.queryId = queryId;
this.countId = countId;
this.params = params;
this.paging = paging;
}
/**
* 查询列表
*
List<Map<String, Object>> users = qdbcBoot.sqlStream()
.sqlId("SysUserMapper:queryRoleUsers", "SysUserMapper:countRoleUsers")
.params(map)
.pageBy(1,10)
.list().asPartList(); // 分页后返回的是PageList, 需要转换为普通List
*
*
* @return 查询结果列表
*/
public PageList
© 2015 - 2025 Weber Informatics LLC | Privacy Policy