Mybatis注解开发中的@Results、@Result、@ResultMap

.......省略一万行sql
@Results(id = "accResultMap",value = {
            @Result(property = "accId",column = "acc_id"),
            @Result(property = "accRole",column = "acc_login"),
            @Result(property = "accName",column = "acc_name"),
            @Result(property = "accPwd",column = "acc_pass"),
    })
Account queryAccById(Integer accid);




.......省略一万行sql
@ResultMap("accResultMap")
Account queryByName();



@Result是@Results的儿子。@Results可以算作是@ResultMap的干儿子!


传参,取参
@Param("username") String name
#{username}

 

你可能感兴趣的:(mybatis,IDEA)