MyBatis的sql映射参数

  1. arg0,arg1

     <select id ="queryByNameAndAddress" resultType="user">
     	select * from t_user where last_name = #{arg0} and address = #{arg1}
     </select>
    
  2. param1,param2

     <select id ="queryByNameAndAddress" resultType="user">
     	select * from t_user where last_name = #{param1} and address = #{param2}
     </select>
    
  3. @Param(“参数”)(推荐使用)

User queryByNameAndAddress(@Param("name") String name,@Param("address") String address);
上一篇:前端安全之加解密种类(二)


下一篇:js 加减乘除 bug