用的是Map,List>接收,
sql语句中int类型的值做了聚合运算,
满足上述两个条件。
java中去取value的值就会变成BigDecimal 类型
经过实测:mybatis 中的sql语句int类型 java接收的几种情况。
实测案例:
1.用resultType=”int” (返回类型用int)
1.1 如果 resultType=”int”, id 没做运算,
select id from ting_cmdb_physical_equipment where id=2897;
显示结果,java可以用 int 接收。
1.2 如果 resultType=”int”, id 做运算,
select id-1 as id
from ting_cmdb_physical_equipment where id=2897;
显示结果:java可以用int接收
1.3 id 做聚合运算
select sum(id) as id
from ting_cmdb_p