mybatis利用resultMap复杂类型list映射

 

目录

映射泛型为对象

xml

DTO

ENTITY

MAPPER

映射泛型为包装类型

xml

DTO

MAPPER


 

 

映射泛型为对象

xml


    
    
    
        
        
        
        
    



 

DTO

@Data
public class StrategyInternetDataDTO {

    private Integer id ;
    private Integer internetData ;
    private List userList ;

}

 

ENTITY

@Data
public class SysUser {

    private Integer id;
    private String number;
    private String pushToken;
    private String wsChannelId ;

}

 

MAPPER

List selectInternetDataDTOByInternetDataIdList(@Param("internetDataIdList") List internetDataIdList);

 

 

映射泛型为包装类型

xml


    
    
    
        
    




 

DTO

@Data
public class StrategyInternetDataDTO {

    private Integer id ;
    private Integer internetData ;
    private List userIdList ;

}

 

MAPPER

List selectInternetDataDTOByInternetDataIdList(@Param("internetDataIdList") List internetDataIdList);

 

 

对你有帮助的话,右上角给个赞呗~

 

你可能感兴趣的:(java,mybatis,mybatis,复杂sql,sql映射,复杂查询,批量查询)