正确写法:
<select id="findUserInfo" resultMap="userInfoResultMap">
select id,name,sex,e_mail,photo,username,password from
t_user,t_userinfo where t_user.u_id = t_userinfo.u_id
<if test="_parameter!= null">
AND name like concat(concat('%',#{_parameter},'%'))
</if>
</select>
错误写法:
<select id="findUserInfo" resultMap="userInfoResultMap">
select id,name,sex,e_mail,photo,username,password from
t_user,t_userinfo where t_user.u_id = t_userinfo.u_id
<if test="name!= null">
AND name like concat(concat('%',#{name},'%'))
</if>
</select>