Helius
2021-04-09 717fc5108619373bd7528c7b8b80ca31dd3f3cea
modify
3 files modified
54 ■■■■■ changed files
zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java 8 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java 6 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml 40 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java
@@ -154,6 +154,10 @@
                            return tjVipSumDao.selectProjConsumeCnt(timeSpaceParam, shopId, null);
                        case "20" :
                            return tjVipSumDao.selectTimeLength(timeSpaceParam, shopId, null);
                        case "21" :
                            return tjVipSumDao.selectCardAmount(timeSpaceParam, shopId, null);
                        case "22" :
                            return tjVipSumDao.selectFreeAmount(timeSpaceParam, shopId, null);
                        default :
                            return tjVipSumDao.selectBusinessInCome(timeSpaceParam, shopId, null);
                    }
@@ -205,6 +209,10 @@
                            return tjVipSumDao.selectProjConsumeCnt(timeSpaceParam, null, companyId);
                        case "20" :
                            return tjVipSumDao.selectTimeLength(timeSpaceParam, null, companyId);
                        case "21" :
                            return tjVipSumDao.selectCardAmount(timeSpaceParam, null, companyId);
                        case "22" :
                            return tjVipSumDao.selectFreeAmount(timeSpaceParam, null, companyId);
                        default :
                            return tjVipSumDao.selectBusinessInCome(timeSpaceParam, null, companyId);
                    }
zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java
@@ -81,6 +81,12 @@
    // 服务时长
    Map<String, BigDecimal> selectTimeLength(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId);
    // 储值卡本金扣款
    Map<String, BigDecimal> selectCardAmount(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId);
    // 储值卡赠金扣款
    Map<String, BigDecimal> selectFreeAmount(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId);
    List<VipAchieveDataShowVo> selectVipAchieveInPage(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("userId") Long userId);
    // 订单业绩
zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml
@@ -523,6 +523,46 @@
        from area where id=1
    </select>
    <select id="selectCardAmount" resultType="java.util.TreeMap">
        select
        <foreach collection="list" index="index" item="item"   separator=","  >
            (
            select IFNULL(sum(IFNULL(amount, 0)), 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>
            ) as t${index}
        </foreach>
        from area where id=1
    </select>
    <select id="selectFreeAmount" resultType="java.util.TreeMap">
        select
        <foreach collection="list" index="index" item="item"   separator=","  >
            (
            select IFNULL(sum(IFNULL(amount, 0)), 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>
            ) as t${index}
        </foreach>
        from area where id=1
    </select>
    <select id="selectVipAchieveInPage" resultType="com.matrix.system.app.vo.VipAchieveDataShowVo">
        <foreach collection="list" index="index" item="item"   separator="union all"  >
            select