admin
2019-01-08 c84d8ecd97d111b01db9cfd807300d0491a95bc8
fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoMapper.xml
@@ -266,6 +266,7 @@
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
      yeshi_ec_hongbao where id = #{id,jdbcType=BIGINT}
   </delete>
@@ -555,14 +556,14 @@
   <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=")">
      <foreach collection="type" item="itemType" open="and ("
         separator=" or " close=")">
         h.`type`=#{itemType}
      </foreach>
      
      
      <foreach collection="state" item="itemState" open="and (" separator=" or "
         close=")">
      <foreach collection="state" item="itemState" open="and ("
         separator=" or " close=")">
         h.`state`=#{itemState}
      </foreach>
@@ -575,7 +576,8 @@
   </select>
   
   <select id="count24HOderByChannel" resultType="java.util.HashMap">
      SELECT  COALESCE(SUM(b.money*2),0) AS 'commision',  COALESCE(COUNT(b.id),0) AS'countOrder',
      SELECT COALESCE(SUM(b.money*2),0) AS 'commision',
      COALESCE(COUNT(b.id),0) AS'countOrder',
          COALESCE(SUM(b.payMoney),0) AS 'payMoney', 
          <if test="type == 1">
             FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') AS 'createDate'
@@ -599,7 +601,8 @@
             AND FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
         </if>
         <if test="endTime != null and endTime != '' ">
             AND FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]> '${endTime}'
         AND FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]>
         '${endTime}'
         </if>
         <if test="years != null and years != '' ">
             AND FROM_UNIXTIME(u.`createtime`/1000,'%Y') = '${years}'
@@ -619,7 +622,8 @@
   
   <select id="countHistoryOderByChannel" resultType="java.util.HashMap">
      
      SELECT  COALESCE(SUM(h.`money`)*2,0) AS 'commision', COALESCE(COUNT(h.id),0) AS 'countOrder',
      SELECT COALESCE(SUM(h.`money`)*2,0) AS 'commision',
      COALESCE(COUNT(h.id),0) AS 'countOrder',
          COALESCE(SUM(h.payMoney),0) AS 'payMoney',
            <if test="type == 1">
                FROM_UNIXTIME(h.`createtime`/1000,'%Y-%m-%d') AS 'createDate'
@@ -632,13 +636,15 @@
            </if>
      FROM yeshi_ec_hongbao h 
      LEFT JOIN (SELECT a.`lua_uid` AS uid FROM `yeshi_ec_log_user_active`  a 
         WHERE a.`lua_channel`='${channel}' GROUP BY a.`lua_uid`) a ON h.`uid`=a.uid
      WHERE a.`lua_channel`='${channel}' GROUP BY a.`lua_uid`) a ON
      h.`uid`=a.uid
      WHERE  (h.`type`=1 OR h.`type`=20)  AND  a.uid IS NOT NULL
            <if test="startTime != null and startTime != '' ">
             AND FROM_UNIXTIME(h.`createtime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
            </if>
            <if test="endTime != null and endTime != '' ">
                AND FROM_UNIXTIME(h.`createtime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]> '${endTime}'
         AND FROM_UNIXTIME(h.`createtime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]>
         '${endTime}'
            </if>
            <if test="years != null and years != '' ">
                AND FROM_UNIXTIME(h.`createtime`/1000,'%Y') = '${years}'