JDBC 报错 "SQLException: Column 'addtime' not found",求助!

<select id="listComntedProdId" resultType="java.util.Map">
select op.*, oc.comment, oc.score + 0 as score, oc.sid, oc.images, oc.is_show + 0 as is_show, oc.addtime  as comment_addtime
from onlineshop_comment as oc 
inner join onlineshop_product as op on oc.goods_id = op.id
where oc.user_id = #{uid}

order by oc.id DESC

<if test="start >=0 and limit>0"> 
limit #{start},#{limit} 
</if> 
</select>

在java环境中运行mybatis相关代码,出错

org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column 'addtime' from result set. Cause: java.sql.SQLException: Column 'addtime' not found.

后将  “oc.addtime  as comment_addtime” 改为 "oc.addtime" ,报错消失,原因不明,求助!

posted @ 2017-08-17 18:39  glorythesky  阅读(1239)  评论(0编辑  收藏  举报