yujian
2019-01-09 b14e82cb4d7a6a7a43174a922f10157e4b21567c
fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml
@@ -341,7 +341,10 @@
         <if test="day != null and day == 4">  <!-- 上月 -->
            AND PERIOD_DIFF( DATE_FORMAT(NOW(), '%Y%m'),
            DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1
            <!-- 统计已收货 -->
            AND tc.`co_state` = 2
         </if>
         GROUP BY tc.`co_order_no`,tc.co_source_type)A
   </select>
@@ -660,10 +663,7 @@
      LEFT JOIN yeshi_ec_hongbao_v2 th ON
      (tr.`ho_hongbao_id` = th.`hb_id` OR
      th.`hb_pid` = tr.`ho_hongbao_id` )
      WHERE <![CDATA[tc.`co_state` <> 4]]>
      <if test="uid != null">
         AND th.`hb_uid` = ${uid}
      </if>
      WHERE th.`hb_uid` = ${uid}
      <if test="type != null and type == 1"> <!-- 自购订单 -->
         AND (th.hb_type =1 or th.hb_type =2)
      </if>
@@ -674,7 +674,7 @@
         AND (th.`hb_type` = 5 OR th.`hb_type` = 6 OR th.`hb_type` = 7 OR th.`hb_type` = 21 OR th.`hb_type` = 22)
      </if>
      <if test="day != null and day == 1"> <!-- 今天 -->
         AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW())
         AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW())
      </if>
      <if test="day != null and day == 2">  <!-- 昨天 -->
         AND TO_DAYS(NOW()) - TO_DAYS(tc.`co_create_time`) = 1
@@ -685,7 +685,10 @@
      </if>
      <if test="day != null and day == 4">  <!-- 上月 -->
         AND PERIOD_DIFF( DATE_FORMAT(NOW(), '%Y%m'),
         DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1
         DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1
         <!-- 统计已收货 -->
         AND tc.`co_state` = 2
      </if>
   </select>