// 主sql,此处需要把传入副sql的参数的值查出
@Results(value = {
// 如果获取的 id 为空值,可以放开此条注释
// @Result(id = true, property = "pro_id", column = "pro_id"),//没有的话外面id会为null
// 映射到res中的字段名 传的参数 方法名
@Result(property = "ability",
column = "login_id",
many = @Many(select = "selfAbility")
)
})
@Select("select school,login_id" +
"from login_number " +
"wghere login_id = #{uid}")
UserWorkRes userInfo(long uid);
//=========== 副sql 一对多查询 sql
@Select("select ability_img,ability_name "+
"from self_ability "+
"where login_id = #{login_id}")
List<AbilityRes> selfAbility(long login_id);
@Data
public class UserWorkRes {
String school;
// 一对多查询结果保存
List<AbilityRes> ability;
}