From 4cb15e222cd7d099d533ccbeb7f9a8cd99bf180c Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 25 十二月 2018 16:35:18 +0800 Subject: [PATCH] 替换原来老的资金详情 --- fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoMapper.xml | 38 ++++++++++++++++++++++++++++++++------ 1 files changed, 32 insertions(+), 6 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoMapper.xml index d3b8e96..9e22618 100644 --- a/fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoMapper.xml +++ b/fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoMapper.xml @@ -238,7 +238,8 @@ parameterType="java.lang.Long"> SELECT count(*) FROM `yeshi_ec_hongbao` h - WHERE h.`uid`=#{0} AND (h.`type`=20 OR h.`type`=21 OR h.`type`=22 OR + WHERE + h.`uid`=#{0} AND (h.`type`=20 OR h.`type`=21 OR h.`type`=22 OR h.`type`=6 OR h.`type`=7) </select> @@ -438,12 +439,13 @@ COALESCE(count(id),0) FROM `yeshi_ec_hongbao` WHERE uid =#{uid} </select> - - + + <select id="getCountByUidAndState" resultType="java.lang.Integer"> SELECT COALESCE(count(id),0) FROM `yeshi_ec_hongbao` - WHERE uid =#{uid} and state=#{state} + WHERE uid =#{uid} and + state=#{state} </select> <select id="getCountByUidOrder" resultType="java.lang.Long"> @@ -539,13 +541,37 @@ SELECT IFNULL(SUM(h.`money`),0) as ShareAndInviteMoney, <include refid="Base_Column_List" /> FROM `yeshi_ec_hongbao` h - WHERE DATE_FORMAT(FROM_UNIXTIME(h.`createtime`/1000), '%Y-%m-%d' )= #{date} + WHERE + DATE_FORMAT(FROM_UNIXTIME(h.`createtime`/1000), '%Y-%m-%d' )= #{date} <![CDATA[AND h.state <>4]]> AND ( h.`type` =5 OR h.`type` =6 OR h.`type` =7 OR h.`type` =20 OR h.`type` =21 OR h.`type` =22 ) GROUP BY h.`uid` - ORDER BY SUM(h.`money`) DESC + ORDER BY SUM(h.`money`) + DESC LIMIT ${start},${count} </select> + + <select id="selectCountByTypeAndStateAndCreateTime" resultType="java.lang.Long"> + SELECT COUNT(h.`id`) FROM yeshi_ec_hongbao h WHERE uid=#{uid} + <foreach collection="type" item="itemType" open="and (" separator=" or " + close=")"> + h.`type`=#{itemType} + </foreach> + + + <foreach collection="state" item="itemState" open="and (" separator=" or " + close=")"> + h.`state`=#{itemState} + </foreach> + + AND FROM_UNIXTIME( h.`createtime`/1000)>=#{minTime} AND FROM_UNIXTIME( + h.`createtime`/1000) + <![CDATA[ + < + ]]> + #{maxTime}; + </select> + </mapper> -- Gitblit v1.8.0