admin
2019-08-29 c3b33f84b6ce927b4be681a4f1e4080706d390a9
fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoV2Mapper.xml
@@ -223,11 +223,12 @@
      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=")">
@@ -241,7 +242,7 @@
      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
@@ -359,6 +360,26 @@
      </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