报错:
Servlet.service() for servlet [dispatcherServlet] in context with path [/likelong] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'b' not found. Available parameters are [list, param1]] with root cause
org.apache.ibatis.binding.BindingException: Parameter 'b' not found. Available parameters are [list, param1]
服务层代码部分结构:
List<TSkuPlu> productPage = TSkuPluMapper.selectMyPageByOracle(pageNum,num,queryWrapper);
Map map = baseMapper.findTest(productPage);
XML部分:
<insert id="findTest" parameterType="java.util.Map">
MERGE into TB_PRODUCT A
using
( select
#{item.plucode} plucode,
#{item.pluname} pluname
from TSKUPLU
) b
ON (
A.GOODS_ID=b.plucode
)
WHEN MATCHED THEN
UPDATE SET
A.NAME=b.pluname
WHEN NOT MATCHED THEN
INSERT (A.GOODS_ID)
VALUES (b.plucode)
</insert>
问题解决了:
严格来讲,我的格式是没有问题的。但是xml写错服务方。我有A-》B双方,我做的中间商。这个方法应该写到B的mapper里。新手错误啊,还是逻辑不清晰的问题。
parameterType="java.util.Map"
参数类型写错了,是对象类型。
parameterType="包名.TSkuPlu"
包名换成对应类的包名即可。
数据类型有问题,没对应上