MyBatis 返回Map<String,Object>类型
<!-- 导出所有数据 -->
<select id="exportAll" resultMap="map">
SELECT t1.MEDICAL_ID AS medicalId,
ADDRESS AS address,
DATE_START AS dateStart,
DATE_END AS dateEnd,
TIME_START AS timeStart,
TIME_END AS timeEnd,
AMBULANCE_NUM AS ambulanceNum,
NAME AS name,
PHONE AS phone
FROM PM.T_MEETING_MEDICAL t1,PM.T_MEETING_MEDICAL_DOCTOR t2
<where>
t1.MEDICAL_ID = t2.MEDICAL_ID
<if test="address != null and address !='' ">
AND ADDRESS = #{address}
</if>
<if test="dateStart != null and dateStart !='' ">
AND DATE_START = #{dateStart}
</if>
<if test="dateEnd != null and dateEnd !='' ">
AND DATE_END = #{dateEnd}
</if>
<if test="meetingId != null and meetingId !='' ">
AND MEETING_ID = #{meetingId}
</if>
</where>
ORDER BY t1.ADDRESS,t1.DATE_START
</select>
public List<Map<String, Object>> exportAll(MeetingMedicalVo meetingMedicalVo); //接口
<resultMap type="map" id="timeStampMap">
<result property="beginTime" column="beginTime" javaType="date"/>
<result property="endTime" column="endTime" javaType="date"/>
<result property="stayTime" column="stayTime" javaType="date"/>
<result property="leaveTime" column="leaveTime" javaType="date"/>
</resultMap>
MyBatis 返回Map<String,Object>类型的更多相关文章
- mybatis使用Map<String,Object>映射mysql结果集,关于字段的问题
--mysql常用字段类型如图 --mybatis使用Map<String,Object>映射,会将tinyint映射成Integer类型.decimal映射成BigDecimal类型 所 ...
- mybatis foreach Map(String,List)类型
<select id="queryList" resultType="com.performancetest.modules.ptest.entity.Stress ...
- Mybatis 遍历 List<Map<String,Object>>
在上一篇博客中总结了MyBatis Plus 实现多表分页模糊查询(链接在最后).返回类型是编写一个专门的vo类.这次是返回List < Map > 前言 编写一个专门的vo返回类,主 ...
- 使用 JDBC 和 JavaTemplate 查询SQL语句返回 List<Map<String,Object>>
使用JDBC执行sql语句返回List 类型: public class JdbcUtil { private static Log log = LogFactory.getLog(JdbcUtil. ...
- oracle 连接数据库并查询,返回List<Map<String, Object>> 数据
package JDBC; import java.sql.Clob; import java.sql.Connection; import java.sql.DriverManager; impor ...
- mybatis返回map类型数据空值字段不显示的解决方法
在日常开发中,查询数据返回类型为map,数据库中有些自动值为null,则返回的结果中没有值为空的字段,则如何显示值为空的字段呢? Spring boot + MyBatis返回map中null值默认不 ...
- Map<String,Object>接收参数,Long类型降级为Integer,报类型转换异常
前言 今天看群里小伙伴问了一个非常有意思的问题: 使用 Map<String,Object> 对象接收前端传递的参数,在后端取参时,因为接口文档中明确该字段类型为 Long ,所以对接收的 ...
- jpa返回List<Map<String, Object>>相当于jdbctemplate的queryForlist
public class Test(){ @PersistenceContext(unitName = "manageFactory") protected EntityManag ...
- Mybatis,返回Map的时候,将Map内的Key转换为驼峰的命名
每次使用mybatis的时候,简单的连表查询,用Map接收的时候,都是像DB定义的字段一样,类似以下 student_name,student_id,没有转换为驼峰,但是又不能因为这一个定义一个jav ...
随机推荐
- 【原创】《从0开始学Elasticsearch》—初识Elasticsearch
目录 1. Elasticsearch 是什么2. Elasticsearch 中基本概念3. Elasticsearch 安装4. 访问 Elasticsearch 1. Elasticsearch ...
- 安装ipython解释器
安装ipython解释器 1.安装ipython,指定douban源下载 pip3 install -i https://pypi.douban.com/simple ipython 2.安装朱皮特 ...
- 数据结构 - 动态单链表的实行(C语言)
动态单链表的实现 1 单链表存储结构代码描述 若链表没有头结点,则头指针是指向第一个结点的指针. 若链表有头结点,则头指针是指向头结点的指针. 空链表的示意图: 带有头结点的单链表: 不带头结点的单链 ...
- 题解报告:hdu 1408 盐水的故事
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1408 Problem Description 挂盐水的时候,如果滴起来有规律,先是滴一滴,停一下:然后 ...
- border-1px的实现(stylus)
当样式像素一定时,因手机有320px,640px等.各自的缩放比差异,所以设备显示像素就会有1Npx,2Npx.为保设计稿还原度,解决就是用media + scale. // stylus语法 bor ...
- AJPFX关于Collection 集合的表述
集合的遍历class Demo_Collection{ public static void main(String[] args){ Collection c = new ...
- hibernate对象状态 的小问题
Class classA{ List a; public void setA(List a) { this.a =a; } public List getA() { return this.a; } ...
- 基于C++11的call wrapper
要在C++中应用AOP,不像在其他的基于解释器的语言中那么方便,作为一种静态语言,如果给函数或者类的方法造一个wrapper,在wrapper里面嵌入调用前的代码和调用后的代码,也能达到一定程度的代码 ...
- Farseer.net轻量级ORM开源框架 V1.0 开发目标
本篇主要给大家说明下在V1.0中,计划开发的任务的状态.按照国际惯例.上大表格 开发计划状态 编号 模块 状态 说明 1 分离Utils.Extend.UI √ 在V0.2版本中,是集成在一个项 ...
- angular2快速开始
简介 5 分钟从0搭建一个ng2项目demohttps://angular.io/docs/js/latest/quickstart.html 你运气真好,竟然看到了这篇文章,你省事了,一分钟让你完成 ...