Can Mybatis return a Map collection with attribute values-> attribute values?

needs to use the returned result of an attribute value corresponding to id->. Currently, you can only return List, with two columns and convert it using Stream. Does Mybatis natively support this feature?


    select
        id,
        sum(money)
    from table_name
    where parentId = -sharp{parentId}
    group by id
</select>

I"ve tried this method and it seems that it can only return Map < Long,Map < String,Object > >, so is there any good way?

May.24,2021

it should be OK to use List < HashMap < String,string > >. The returned value is id:idvalue,sum (money): sum (money) value

.
Menu