用mybatis插件自动生成的example查询分页,不带条件时可以成功,带条件会报错There is no getter for property named '__frch_criterion_1' in 'class xxx。
这应该是mybatis的一个Bug。
解决方法:
在mapper接口文件中在方法参数前加上@Param("example")
List<TbContent> selectByExampleWithBLOBs(@Param("example") TbContentExample example);
List<TbContent> selectByExample(@Param("example") TbContentExample example);
然后在mapper.xml文件中and ${criterion.condition}前加上example
<sql id="Example_Where_Clause" >
<where >
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.