Springboot使用PageHelper(需要解决依赖冲突)
2021-04-23 14:29
标签:zab inter wired rtp width span div height 根据 1、导入相关依赖 (PageHelper自带了mybatis、mybatis-spring,不排除会报错) 2、在application.yml 配置文件中配置指定数据库 其他相关配置:https://www.cnblogs.com/mengw/p/11673637.html 或者使用配置类 3、使用Pagehelper多条件分页 条件类: service层接口: serviceimpl实现类: controller层: 页面数据的展示: Springboot使用PageHelper(需要解决依赖冲突) 标签:zab inter wired rtp width span div height 根据 原文地址:https://www.cnblogs.com/64Byte/p/13269576.html
dependency>
groupId>com.github.pagehelpergroupId>
artifactId>pagehelper-spring-boot-starterartifactId>
version>1.2.10version>
exclusions>
exclusion>
groupId>org.mybatisgroupId>
artifactId>mybatisartifactId>
exclusion>
exclusion>
groupId>org.mybatisgroupId>
artifactId>mybatis-springartifactId>
exclusion>
exclusions>
dependency>
#pagehelper配置
pagehelper:
helper-dialect: mysql
@Data
@AllArgsConstructor
@NoArgsConstructor
public class HouseQueryInfo implements Serializable{
private static final long serialVersionUID = 1034989291292817460L;
//private int pageIndex;//当前页码(页面传递)
//private int pageSize;//页容量(后台设置)
private String title;
private String price_on;
private String price_down;
private String street_id;
private String type_id;
private String floorage_on;
private String floorage_down;
}
public interface IHouseService extends IService
@Service
public class HouseServiceImpl extends ServiceImpl
PageInfo
TR th:each="house:${pageInfo.getList()}">
TD class=house-thumb>span>
img th:src="${house.photopath != null} ? |/img/${house.photopath}| :‘../images/thumb_house.gif‘ " width="100" height="75"span>TD>
TD>
DL>
DT>
A href="#" th:text="${house.title}">A>
DT>
DD>
span th:text="${house.streets.name}"/>
span th:text="${house.streets.district.name}"/>
span th:text="${house.floorage}"/> 平米BR>联系方式:span th:text="${house.contact}"/>
DD>
DL>
TD>
TD class=house-type>span th:text="${house.typess.name}"/>TD>
TD class=house-price>SPAN th:text="${house.price}">SPAN>元/月TD>
TR>
文章标题:Springboot使用PageHelper(需要解决依赖冲突)
文章链接:http://soscw.com/essay/78552.html