入门客AI创业平台(我带你入门,你带我飞行)
博文笔记

MyBatis多条件分页查询,返回总记录数

创建时间:2017-05-25 投稿人: 浏览次数:1772
 <!-- 通过多条件分页查询,返回总记录数 -->
  <select id="selectPageCount" parameterType="page" resultType="Integer">
  select count(1) from article 
  <where>
    <if test="paramEntity.markdown!=null">and markdown like #{paramEntity.markdown}</if>
    <if test="paramEntity.title!=null">and title like #{paramEntity.title}</if>
    <if test="paramEntity.content!=null">and content like #{paramEntity.content}</if>
    <if test="paramEntity.userId!=null">and a.user_id = #{paramEntity.userId}</if>  
    <if test="paramEntity.articleType!=null">and article_type = #{paramEntity.articleType}</if>          
    </where>
  </select>
声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
  • 上一篇:没有了
  • 下一篇:没有了
未上传头像