Skip to content

Param 注解

@Param 注解用于为方法参数指定名称,以便在 SQL 查询中进行参数绑定。

参数说明

参数名类型默认值说明
valueString(required)方法参数的名称,用于 SQL 查询中的参数绑定

使用示例

java
import com.tang.kite.annotation.Param;
import com.tang.kite.annotation.Select;
import com.tang.kite.mapper.BaseMapper;

public interface UserMapper extends BaseMapper<User> {

    @Select("select id, username from account where username = #{username}")
    Account selectByUsername(@Param("username") String username);

}
java
import com.tang.kite.annotation.id.Id;
import com.tang.kite.annotation.id.IdType;

public class Account {

    @Id(type = IdType.AUTO)
    private Long id;

    private String username;

}

由 Tang 用 ❤️ 构建