ibatis.exceptions.PersistenceException: java.util.LinkedHashMap and java.lang.String

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: java.lang.IllegalArgumentException: invalid comparison: java.util.LinkedHashMap and java.lang.String
### Cause: java.lang.IllegalArgumentException: invalid comparison: java.util.LinkedHashMap and java.lang.String
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
    at com.sun.proxy.$Proxy15.selectList(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)
    at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:137)
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:75)
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
    at com.sun.proxy.$Proxy23.getEquipmentBaseInfo(Unknown Source)

 

如果出现该bug,可以尝试以下操作:

(1)#{varIds}换成${varIds}    在以下这种语句中出现过该问题

WHERE var_id IN (#{varIds})

varIds = {"57,205,158,145,207", "58,206,159,146,208"}

(2) 改为

便签中的equipmentCode直接用变量名字,不用#{equipmentCode}

你可能感兴趣的:(超级无敌大bug,Java,Web)