标签:cal sql span bsp 键值 tar exp name res
<resultMap type="map" id="stringMap"> <result property="contentIntr" column="contentIntr" javaType="string" /> </resultMap> <!-- 导出所有数据 --> <select id="exportAll" resultMap="stringMap"> 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); //接口
//这个摘自http://www.cnblogs.com/TheoryDance/p/5818977.html MyBatis返回Map键值对数据 List<Map<String, String>> getMtypeList(); <select id="getMtypeList" resultType="java.util.HashMap"> select code,`name` from jk_control_measure </select> 复制代码 [DEBUG] 2016-08-29 17:50:09 :==> Executing: select code,`name` from jk_control_measure [DEBUG] 2016-08-29 17:50:09 :==> Parameters: [DEBUG] 2016-08-29 17:50:10 :<== Columns: code, name [DEBUG] 2016-08-29 17:50:10 :<== Row: one, 地面冲洗 [DEBUG] 2016-08-29 17:50:10 :<== Row: two, 边界围挡 [DEBUG] 2016-08-29 17:50:10 :<== Row: three, 垃圾覆盖 [DEBUG] 2016-08-29 17:50:10 :<== Row: four, 裸地覆盖 [DEBUG] 2016-08-29 17:50:10 :<== Row: five, 洒水降尘 [DEBUG] 2016-08-29 17:50:10 :<== Row: six, 车辆冲洗 [DEBUG] 2016-08-29 17:50:10 :<== Row: seven, 建筑渣土 [DEBUG] 2016-08-29 17:50:10 :<== Row: eight, 车辆冒装 [DEBUG] 2016-08-29 17:50:10 :<== Row: nine, 扬尘覆盖 [DEBUG] 2016-08-29 17:50:10 :<== Row: ten, 车辆撒漏 [DEBUG] 2016-08-29 17:50:10 :<== Row: eleven, 车辆黑烟 [DEBUG] 2016-08-29 17:50:10 :<== Row: twelve, 道路积尘 复制代码 复制代码 [ {"NAME":"地面冲洗","name":"地面冲洗","code":"one","CODE":"one"}, {"NAME":"边界围挡","name":"边界围挡","code":"two","CODE":"two"}, {"NAME":"垃圾覆盖","name":"垃圾覆盖","code":"three","CODE":"three"}, {"NAME":"裸地覆盖","name":"裸地覆盖","code":"four","CODE":"four"}, {"NAME":"洒水降尘","name":"洒水降尘","code":"five","CODE":"five"}, {"NAME":"车辆冲洗","name":"车辆冲洗","code":"six","CODE":"six"}, {"NAME":"建筑渣土","name":"建筑渣土","code":"seven","CODE":"seven"}, {"NAME":"车辆冒装","name":"车辆冒装","code":"eight","CODE":"eight"}, {"NAME":"扬尘覆盖","name":"扬尘覆盖","code":"nine","CODE":"nine"}, {"NAME":"车辆撒漏","name":"车辆撒漏","code":"ten","CODE":"ten"}, {"NAME":"车辆黑烟","name":"车辆黑烟","code":"eleven","CODE":"eleven"}, {"NAME":"道路积尘","name":"道路积尘","code":"twelve","CODE":"twelve"} ] 复制代码 返回的结果带有大写与小写的key 如果在sql语句中的列名使用大写会怎样呢?自己测试一下吧!
MyBatis 返回Map<String,Object>类型
标签:cal sql span bsp 键值 tar exp name res
原文地址:http://www.cnblogs.com/miye/p/7112477.html