浏览代码

fix:乐理章节分页

liujunchi 3 年之前
父节点
当前提交
720e886b0d

+ 2 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/dao/SysNewsTypeDao.java

@@ -14,4 +14,6 @@ public interface SysNewsTypeDao extends BaseDAO<Long, SysNewsType> {
 	List<SysNewsTypeTree> queryByParentId(Long parentId);
 
     List<SysNewsTypeDto> queryAppPage(Map<String, Object> params);
+
+	int queryAppCount(Map<String, Object> params);
 }

+ 1 - 1
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/impl/SysNewsTypeServiceImpl.java

@@ -60,7 +60,7 @@ public class SysNewsTypeServiceImpl extends BaseServiceImpl<Long, SysNewsType> i
 		MapUtil.populateMap(params, query);
 
 		List<SysNewsTypeDto> dataList = null;
-		int count = sysNewsTypeDao.queryCount(params);
+		int count = sysNewsTypeDao.queryAppCount(params);
 		if (count > 0) {
 			pageInfo.setTotal(count);
 			params.put("offset", pageInfo.getOffset());

+ 12 - 0
cooleshow-cms/src/main/resources/config/mybatis/SysNewsTypeMapper.xml

@@ -155,4 +155,16 @@
 			<result column="create_by_" property="createBy" />
 		</collection>
 	</resultMap>
+
+	<select id="queryAppCount" resultType="int">
+		SELECT count(1)
+		FROM sys_news_type snt
+		left join sys_news_information sni on sni.sub_type_ = snt.id_
+		where snt.del_flag_ = 0 and snt.parent_id_ = 6 and sni.del_flag_ = 0 and sni.status_ = 1
+		<if test="search != null and search != ''">
+			and  (sni.title_ like concat('%',#{search},'%') or snt.name_ like concat('%',#{search},'%'))
+		</if>
+		ORDER BY snt.order_ , sni.order_
+		<include refid="global.limit" />
+	</select>
 </mapper>

+ 1 - 1
toolset/toolset-base/src/main/java/com/yonge/toolset/base/page/QueryInfo.java

@@ -12,7 +12,7 @@ public class QueryInfo {
 	/**
 	 * 默认页码大小
 	 */
-	private int rows = 20;
+	private int rows = 200;
 	/**
 	 * 默认排序列
 	 */