mybatis-plus操作sql各种注意记录

 

@Param 作为Dao层的注解,作用是用于传递参数,一般在2=<参数数<=5时使用最佳。

注解@Param(“id”)Integer id,@Param("name") String name后在xml中sql不需要parameterType属性直接


        update t_tenant_info
          
              
                  name = #{name},
              
          
          where id= #{id}
    

 

或者通过parameterType = “类”,parameterType=“Map”,取值直接用类名或Map中的Key


        update t_tenant_info
          
              
                  name = #{name},
              
          
          where id= #{id}
    

 

你可能感兴趣的:(mybatis)