Mybatis注解中使用if标签

@Select({
            "<script>" ,
            "SELECT COUNT(*) FROM category",
            "<if test='query != null and query != \" \" '>",
            "where cat_name like '%${query}%'",
            "</if>",
            "</script>"
    })
    Integer getCount(@Param("query") String query);

 

posted @ 2021-07-01 09:25  浅笑19  阅读(1188)  评论(0编辑  收藏  举报