Mybatis数据查询循环产数异常

ForHeartOnly 2017-05-08 11:20:02
我的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
...全文
168 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ForHeartOnly 2017-05-08
  • 打赏
  • 举报
回复
怎么转啊?谢谢
卖水果的net 2017-05-08
  • 打赏
  • 举报
回复
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named '__frch_orderId_0' in 'class cn.com.hexway.entity.Page' 实体中,没有这列。 PS:要不要给你移动到 java 区?
ForHeartOnly 2017-05-08
  • 打赏
  • 举报
回复
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named '__frch_orderId_0' in 'class cn.com.hexway.entity.Page' org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named '__frch_orderId_0' in 'class cn.com.hexway.entity.Page' at org.mybatis.spring.MyBati 根据你的改了,也是不行的
卖水果的net 2017-05-08
  • 打赏
  • 举报
回复
${orderId} 换成 #{orderId}
ForHeartOnly 2017-05-08
  • 打赏
  • 举报
回复
谢谢list的循环已解决
dong_19890208 2017-05-08
  • 打赏
  • 举报
回复
能不能把代码贴完整点

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧