在SQL语句中加入script标签
@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);