| | |
| | | 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); |
| | |
| | | |
| | | 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); |
| | | |
| | | } |
| | |
| | | <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) |
| | | (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 sale_id=#{staffId} |
| | | and a.beault_id=#{staffId} |
| | | </if> |
| | | ) as t${index} |
| | | |
| | |
| | | <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) |
| | | (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 sale_id=#{staffId} |
| | | and a.beault_id=#{staffId} |
| | | </if> |
| | | ) as t${index} |
| | | |
| | |
| | | <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) |
| | | (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} |
| | | |
| | |
| | | <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) |
| | | (select ifnull(sum(ifnull(proj_percentage, 0)),0) |
| | | from achieve_new a |
| | | where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> |
| | | 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> |
| | |
| | | <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} ]]> |
| | | (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 beault_id=#{staffId} |
| | | and a.beault_id=#{staffId} |
| | | </if> |
| | | ) as t${index} |
| | | </foreach> |