mybatis基于注解的sql中空字符串判断

 

 

 @Select("<script>" +
            "select c.id from dwzsk_content c " +
            "WHERE c.`status`!=3" +
            "<if test=‘title!=null and title!=&apos;&apos;‘>" +
            " and title=#{title}" +
            "</if>" +
            "</script>")
    List<SysContentVo> selectSysContentListBySysContentVo(SysContentVo sysContentVo);

 

&apos;就是单引号的意思,但是因为我们外层已经有一个单引号了 所以这里就不能直接写单引号

mybatis基于注解的sql中空字符串判断

上一篇:Problem:火星人


下一篇:flea-frame-db使用之基于对象池的FleaJPAQuery