Could not find value method on SQL annotation. Cause: org.apache.ibatis.builder.BuilderException:

前言:
许久没有使用mysql,报此错,解决后记录

1.原因一:

xml中的sql语句,没有使用mybatis正确的符号;

&lt;      <     小于号    <=&lt;=的表示是一个意思
&gt;      >     大于号
&amp;     &&apos;    ’     单引号
&quot;    "     双引号

2.原因二:

对象属性名称、表中字段名称,输入错误

    @Results(
            id = "resultMap",
            value = {
                    @Result(id = true, column = "id", property = "id"),
                    @Result(column = "third_id", property = "thirdId"),
                    @Result(column = "version", property = "version"),
                    @Result(column = "form_data_id", property = "formDataId"),
                    @Result(column = "dispose_id", property = "disposeId"),
                    @Result(column = "created_time", property = "createTime"), // update_time,我在此处写错 
                    @Result(column = "updated_time", property = "updateTime")
            }
    @Select("<script>"
            + " select * from relationship where third_id in "
            + " <foreach collection= 'thirdIds' item='id' separator=',' open= '(' close= ')' > "
            + " #{id}"
            + " </foreach>"
            + "</script>")
    List<Relationship> batchFind(@Param("thirdIds") List<String> thirdIds);
发布了93 篇原创文章 · 获赞 20 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/leinminna/article/details/103929312