DAO中是参数类型是List,xml中的参数类型是ArrayList,需要把xml中的参数类型修改为List
Cause: java.sql.SQLException: Invalid parameter object type. Expected 'java.util.ArrayList' but found 'java.util.Arrays$ArrayList'.; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
修改后:
//DAO
public List<T1> queryListByErps(List<String> erps) {
LOG.info("进入 queryListByErps 方法 ");
return super.getSqlMapClientTemplate().queryForList("T1.queryListByErps", erps);
}
<!--xml中,根据erp查询多条记录 -->
<select id="queryListByErps" parameterClass="java.util.ArrayList" resultMap="BaseResultMap">
select * from t1 where 1=1 and erp in
<iterate open="(" close=")" conjunction=","&g