1
0
fushengqian 1 жил өмнө
parent
commit
14c5329dba

+ 7 - 2
fuint-application/src/main/java/com/fuint/common/service/impl/OrderServiceImpl.java

@@ -1770,11 +1770,16 @@ public class OrderServiceImpl extends ServiceImpl<MtOrderMapper, MtOrder> implem
      * */
     @Override
     public BigDecimal getPayMoney(Integer merchantId, Integer storeId, Date beginTime, Date endTime) {
+        BigDecimal payMoney;
         if (storeId > 0) {
-            return mtOrderMapper.getStorePayMoneyByTime(storeId, beginTime, endTime);
+            payMoney = mtOrderMapper.getStorePayMoneyByTime(storeId, beginTime, endTime);
         } else {
-            return mtOrderMapper.getPayMoneyByTime(merchantId, beginTime, endTime);
+            payMoney = mtOrderMapper.getPayMoneyByTime(merchantId, beginTime, endTime);
         }
+        if (payMoney == null) {
+            return new BigDecimal("0");
+        }
+        return payMoney;
     }
 
     /**

+ 12 - 12
fuint-repository/src/main/resources/mapper/MtOrderMapper.xml

@@ -2,25 +2,25 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fuint.repository.mapper.MtOrderMapper">
     <select id="getOrderCount" resultType="java.math.BigDecimal">
-        select count(*) from mt_order t where t.STATUS != 'G'
+        select count(*) from mt_order t where t.STATUS not in('C', 'G', 'H')
         <if test="merchantId != null and merchantId > 0">
             AND t.MERCHANT_ID = #{merchantId}
         </if>
     </select>
 
     <select id="getStoreOrderCount" resultType="java.math.BigDecimal">
-        select count(*) from mt_order t where t.STORE_ID = #{storeId} and t.STATUS != 'G'
+        select count(*) from mt_order t where t.STORE_ID = #{storeId} and t.STATUS not in('C', 'G', 'H')
     </select>
 
     <select id="getOrderCountByTime" resultType="java.math.BigDecimal">
-        select count(0) from mt_order t where t.CREATE_TIME &gt;= #{beginTime} and t.CREATE_TIME &lt; #{endTime} and t.STATUS != 'G'
+        select count(0) from mt_order t where t.CREATE_TIME &gt;= #{beginTime} and t.CREATE_TIME &lt; #{endTime} and t.STATUS not in('C', 'G', 'H')
         <if test="merchantId != null and merchantId > 0">
             AND t.MERCHANT_ID = #{merchantId}
         </if>
     </select>
 
     <select id="getStoreOrderCountByTime" resultType="java.math.BigDecimal">
-        select count(0) from mt_order t where t.STORE_ID = #{storeId} and t.CREATE_TIME &lt; #{endTime} and t.CREATE_TIME &gt;= #{beginTime} and t.STATUS != 'G'
+        select count(0) from mt_order t where t.STORE_ID = #{storeId} and t.CREATE_TIME &lt; #{endTime} and t.CREATE_TIME &gt;= #{beginTime} and t.STATUS not in('C', 'G', 'H')
     </select>
 
     <select id="findByOrderSn" resultType="com.fuint.repository.model.MtOrder">
@@ -28,41 +28,41 @@
     </select>
 
     <select id="getPayMoney" resultType="java.math.BigDecimal">
-        SELECT sum(t.AMOUNT) as num FROM mt_order t where t.PAY_STATUS='B' and t.STATUS != 'G'
+        SELECT sum(t.AMOUNT) as num FROM mt_order t where t.PAY_STATUS='B' and t.STATUS not in('C', 'G', 'H')
         <if test="merchantId != null and merchantId > 0">
             AND t.MERCHANT_ID = #{merchantId}
         </if>
     </select>
 
     <select id="getPayMoneyByTime" resultType="java.math.BigDecimal">
-        SELECT sum(t.AMOUNT) as num FROM mt_order t where t.PAY_STATUS='B' and t.CREATE_TIME &lt; #{endTime} and t.CREATE_TIME &gt;= #{beginTime} and t.STATUS != 'G'
+        SELECT sum(t.AMOUNT) as num FROM mt_order t where t.PAY_STATUS='B' and t.CREATE_TIME &lt; #{endTime} and t.CREATE_TIME &gt;= #{beginTime} and t.STATUS not in('C', 'G', 'H')
         <if test="merchantId != null and merchantId > 0">
             AND t.MERCHANT_ID = #{merchantId}
         </if>
     </select>
 
     <select id="getStorePayMoneyByTime" resultType="java.math.BigDecimal">
-        SELECT sum(t.AMOUNT) as num FROM mt_order t where t.STORE_ID = #{storeId} and t.PAY_STATUS='B' and t.CREATE_TIME &lt; #{endTime} and t.CREATE_TIME &gt;= #{beginTime} and t.STATUS != 'G'
+        SELECT sum(t.AMOUNT) as num FROM mt_order t where t.STORE_ID = #{storeId} and t.PAY_STATUS='B' and t.CREATE_TIME &lt; #{endTime} and t.CREATE_TIME &gt;= #{beginTime} and t.STATUS not in('C', 'G', 'H')
     </select>
 
     <select id="getStorePayMoney" resultType="java.math.BigDecimal">
-        SELECT sum(t.AMOUNT) as num FROM mt_order t where t.STORE_ID = #{storeId} and t.PAY_STATUS='B' and t.STATUS != 'G'
+        SELECT sum(t.AMOUNT) as num FROM mt_order t where t.STORE_ID = #{storeId} and t.PAY_STATUS='B' and t.STATUS not in('C', 'G', 'H')
     </select>
 
     <select id="getPayUserCount" resultType="java.lang.Integer">
-        SELECT COUNT(DISTINCT t.USER_ID) as num FROM mt_order t where t.PAY_STATUS='B' and t.STATUS != 'G'
+        SELECT COUNT(DISTINCT t.USER_ID) as num FROM mt_order t where t.PAY_STATUS='B' and t.STATUS not in('C', 'G', 'H')
     </select>
 
     <select id="getStorePayUserCount" resultType="java.lang.Integer">
-        SELECT COUNT(DISTINCT t.USER_ID) as num FROM mt_order t where t.STORE_ID = #{storeId} and t.PAY_STATUS='B' and t.STATUS != 'G'
+        SELECT COUNT(DISTINCT t.USER_ID) as num FROM mt_order t where t.STORE_ID = #{storeId} and t.PAY_STATUS='B' and t.STATUS not in('C', 'G', 'H')
     </select>
 
     <select id="getUserPayMoney" resultType="java.math.BigDecimal">
-        SELECT sum(t.PAY_AMOUNT) as num FROM mt_order t where t.USER_ID = #{userId} and t.PAY_STATUS='B' and t.STATUS != 'G'
+        SELECT sum(t.PAY_AMOUNT) as num FROM mt_order t where t.USER_ID = #{userId} and t.PAY_STATUS='B' and t.STATUS not in('C', 'G', 'H')
     </select>
 
     <select id="getUserPayOrderCount" resultType="java.lang.Integer">
-        SELECT COUNT(DISTINCT t.ID) as num FROM mt_order t where t.USER_ID = #{userId} and t.PAY_STATUS='B' and t.STATUS != 'G'
+        SELECT COUNT(DISTINCT t.ID) as num FROM mt_order t where t.USER_ID = #{userId} and t.PAY_STATUS='B' and t.STATUS not in('C', 'G', 'H')
     </select>
 
     <select id="getTobeCommissionOrderList" resultType="com.fuint.repository.model.MtOrder">