首页 > 其他 > 详细

个人博客遇到的问题

时间:2017-10-29 17:15:10      阅读:295      评论:0      收藏:0      [点我收藏+]

1.数据库中type类型为tinyint,默认为0。在数据库中查询条件为type=0时能够正确查询,但是集成到Mybatis中却将所有的数据显示出来了

解决:Mybatis中的if条件去掉type!=‘‘,原来是 type != null and type!=‘‘

 select id, type, createtime, content,title
    from tb_blog_info
     <where>
          <if test="type != null">
             type=#{type,jdbcType=TINYINT} 
          </if>
     </where>
     ORDER BY createtime DESC limit #{start},#{stop}

 

个人博客遇到的问题

原文:http://www.cnblogs.com/liter7/p/7750366.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!