From 83be430710bd0269cfc781ab241ff2aba93106f0 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Wed, 06 Jan 2021 16:06:43 +0800
Subject: [PATCH] modify
---
zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml | 179 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 179 insertions(+), 0 deletions(-)
diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml
index 02ff341..43e968b 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml
@@ -282,5 +282,184 @@
</if>
</if>
</select>
+
+ <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>
+ ) as t${index}
+
+ </foreach>
+ from area where id=1
+ </select>
+
+ <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>
+ ) as t${index}
+
+ </foreach>
+ from area where id=1
+ </select>
+
+ <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} ]]>
+ <if test="staffId != null and staffId != 0">
+ and sale_id=#{staffId}
+ </if>
+ ) as t${index}
+
+ </foreach>
+ from area where id=1
+ </select>
+
+ <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} ]]>
+ <if test="staffId != null and staffId != 0">
+ and sale_id=#{staffId}
+ </if>
+ ) as t${index}
+ </foreach>
+ from area where id=1
+ </select>
+
+ <select id="selectStaffCardUseAchieve" resultType="java.util.TreeMap">
+ select
+ <foreach collection="list" index="index" item="item" separator="," >
+ (
+ select
+ IFNULL(SUM((IFNULL(a.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}
+ </if>
+ ) as t${index}
+ </foreach>
+ from area where id=1
+ </select>
+
+ <select id="selectStaffHisConsumeAchieve" resultType="java.util.TreeMap">
+ select
+ <foreach collection="list" index="index" item="item" separator="," >
+ (
+ select
+ IFNULL(SUM((IFNULL(a.his_consume,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>
+ ) as t${index}
+ </foreach>
+ from area where id=1
+ </select>
+
+ <select id="selectStaffFreeConsumeAchieve" resultType="java.util.TreeMap">
+ select
+ <foreach collection="list" index="index" item="item" separator="," >
+ (
+ select
+ IFNULL(SUM((IFNULL(a.free_consume,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>
+ ) as t${index}
+ </foreach>
+ from area where id=1
+ </select>
+
+ <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>
+ ) as t${index}
+ </foreach>
+ from area where id=1
+ </select>
+
+ <select id="selectStaffPeopleNum" resultType="java.util.TreeMap">
+ select
+ <foreach collection="list" index="index" item="item" separator="," >
+ (
+ select
+ IFNULL(SUM((IFNULL(a.number_of_people,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>
+ ) as t${index}
+ </foreach>
+ from area where id=1
+ </select>
+
+ <select id="selectStaffProjNum" resultType="java.util.TreeMap">
+ select
+ <foreach collection="list" index="index" item="item" separator="," >
+ (
+ select
+ IFNULL(SUM((IFNULL(a.proj_num,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>
+ ) as t${index}
+ </foreach>
+ from area where id=1
+ </select>
+
+ <select id="selectStaffProjTime" resultType="java.util.TreeMap">
+ select
+ <foreach collection="list" index="index" item="item" separator="," >
+ (
+ select
+ IFNULL(SUM((IFNULL(a.proj_time,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>
+ ) as t${index}
+ </foreach>
+ from area where id=1
+ </select>
</mapper>
--
Gitblit v1.9.1