| | |
| | | NOW()>=hb_pre_get_time limit |
| | | #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | <select id="countCanBalanceHongBaoByTypeAndUid" resultType="java.lang.Long"> |
| | | select |
| | | count(hb_id) |
| | | from yeshi_ec_hongbao_v2 where hb_uid=#{uid} and `hb_version`=2 |
| | | from yeshi_ec_hongbao_v2 where hb_uid=#{uid} and |
| | | `hb_version`=2 |
| | | |
| | | <foreach collection="types" item="type" open=" and (" |
| | | separator=" or " close=")"> |
| | |
| | | hb_pre_get_time>0 AND |
| | | NOW()>=hb_pre_get_time |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="countInviteOrderCountByUidAndSettleTime" resultType="java.lang.Long"> |
| | | SELECT COUNT(h.hb_id) FROM yeshi_ec_hongbao_v2 h LEFT JOIN |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="listBySourceTypeAndTradeIdListAndUid" resultMap="BaseResultMap"> |
| | | SELECT a.* FROM |
| | | ( |
| | | SELECT * FROM yeshi_ec_hongbao_v2 v WHERE v.`hb_uid`=#{uid} |
| | | ) a |
| | | LEFT JOIN |
| | | ( |
| | | SELECT ho.`ho_hongbao_id` AS hbId FROM yeshi_ec_hongbao_order ho LEFT JOIN |
| | | yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` WHERE |
| | | co.`co_source_type`=#{sourceType} |
| | | <if test="tradeIdList!=null"> |
| | | <foreach collection="tradeIdList" open=" and (" close=")" |
| | | separator=" or " item="tradeId"> |
| | | co.co_trade_id=#{tradeId} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | b |
| | | ON a.hb_id=b.hbId OR a.hb_pid=b.hbId WHERE b.hbId >0 |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |