如果返回List,resultType=”String”就可以了,如果需要返回List

 <select id="selectAllInnerUser" resultType="String">select account_namefrom user_accountwhere is_deleted=0 and user_type=0</select>
<resultMap id="stringsResult" type="java.lang.String"><result column="account_name" property="accountName" jdbcType="VARCHAR" /></resultMap><select id="selectAllInnerUser" resultMap="stringsResult">select account_namefrom user_accountwhere is_deleted=0 and user_type=0</select>

二、要返回map可以通过如下方式知道key和value

<resultMap type="HashMap" id="testMap">  <result column="UA_INFO" property="key" />  <association property="value" resultMap="com.xxx.xxx.BaseResultMap"></association>  </resultMap>  <select id="getUaMapByTimestamp" parameterType="Map" resultMap="testMap"></select>

下面的还未尝试!
或者List

```xml
<select id="getMyCredit"  parameterClass="java.util.Map" resultClass="java.util.HashMap">
</select>

这样设置返回类型为resultClass=”java.util.HashMap”,查询时执行queryForList
List

<resultMap type="org.apache.ibatis.submitted.associationtest.Car" id="carResult"><id column="carid" property="id"/><result column="cartype" property="type"/><association property="engine" resultMap="engineResult"/><association property="brakes" resultMap="brakesResult"/>
</resultMap>
<resultMap type="org.apache.ibatis.submitted.associationtest.Engine" id="engineResult"><result column="enginetype" property="type"/><result column="enginecylinders" property="cylinders"/>
</resultMap>
<resultMap type="org.apache.ibatis.submitted.associationtest.Brakes" id="brakesResult"><result column="brakesType" property="type"/>
</resultMap><select id="getCars" resultMap="carResult">
select * from cars
<select id="getCarsNonUnique" resultMap="carResult">
select 1 as carid, cartype, enginetype, enginecylinders, brakestype from cars
<select id="getCars2" resultMap="carResult">
select 1 as carid, cartype, enginetype, enginecylinders, brakestype from cars where carid in (1,2)

```

resultType和resultMap相关推荐

  1. 【Mybatis框架】输出映射-resultType与resultMap

    为什么80%的码农都做不了架构师?>>>    输出映射 接下来说说有关Mapper.xml配置文件中查询标签中关于返回值类型resultType与resultMap的一些内容 1. ...

  2. MyBatis框架学习:<select>节点中的resultType和resultMap属性

    1.为什么要进行resultType或resultMap注解配置 当需要实现的数据访问是查询类型的,在<select>节点中必须配置resultType或resultMap中的某1个属性( ...

  3. 一文理清Mybatis中resultType与resultMap之间的关系和使用场景

    点击蓝色"程序猿DD"关注我 回复"资源"获取独家整理的学习资料! 1.概述 Mybatis ORM半自动映射框架对java开发工程师来说应该是必会的框架之一. ...

  4. [转]MyBatis中resultType与resultMap区别

    MyBatis中关于resultType和resultMap的具体区别如下: MyBatis中在查询进行select映射的时候,返回类型可以用resultType,也可以用resultMap. res ...

  5. MyBatis之输入与输出(resultType、resultMap)映射

    2019独角兽企业重金招聘Python工程师标准>>> 在MyBatis中,我们通过parameterType完成输入映射(指将值映射到sql语句的占位符中,值的类型与dao层响应方 ...

  6. MyBatis之输入(parameterType)与输出(resultType、resultMap)映射

    MyBatis之输入(parameterType)与输出(resultType.resultMap)映射 2017/9/30 在MyBatis中,我们通过parameterType完成输入映射(指将值 ...

  7. mybatis中resultType和resultMap的区别

    MyBatis中在查询进行select映射的时候,返回类型可以用resultType,也可以用resultMap resultType是直接表示返回类型的,而resultMap则是对外部ResultM ...

  8. MyBatis -- resultType 和 resultMap

    MyBatis -- resultType 和 resultMap 一.返回类型:resultType 二.返回字典映射:resultMap 一.返回类型:resultType 绝⼤数查询场景可以使用 ...

  9. MyBatis中关于resultType和resultMap的区别

    使用resultType做自动映射时,要注意字段名和POJO的属性名必须一致. 使用resultType做自动映射时,可以不一致.但是你要想不一致.那么就必须在<mapper>标签下,添加 ...

  10. 详解Mybatis中的resultType和resultMap

    resultType和resultMap是Mybatis基于xml配置开发过程中sql语句所在标签的一种属性,它们的特性如下: 1. resultType:该属性是为了配置mybatis查询的返回结果 ...

最新文章

  1. access导出MySQL表格_如何将Access数据库里的表内容导出到Excel
  2. 用python画图代码简单-【Matplotlib】利用Python进行绘图
  3. java 优先队列从小到大,优先队列(Java)
  4. OpenGL Julia Fractal(Julia分形)的实例
  5. 多个tomcat配置
  6. SAP UI5 Component-preload.js
  7. C# StreamReader类和StreamWriter类
  8. 团队开发框架(Developement Structure for Team),内容列表及整理计划
  9. 550什么意思_研报翻译官第二期:带你了解什么是CPI
  10. u盘启动pxe安装linux,U盘启动安装centos5.5+centos6.3+PXE网络安装CentOS
  11. 数据 3 分钟 | PolarDB、OceanBase 相继宣布开源;OceanBase 斩获 TPC-H 榜单第一
  12. mysql text类型效率_mysql使用笔记:vachar,char,text比较
  13. oracle系统AP对应的凭证编号,AP主要账户及会计分录
  14. webgl天空盒边界缝隙_WebGL three.js进修笔记 法向量网格材质MeshNormalMaterial的引见和建立360度全景天空盒的要领...
  15. 阿里笔试题20春招笔试题汇总_python版本
  16. 大数据可视化工具在中国的发展历程
  17. 让你5分钟明白美国金融危机爆发的原因!
  18. Tire树(字典树)
  19. 怎么对注册表中的垃圾文件进行清理?
  20. 期货股票自动交易下单接口怎么执行策略函数?

热门文章

  1. 如何解决windows7开机后放大镜自动启动的问题
  2. Easy Touch组件API详解
  3. 新媒体运营胡耀文教程:活动运营推广数据分析公式
  4. 让Pqmagic在Server版中运行
  5. 机械师 F117 毒药参数配置 怎么样
  6. Practice-6 SVM分类器
  7. [答疑]公安机关对自己本辖区需要管理的人员叫做“实有人口“
  8. 验证码(Captcha)的两种校对机制
  9. Fight2.0(未完)
  10. C++程序设计机制:RAII机制