前言:
许久没有使用mysql,报此错,解决后记录
1.原因一:
xml中的sql语句,没有使用mybatis正确的符号;
< < 小于号 <= 和<=的表示是一个意思
> > 大于号
& & 和
' ’ 单引号
" " 双引号
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);