| | |
| | | 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> |
| | | |
| | |
| | | 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"> |
| | |
| | | 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> |