Mybatis同时传入对象与普通参数
程序员文章站
2022-07-15 14:30:16
...
int updateDefByUidAndDef(@Param("uid") int uid,@Param("defaddress") int defaddress);
<update id="edit">
update address
set uid=#{address.uid},
province = #{address.province},
city = #{address.city},
county = #{address.county},
fulladdress = #{address.fulladdress},
telphone = #{address.telphone},
name = #{address.name},
defaddress=#{address.defaddress}
where id = #{id}
</update>
注意:
1.多参数需要加上@Param注解
2.数据库里应使用别名.变量名
3.不要加parameterType
上一篇: shellcode