From 7a52cd14e12e5b1053a26ed5a4799da7a09d4b16 Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Tue, 24 Jul 2018 11:51:09 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/main/resources/mapper/DemoMapper.xml |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/DemoMapper.xml b/src/main/resources/mapper/DemoMapper.xml
index 3ab8c7a..8dba101 100644
--- a/src/main/resources/mapper/DemoMapper.xml
+++ b/src/main/resources/mapper/DemoMapper.xml
@@ -2,6 +2,21 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="com.moral.mapper.DemoMapper">
 	<select id="getDatas" resultType="map">
-		SELECT * FROM hangzhou_aqi ORDER BY time DESC LIMIT 7
+		SELECT *
+		FROM hangzhou_aqi
+		<where>
+			<if test="timeList != null and timeList.size &gt; 0">
+				time IN
+				<foreach collection="timeList" open="(" separator="," close=")"
+					item="listItem">
+					#{listItem}
+				</foreach>
+			</if>
+		</where>
+		ORDER BY time
+		<if test="size != null">
+			DESC 
+			LIMIT #{size}
+		</if>
 	</select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0