今天尝试用单个string作为参数传入mapper层报错:
代码:
<select id="getOrderDetails2" parameterType="string" resultType="Map">
SELECT
...
FROM
...
WHERE
...
AND id IN (${ids})
</select>
报错:
There is no getter for property named 'ids' in 'class java.lang.String'
解决办法:
在${string}这种写法中,参数一律写为:_parameter。
正确写法应为:
<select id="getOrderDetails2" parameterType="string" resultType="Map">
SELECT
...
FROM
...
WHERE
...
AND id IN (${_parameter})
</select>