<!-- 分页助手 --> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId> <version>3.7.5</version> </dependency>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 分页助手 -->
<plugins>
<!-- com.github.pagehelper为PageHelper类所在包名 -->
<plugin interceptor="com.github.pagehelper.PageHelper">
<!-- 数据库方言 -->
<property name="dialect" value="MySQL"/>
<!-- 设置为true时,使用RowBounds分页会进行count查询 会去查询出总数 -->
<property name="rowBoundsWithCount" value="true"/>
</plugin>
</plugins>
</configuration>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:mybatis-config.xml"></property>
<property name="mapperLocations" value="classpath:com/lyitong/mapping/*.xml"></property>
<typeAliases>
<!-- javabean 的首字母小写的非限定类名来作为它的别名(其实别名是不去分大小写的)。也可在javabean 加上注解@Alias 来自定义别名, 例如: @Alias(student) -->
<package name="com.lyt.usermanage.mapper"/>
</typeAliases>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<!-- 加载全局的配置文件 -->
<property name="configLocation" value="classpath:mybatis/mybatis-config.xml"></property>
<!-- 配置mapper的扫描,找到所有的mapper.xml映射文件。 -->
<property name="mapperLocations" value="classpath:com/lyt/usermanage/mapper/*.xml"></property>
<!-- 配置类型别名 -->
<property name="typeAliasesPackage" value="classpath:com/lyt/usermanage/pojo/*"></property>
</bean>
<property name="typeAliasesPackage" value="classpath:com/lyt/usermanage/pojo/*"></property>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mapperLocations" value="classpath:com/lyitong/mapping/*.xml"></property>
<!-- pageHelper 分页插件 -->
<property name="plugins">
<array>
<bean class="com.github.pagehelper.PageHelper">
<property name="properties">
<value>
dialect=mysql
rowBoundsWithCount=true
</value>
</property>
</bean>
</array>
</property>
</bean>
PageHelper.startPage(Integer.parseInt(currentPage), Integer.parseInt(pageSize));
List<LytBbsTz> publishTz = bbsTzDao.getPublishTz(userId);
PageInfo<LytBbsTz> info = new PageInfo<LytBbsTz>(publishTz);
map.put("status", 1);
map.put("tzList", info.getList());
return map;
@RequestParam(defaultValue="1",value="currentPage")String currentPage, @RequestParam(defaultValue="10",value="pageSize")String pageSize
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有