From 0f3913854344bc3496fd36fc778965689e3e50c4 Mon Sep 17 00:00:00 2001
From: yujian <yujian>
Date: 星期一, 25 三月 2019 14:06:01 +0800
Subject: [PATCH] PushRecordDAO改造

---
 fanli/src/main/java/com/yeshi/fanli/mapping/push/PushRecordMapper.xml |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/push/PushRecordMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/push/PushRecordMapper.xml
index c064c04..c950a64 100644
--- a/fanli/src/main/java/com/yeshi/fanli/mapping/push/PushRecordMapper.xml
+++ b/fanli/src/main/java/com/yeshi/fanli/mapping/push/PushRecordMapper.xml
@@ -68,4 +68,41 @@
       <if test="uid != null">uid=#{uid,jdbcType=BIGINT},</if>
     </set> where id = #{id,jdbcType=BIGINT}
   </update>
+  
+  <select id="listQuery" resultMap="BaseResultMap">
+  	SELECT * FROM yeshi_ec_push_record p
+	WHERE 1=1
+		<if test="key != null and key != '' ">
+			AND p.`title` LIKE '%${key}%' 
+		</if>
+		<if test="type != null and type != 0 ">
+			AND p.`type` = #{type}
+		</if>
+	ORDER BY p.id DESC
+	LIMIT #{start},#{count}
+  </select>
+  
+  <select id="countQuery" resultType="java.lang.Long">
+  	SELECT IFNULL(COUNT(p.`id`),0) FROM yeshi_ec_push_record p
+	WHERE 1=1
+		<if test="key != null and key != '' ">
+			AND p.`title` LIKE '%${key}%' 
+		</if>
+		<if test="type != null and type != 0 ">
+			AND p.`type` = #{type}
+		</if>
+  </select>
+  
+  <select id="getByAndroidPushId" resultMap="BaseResultMap">
+  	SELECT * FROM yeshi_ec_push_record p
+	WHERE p.`androidPushId` = #{pushId}
+	LIMIT 1
+  </select>
+  
+  <select id="getByIosPushId" resultMap="BaseResultMap">
+  	SELECT * FROM yeshi_ec_push_record p
+	WHERE p.`iosPushId` = #{pushId}
+	LIMIT 1
+  </select>
+  
 </mapper>

--
Gitblit v1.8.0