1 实体传参
错误展示: Parameter ‘nickName’ not found. Available parameters are [pageable, ydlUser, param1, param2]
检查了其他人的内容,基本上都是表示在mybatis中的,xml文件的错误
2 错误代码
<select id="queryAllByLimit" resultMap="YdlUserMap">
select
user_id, user_name, nick_name, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time
from ydl_user
<where>
<if test="ydlUser.userId != null">
and user_id = #{param.userId}
</if>
<if test="ydlUser.userName != null and ydlUser.userName != ''">
and user_name = #{userName}
</if>
<if test="ydlUser.nickName != null and ydlUser.nickName != ''">
and nick_name = #{nickName}
</if>
<if test="ydlUser.email != null and ydlUser.email != ''">
and email = #{email}
</if>
<if test="ydlUser.phonenumber != null and ydlUser.phonenumber != ''">
and phonenumber = #{phonenumber}
</if>
<if test="ydlUser.sex != null and ydlUser.sex != ''">
and sex = #{sex}
</if>
</where>
limit #{pageable.offset}, #{pageable.pageSize}
</select>
3 正确代码
#{userName} 中的内容也加上实体的名字 #{ydlUser.userName} 不止上面的test的文件要加载