码迷,mamicode.com
首页 > 其他好文 > 详细

个人博客遇到的问题

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

标签:art   log   遇到   order   esc   null   解决   int   tin   

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}

 

个人博客遇到的问题

标签:art   log   遇到   order   esc   null   解决   int   tin   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!