优化RowBound
This commit is contained in:
@@ -8,6 +8,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import org.redkale.source.DataSqlSource;
|
||||
import org.redkale.source.RowBound;
|
||||
import org.redkale.util.Sheet;
|
||||
|
||||
/** @author zhangjx */
|
||||
public class DynForumInfoMapperImpl implements ForumInfoMapper {
|
||||
@@ -25,6 +27,7 @@ public class DynForumInfoMapperImpl implements ForumInfoMapper {
|
||||
return dataSource().nativeQueryOne(ForumResult.class, sql, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<ForumResult> findForumResultAsync(ForumBean bean) {
|
||||
String sql =
|
||||
"SELECT f.forum_groupid, s.forum_section_color FROM forum_info f, forum_section s WHERE f.forumid = s.forumid";
|
||||
@@ -42,6 +45,19 @@ public class DynForumInfoMapperImpl implements ForumInfoMapper {
|
||||
return dataSource().nativeQueryList(ForumResult.class, sql, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sheet<ForumResult> queryForumResult(RowBound bound, ForumBean bean) {
|
||||
String sql = "SELECT f.forum_groupid, s.forum_section_color "
|
||||
+ "FROM forum_info f, forum_section s "
|
||||
+ " WHERE f.forumid = s.forumid AND "
|
||||
+ "s.forum_sectionid = #{bean.forumSectionid} AND "
|
||||
+ "f.forumid = #{bean.forumid} AND s.forum_section_color = #{bean.forumSectionColor}";
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("bean", bean);
|
||||
return dataSource().nativeQuerySheet(ForumResult.class, sql, bound, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<List<ForumResult>> queryForumResultAsync(ForumBean bean) {
|
||||
String sql =
|
||||
"SELECT f.forum_groupid, s.forum_section_color FROM forum_info f, forum_section s WHERE f.forumid = s.forumid";
|
||||
|
||||
@@ -7,6 +7,8 @@ import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import org.redkale.annotation.Param;
|
||||
import org.redkale.persistence.Sql;
|
||||
import org.redkale.source.RowBound;
|
||||
import org.redkale.util.Sheet;
|
||||
|
||||
/** @author zhangjx */
|
||||
public interface ForumInfoMapper extends BaseMapper<ForumInfo> {
|
||||
@@ -32,6 +34,13 @@ public interface ForumInfoMapper extends BaseMapper<ForumInfo> {
|
||||
+ "f.forumid = #{bean.forumid} AND s.forum_section_color = #{bean.forumSectionColor}")
|
||||
public List<ForumResult> queryForumResult(@Param("bean") ForumBean bean0);
|
||||
|
||||
@Sql("SELECT f.forum_groupid, s.forum_section_color "
|
||||
+ "FROM forum_info f, forum_section s "
|
||||
+ " WHERE f.forumid = s.forumid AND "
|
||||
+ "s.forum_sectionid = #{bean.forumSectionid} AND "
|
||||
+ "f.forumid = #{bean.forumid} AND s.forum_section_color = #{bean.forumSectionColor}")
|
||||
public Sheet<ForumResult> queryForumResult(RowBound bound, ForumBean bean);
|
||||
|
||||
@Sql("SELECT f.forum_groupid, s.forum_section_color "
|
||||
+ "FROM forum_info f, forum_section s "
|
||||
+ " WHERE f.forumid = s.forumid AND "
|
||||
|
||||
Reference in New Issue
Block a user