Helius
2021-01-22 f2cff389b837f10f87af26201beba4542c56bbbd
modify
3 files modified
87 ■■■■ changed files
zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java 12 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java 14 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml 61 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java
@@ -291,18 +291,16 @@
                    case "4" :
                        return tjVipSumDao.selectStaffGoodsAchieve(timeSpaceParam, staffId);
                    case "5" :
                        return tjVipSumDao.selectStaffCardUseAchieve(timeSpaceParam, staffId);
                    case "6" :
                        return tjVipSumDao.selectStaffHisConsumeAchieve(timeSpaceParam, staffId);
                    case "7" :
                    case "6" :
                        return tjVipSumDao.selectStaffFreeConsumeAchieve(timeSpaceParam, staffId);
                    case "8" :
                    case "7" :
                        return tjVipSumDao.selectStaffCommissionAchieve(timeSpaceParam, staffId);
                    case "9" :
                    case "8" :
                        return tjVipSumDao.selectStaffPeopleNum(timeSpaceParam, staffId);
                    case "10" :
                    case "9" :
                        return tjVipSumDao.selectStaffProjNum(timeSpaceParam, staffId);
                    case "11" :
                    case "10" :
                        return tjVipSumDao.selectStaffProjTime(timeSpaceParam, staffId);
                    default:
                        return tjVipSumDao.selectStaffOrderAchieve(timeSpaceParam, staffId);
zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java
@@ -83,15 +83,27 @@
    List<VipAchieveDataShowVo> selectVipAchieveInPage(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("userId") Long userId);
    // 订单业绩
    Map<String, BigDecimal> selectStaffOrderAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId);
    // 现金业绩
    Map<String, BigDecimal> selectStaffCashAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId);
    // 划扣业绩
    Map<String, BigDecimal> selectStaffCardAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId);
    // 订单提成
    Map<String, BigDecimal> selectStaffGoodsAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId);
    Map<String, BigDecimal> selectStaffCardUseAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId);
    // 本金消耗
    Map<String, BigDecimal> selectStaffHisConsumeAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId);
    // 赠送消耗
    Map<String, BigDecimal> selectStaffFreeConsumeAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId);
    // 服务提成
    Map<String, BigDecimal> selectStaffCommissionAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId);
    // 人头数目
    Map<String, BigDecimal> selectStaffPeopleNum(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId);
    // 项目数
    Map<String, BigDecimal> selectStaffProjNum(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId);
    // 服务时长
    Map<String, BigDecimal> selectStaffProjTime(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId);
    Map<String, BigDecimal> selectStaffCardUseAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId);
}
zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml
@@ -545,14 +545,12 @@
    <select id="selectStaffOrderAchieve" resultType="java.util.TreeMap">
        select
        <foreach collection="list" index="index" item="item"   separator=","  >
            (
            select
                IFNULL(SUM((IFNULL(a.card_cash,0) +IFNULL(a.proj_cash,0) + IFNULL(a.goods_cash,0))),0)
            from  achieve_new a
            where   <![CDATA[datatime > #{item.beginTime}   and  datatime < #{item.endTime} ]]>
            <if test="staffId != null and staffId != 0">
                and sale_id=#{staffId}
            </if>
            (select ifnull(sum(ifnull(card_cash,0) + ifnull(consume,0)),0)
                from achieve_new a
                where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]>
                <if test="staffId != null and staffId != 0">
                    and a.beault_id=#{staffId}
                </if>
            ) as t${index}
        </foreach>
@@ -562,14 +560,12 @@
    <select id="selectStaffCashAchieve" resultType="java.util.TreeMap">
        select
        <foreach collection="list" index="index" item="item"   separator=","  >
            (
            select
            IFNULL(SUM((IFNULL(a.proj_cash,0))),0)
            from  achieve_new a
            where   <![CDATA[datatime > #{item.beginTime}   and  datatime < #{item.endTime} ]]>
            <if test="staffId != null and staffId != 0">
                and sale_id=#{staffId}
            </if>
            (select ifnull(sum(case t3 when '现金业绩' then card_cash else 0 end),0)
                from achieve_new a
                where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]>
                <if test="staffId != null and staffId != 0">
                    and a.beault_id=#{staffId}
                </if>
            ) as t${index}
        </foreach>
@@ -579,13 +575,11 @@
    <select id="selectStaffCardAchieve" resultType="java.util.TreeMap">
        select
        <foreach collection="list" index="index" item="item"   separator=","  >
            (
            select
            IFNULL(SUM((IFNULL(a.card_cash,0))),0)
            from  achieve_new a
            where   <![CDATA[datatime > #{item.beginTime}   and  datatime < #{item.endTime} ]]>
            (select ifnull(sum(case t3 when '划扣业绩' then consume else 0 end),0)
            from achieve_new a
            where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]>
            <if test="staffId != null and staffId != 0">
                and sale_id=#{staffId}
                and a.beault_id=#{staffId}
            </if>
            ) as t${index}
@@ -596,13 +590,11 @@
    <select id="selectStaffGoodsAchieve" resultType="java.util.TreeMap">
        select
        <foreach collection="list" index="index" item="item"   separator=","  >
            (
            select
            IFNULL(SUM((IFNULL(a.goods_cash,0))),0)
            from  achieve_new a
            where   <![CDATA[datatime > #{item.beginTime}   and  datatime < #{item.endTime} ]]>
            (select ifnull(sum(ifnull(proj_percentage, 0)),0)
                from achieve_new a
                where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> and order_type='订单'
            <if test="staffId != null and staffId != 0">
                and sale_id=#{staffId}
                and a.beault_id=#{staffId}
            </if>
            ) as t${index}
        </foreach>
@@ -660,14 +652,11 @@
    <select id="selectStaffCommissionAchieve" resultType="java.util.TreeMap">
        select
        <foreach collection="list" index="index" item="item"   separator=","  >
            (
            select
            IFNULL(SUM((IFNULL(a.proj_percentage,0))),0)
            from  achieve_new a
            where   <![CDATA[datatime > #{item.beginTime}   and  datatime < #{item.endTime} ]]>
            <if test="staffId != null and staffId != 0">
                and beault_id=#{staffId}
            </if>
            (select ifnull(sum(ifnull(proj_percentage, 0)),0) from achieve_new a
                where  <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> and order_type='服务单'
                <if test="staffId != null and staffId != 0">
                    and a.beault_id=#{staffId}
                </if>
            ) as t${index}
        </foreach>
        from area where id=1