mybatis中多表联合查询与DTO的字段对应问题

你把返回的字段映射到一个javabean里面,或者直接返回一个map,都可以。
引用文章地址:https://www.cnblogs.com/onlymate/p/4747227.html
https://blog.csdn.net/u012726702/article/details/72593547
单字段对应(没有对象外键和list)https://blog.csdn.net/vili_sky/article/details/73289962
附加:mybaits封装数据为map的方法:https://blog.csdn.net/m0_49194578/article/details/119378104?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link
···








    
    
    
    
        
        
        
        
        
        
    



  id, username, password



delete from user
where id = #{id,jdbcType=VARCHAR}


insert into user (id, username, password
  )
values (#{id,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}
  )


    insert into user
    
        
            id,
        
        
            username,
        
        
            password,
        
    
    
        
            #{id,jdbcType=VARCHAR},
        
        
            #{username,jdbcType=VARCHAR},
        
        
            #{password,jdbcType=VARCHAR},
        
    


    update user
    
        
            username = #{username,jdbcType=VARCHAR},
        
        
            password = #{password,jdbcType=VARCHAR},
        
    
    where id = #{id,jdbcType=VARCHAR}


update user
set username = #{username,jdbcType=VARCHAR},
  password = #{password,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}



···

你可能感兴趣的:(mybatis中多表联合查询与DTO的字段对应问题)