소스 검색

优惠券统计

liujunchi 3 년 전
부모
커밋
b7107fcc39
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      cooleshow-user/user-biz/src/main/resources/config/mybatis/CouponIssueMapper.xml

+ 3 - 3
cooleshow-user/user-biz/src/main/resources/config/mybatis/CouponIssueMapper.xml

@@ -86,7 +86,7 @@
                         and ci.end_time_ < #{query.expiredTime} and ci.use_state_  = 'USABLE'
                     </when>
                     <when test="query.useState.code == 'USABLE'">
-                        and ci.end_time_ &gt;= #{query.expiredTime} and ci.use_state_ = 'USABLE'
+                        and ci.end_time_ &gt;= #{query.expiredTime} and ci.start_time_ &lt;= #{query.expiredTime} and ci.use_state_ = 'USABLE'
                     </when>
                     <otherwise>
                         and ci.use_state_ = #{query.useState}
@@ -139,10 +139,10 @@
             <if test="record.timestamp != null">
                 <choose>
                     <when test="record.userState.code == 'USABLE'">
-                        AND t1.start_time_ &lt;= #{record.timestamp} AND #{record.timestamp} &lt;= t1.end_time_ AND (t1.order_no_ IS NULL OR t1.order_no_ = '')
+                        AND t1.start_time_ &lt;= #{record.timestamp} AND #{record.timestamp} &lt;= t1.end_time_ AND t1.use_state_ = 'USABLE'
                     </when>
                     <when test="record.userState.code == 'EXPIRED'">
-                        AND #{record.timestamp} &gt;= t1.end_time_
+                        AND #{record.timestamp} &gt;= t1.end_time_ AND t1.use_state_ = 'USABLE'
                     </when>
                     <when test="record.userState.code == 'USED'">
                         AND t1.order_no_ != ''