sql精简如下:
select CHECKLIST_ID
from A WHERE CHECKLIST_ID in (1,2)) order by DT_UPDATE desc
其中CHECKLIST_ID pojo层为LONG型,mybatis resultMap映射如下
<id column="CHECKLIST_ID" jdbcType="DECIMAL" property="checklistId"/>
Example_Where_Clause如下
<when test="criterion.listValue">
and ${criterion.condition} <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> #{listItem} </foreach> </when>
这样会报错
org.apache.ibatis.exceptions.PersistenceException:
Error querying database. Cause: java.lang.reflect.UndeclaredThrowableException
The error may exist in com/lianpay/risk/check/sqlmap/RiskEventChecklistMapper.xml
当 #{listItem}改成 ${listItem} 就没有什么问题,即:
<when test="criterion.listValue"> and ${criterion.condition} <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> ${listItem} </foreach> </when>
求解,之前一直那么用的,难道和LONG型有关??
精慕HU
随时随地看视频慕课网APP
相关分类