找了半天 就注解方法好使。传值写xml的提示sql报错。 import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Param;
xxMapper.java
@Select("${selSql}")
List<Map> selectSql(@Param("selSql") String selSql);
调用:
String sqltemp = "select id,title from emp";
List<Map> list = xxMapper.selectSql(sqltemp);