{"<script>", "select name from tablename where 1=1 ", "<if test=\"name != null and name != ''\">", "and name like concat('%',#{name},'%') ", "</if>", "<if test=\"orders != null and orders != ''\">", " order by ${orders}", "</if>", "<if test='offset != null and rows != null'>", " limit #{offset}, #{rows}", "</if>", "</script>"}
利用{"<script>" "</script>"}方法模糊查询,需要concat拼接一下,concat('%',#{name},'%')
排序字段前要用$
limit 分页