废话少说,上代码,接口原来写成了:
List<BugCcDO> getBugCcs(Long[] workIds);
mapper文件配置:
<select id="getBugCcs" resultType="com.changhong.cloud.tmplatform.entity.bug.BugCcDO">
SELECT
<include refid="All_CcLog_Column_Values"/>
FROM
pms_cc_log
WHERE
<if test="workIds != null">
work_id IN
<foreach item="workId" index="index" collection="workIds" open="(" separator="," close=")">
#{workId}
</foreach>
</if>
</select>
然后一直报错:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'workIds' not found. Available parameters are [array]
找到的解决方法是:
修改接口传参为:
List<BugCcDO> getBugCcs(@Param("workIds") Long[] workIds);