jyy
2021-07-14 d13ae240c54c59b04c0571bfc0136ed0c8ba32a3
zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml
@@ -636,7 +636,7 @@
                    )totalPay,
                (select IFNULL(sum(a.amount),0) from sys_order_flow a
                    inner join sys_order b on a.order_id=b.id and b.statu!='已取消'
                    where a.pay_method not in ('储值卡', '欠款') and a.flow_type != '退款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
                    where a.pay_method not in ('储值卡', '欠款') and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
                    <if test="shopId != null">
                        and a.shop_id=#{shopId}
                    </if>
@@ -716,6 +716,28 @@
                        and a.company_id=#{companyId}
                    </if>
                ) refund,
                (select sum(IFNULL(amount, 0))
                    from sys_order_flow a
                    inner join sys_order b on a.order_id=b.id and b.STATU!='已取消'
                    where a.pay_method='储值卡' and a.is_gift='N' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
                    <if test="shopId != null">
                        and a.shop_id=#{shopId}
                    </if>
                    <if test="companyId != null">
                        and a.company_id=#{companyId}
                    </if>
                ) cardAmount,
                (select sum(IFNULL(amount, 0))
                    from sys_order_flow a
                    inner join sys_order b on a.order_id=b.id and b.STATU!='已取消'
                    where a.pay_method='储值卡' and a.is_gift='Y' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
                    <if test="shopId != null">
                        and a.shop_id=#{shopId}
                    </if>
                    <if test="companyId != null">
                        and a.company_id=#{companyId}
                    </if>
                ) cardFreeAmount,
                (select IFNULL(count(1),0) from sys_order
                    where STATU in ('已付款', '欠款') and orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]>
                    <if test="shopId != null">