Mybatis数据查询循环产数异常
我的xml这段数据是这样的,vids是list类型:
<if test="pd.YW_LABEL !=null and pd.YW_LABEL !=''">
and a.order_tab_id in
<foreach item="orderId" index="index" collection="vids" open="(" separator="," close=")">
${orderId}
</foreach>
</if>
0613b2f5fd1542f7a0733371e490cbc8这个是ID
运行报下面的错误
-08 11:15:10 -294629 [http-bio-8080-exec-6] ERROR - org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column '0613b2f5fd1542f7a0733371e490cbc8' in 'where clause'
### The error may exist in file [/Volumes/mySpace/workSpace/Pro/fstc/out/artifacts/fstc_war_exploded/WEB-INF/classes/mybatis/citydelivery/CdsOrderMapper.xml]
### The error may involve CdsOrderMapper.datalistPage-Inline
### The error occurred while setting parameters
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column '0613b2f5fd1542f7a0733371e490cbc8' in 'where clause'
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column '0613b2f5fd1542f7a0733371e490cbc8' in 'where clause'
org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column '0613b2f5fd1542f7a0733371e490cbc8' in 'where clause'
### The error may exist in file [/Volumes/mySpace/workSpace/Pro/fstc/out/artifacts/fstc_war_exploded/WEB-INF/classes/mybatis/citydelivery/CdsOrderMapper.xml]
### The error may involve CdsOrderMapper.datalistPage-Inline
### The error occurred while setting parameters