|
|
@@ -463,6 +463,7 @@
|
|
|
tpi.into_no LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
or tmc.cus_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
or tmc.cus_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tmc.address_full LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
)
|
|
|
</if>
|
|
|
<if test="whList != null and whList.size()>0">
|
|
|
@@ -1644,8 +1645,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getSalesTrackingReportDetail" resultType="java.util.Map">
|
|
|
- SELECT T
|
|
|
- ."id",
|
|
|
+ SELECT T."id",
|
|
|
T."no",
|
|
|
T."itemId",
|
|
|
T."type",
|
|
|
@@ -2592,323 +2592,323 @@
|
|
|
<select id="getReportBatch" resultType="Map">
|
|
|
<!-- 我的页面 助手部分 -->
|
|
|
<if test="param.type == 'f_my_sale_info'">
|
|
|
- select f_my_sale_info as report from "dkic_b"."f_my_sale_info"(#{param.cpId}, #{param.orgId}, #{param.userId},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'))
|
|
|
+ select f_my_sale_info as report from "dkic_b"."f_my_sale_info"(#{param.cpId}, #{param.orgId}, #{param.userId, typeHandler=UuidTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'))
|
|
|
</if>
|
|
|
|
|
|
<!-- 我的页面 销售业务进度 月 -->
|
|
|
<if test="param.type == 'f_kpi_order_rate_month'">
|
|
|
- select f_kpi_order_rate_month as report from "dkic_b"."f_kpi_order_rate_month"(to_date(#{param.rateDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgId},#{param.userId})
|
|
|
+ select f_kpi_order_rate_month as report from "dkic_b"."f_kpi_order_rate_month"(to_date(#{param.rateDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgId},#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
<!-- 我的页面 销售业务进度 年 -->
|
|
|
<if test="param.type == 'f_kpi_order_rate_year'">
|
|
|
- select f_kpi_order_rate_year as report from "dkic_b"."f_kpi_order_rate_year"(to_date(#{param.rateDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgId},#{param.userId})
|
|
|
+ select f_kpi_order_rate_year as report from "dkic_b"."f_kpi_order_rate_year"(to_date(#{param.rateDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgId},#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
<!-- 我的页面 收款任务进度 月 -->
|
|
|
<if test="param.type == 'f_kpi_repay_rate_month'">
|
|
|
- select f_kpi_repay_rate_month as report from "dkic_b"."f_kpi_repay_rate_month"(to_date(#{param.rateDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgId},#{param.userId})
|
|
|
+ select f_kpi_repay_rate_month as report from "dkic_b"."f_kpi_repay_rate_month"(to_date(#{param.rateDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgId},#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
<!-- 我的页面 收款任务进度 年 -->
|
|
|
<if test="param.type == 'f_kpi_repay_rate_year'">
|
|
|
- select f_kpi_repay_rate_year as report from "dkic_b"."f_kpi_repay_rate_year"(to_date(#{param.rateDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgId},#{param.userId})
|
|
|
+ select f_kpi_repay_rate_year as report from "dkic_b"."f_kpi_repay_rate_year"(to_date(#{param.rateDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgId},#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
<!-- 报表页面 销售分析 -->
|
|
|
<if test="param.type == 'f_report_order_analysis_home'">
|
|
|
- select f_report_order_analysis_home as report from "dkic_b"."f_report_order_analysis_home"(to_date(#{param.monthDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.userId})
|
|
|
+ select f_report_order_analysis_home as report from "dkic_b"."f_report_order_analysis_home"(to_date(#{param.monthDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
<!-- 报表页面 收款分析 -->
|
|
|
<if test="param.type == 'f_report_repay_analysis'">
|
|
|
- select f_report_repay_analysis as report from "dkic_b"."f_report_repay_analysis"(to_date(#{param.monthDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.userId})
|
|
|
+ select f_report_repay_analysis as report from "dkic_b"."f_report_repay_analysis"(to_date(#{param.monthDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
<!-- 报表页面 客户分析 -->
|
|
|
<if test="param.type == 'f_report_csm_analysis_home'">
|
|
|
- select f_report_csm_analysis_home as report from "dkic_b"."f_report_csm_analysis_home"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId})
|
|
|
+ select f_report_csm_analysis_home as report from "dkic_b"."f_report_csm_analysis_home"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
|
|
|
<!-- 图形部分 -->
|
|
|
<!-- 报表页面 客户来源分布 -->
|
|
|
<if test="param.type == 'f_report_csm_from_order'">
|
|
|
- select f_report_csm_from_order as report from "dkic_b"."f_report_csm_from_order"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId})
|
|
|
+ select f_report_csm_from_order as report from "dkic_b"."f_report_csm_from_order"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
<!-- 报表页面 产品分布 -->
|
|
|
<if test="param.type == 'f_report_spu_analysis'">
|
|
|
- select f_report_spu_analysis as report from "dkic_b"."f_report_spu_analysis"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId})
|
|
|
+ select f_report_spu_analysis as report from "dkic_b"."f_report_spu_analysis"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
<!-- 报表页面 部门成交 -->
|
|
|
<if test="param.type == 'f_report_index_org_order'">
|
|
|
- select f_report_index_org_order as report from "dkic_b"."f_report_index_org_order"(to_date(#{param.monthDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.userId})
|
|
|
+ select f_report_index_org_order as report from "dkic_b"."f_report_index_org_order"(to_date(#{param.monthDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
<!-- 报表页面 部门收款 -->
|
|
|
<if test="param.type == 'f_report_index_org_repay'">
|
|
|
- select f_report_index_org_repay as report from "dkic_b"."f_report_index_org_repay"(to_date(#{param.monthDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.userId})
|
|
|
+ select f_report_index_org_repay as report from "dkic_b"."f_report_index_org_repay"(to_date(#{param.monthDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
<!-- 报表页面 业务员成交 -->
|
|
|
<if test="param.type == 'f_report_index_staff_order'">
|
|
|
- select f_report_index_staff_order as report from "dkic_b"."f_report_index_staff_order"(to_date(#{param.monthDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},#{param.userId})
|
|
|
+ select f_report_index_staff_order as report from "dkic_b"."f_report_index_staff_order"(to_date(#{param.monthDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
<!-- 报表页面 业务员收款 -->
|
|
|
<if test="param.type == 'f_report_index_staff_repay'">
|
|
|
- select f_report_index_staff_repay as report from "dkic_b"."f_report_index_staff_repay"(to_date(#{param.monthDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},#{param.userId})
|
|
|
+ select f_report_index_staff_repay as report from "dkic_b"."f_report_index_staff_repay"(to_date(#{param.monthDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
<!-- 明细页面 收款分析-收款任务 f_report_index_org_repay 部分收款同一个函数-->
|
|
|
|
|
|
<!-- 明细页面 收款分析-欠款情况 -->
|
|
|
<if test="param.type == 'f_report_repay_debt'">
|
|
|
- select f_report_repay_debt as report from "dkic_b"."f_report_repay_debt"(to_date(#{param.monthDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.userId})
|
|
|
+ select f_report_repay_debt as report from "dkic_b"."f_report_repay_debt"(to_date(#{param.monthDate},'yyyy-MM-dd'),#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
<!-- 明细页面 客户分析-报价 -->
|
|
|
<if test="param.type == 'f_report_csm_analysis_offer'">
|
|
|
- select f_report_csm_analysis_offer as report from "dkic_b"."f_report_csm_analysis_offer"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId})
|
|
|
+ select f_report_csm_analysis_offer as report from "dkic_b"."f_report_csm_analysis_offer"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
<!-- 明细页面 客户分析-成交 -->
|
|
|
<if test="param.type == 'f_report_csm_analysis_order'">
|
|
|
- select f_report_csm_analysis_order as report from "dkic_b"."f_report_csm_analysis_order"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId})
|
|
|
+ select f_report_csm_analysis_order as report from "dkic_b"."f_report_csm_analysis_order"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
<!-- 明细页面 客户来源分布-报价 -->
|
|
|
<if test="param.type == 'f_report_csm_from_offer'">
|
|
|
- select f_report_csm_from_offer as report from "dkic_b"."f_report_csm_from_offer"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId})
|
|
|
+ select f_report_csm_from_offer as report from "dkic_b"."f_report_csm_from_offer"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
<!-- 明细页面 客户来源分布-潜客 -->
|
|
|
<if test="param.type == 'f_report_csm_from_filing'">
|
|
|
- select f_report_csm_from_filing as report from "dkic_b"."f_report_csm_from_filing"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId})
|
|
|
+ select f_report_csm_from_filing as report from "dkic_b"."f_report_csm_from_filing"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
|
|
|
<!-- 明细页面 销售分析5个 第一个就是部门成交-->
|
|
|
|
|
|
<if test="param.type == 'f_report_order_analysis_reject'">
|
|
|
- select f_report_order_analysis_reject as report from "dkic_b"."f_report_order_analysis_reject"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId})
|
|
|
+ select f_report_order_analysis_reject as report from "dkic_b"."f_report_order_analysis_reject"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
<if test="param.type == 'f_report_order_analysis_csm'">
|
|
|
- select f_report_order_analysis_csm as report from "dkic_b"."f_report_order_analysis_csm"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId})
|
|
|
+ select f_report_order_analysis_csm as report from "dkic_b"."f_report_order_analysis_csm"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
<if test="param.type == 'f_report_order_analysis_activity'">
|
|
|
- select f_report_order_analysis_activity as report from "dkic_b"."f_report_order_analysis_activity"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId})
|
|
|
+ select f_report_order_analysis_activity as report from "dkic_b"."f_report_order_analysis_activity"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
<if test="param.type == 'f_report_order_analysis_specs'">
|
|
|
- select f_report_order_analysis_specs as report from "dkic_b"."f_report_order_analysis_specs"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId})
|
|
|
+ select f_report_order_analysis_specs as report from "dkic_b"."f_report_order_analysis_specs"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler})
|
|
|
</if>
|
|
|
|
|
|
|
|
|
<!--订单参考利润-->
|
|
|
<if test="param.type == 'f_report_s201_sale_reference_profit'">
|
|
|
- select f_report_s201_sale_reference_profit as report from "dkic_b"."f_report_s201_sale_reference_profit"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s201_sale_reference_profit as report from "dkic_b"."f_report_s201_sale_reference_profit"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!--出库参考利润-->
|
|
|
<if test="param.type == 'f_report_s201_out_reference_profit'">
|
|
|
- select f_report_s201_out_reference_profit as report from "dkic_b"."f_report_s201_out_reference_profit"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s201_out_reference_profit as report from "dkic_b"."f_report_s201_out_reference_profit"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 报表页面 销售分析 -->
|
|
|
<if test="param.type == 'f_report_s001_order_analysis_home'">
|
|
|
- select f_report_s001_order_analysis_home as report from "dkic_b"."f_report_s001_order_analysis_home"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_order_analysis_home as report from "dkic_b"."f_report_s001_order_analysis_home"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
<!-- 报表页面 收款分析 -->
|
|
|
<if test="param.type == 'f_report_s001_repay_analysis'">
|
|
|
- select f_report_s001_repay_analysis as report from "dkic_b"."f_report_s001_repay_analysis"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_repay_analysis as report from "dkic_b"."f_report_s001_repay_analysis"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
<!-- 报表页面 客户分析 -->
|
|
|
<if test="param.type == 'f_report_s001_csm_analysis_home'">
|
|
|
- select f_report_s001_csm_analysis_home as report from "dkic_b"."f_report_s001_csm_analysis_home"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_csm_analysis_home as report from "dkic_b"."f_report_s001_csm_analysis_home"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
|
|
|
<!-- 图形部分 -->
|
|
|
<!-- 报表页面 客户来源分布 -->
|
|
|
<if test="param.type == 'f_report_s001_csm_from_order'">
|
|
|
- select f_report_s001_csm_from_order as report from "dkic_b"."f_report_s001_csm_from_order"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_csm_from_order as report from "dkic_b"."f_report_s001_csm_from_order"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 报表页面 产品分布 -->
|
|
|
<if test="param.type == 'f_report_s001_spu_analysis'">
|
|
|
- select f_report_s001_spu_analysis as report from "dkic_b"."f_report_s001_spu_analysis"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_spu_analysis as report from "dkic_b"."f_report_s001_spu_analysis"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 报表页面 部门成交 -->
|
|
|
<if test="param.type == 'f_report_s001_index_org_order'">
|
|
|
- select f_report_s001_index_org_order as report from "dkic_b"."f_report_s001_index_org_order"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_index_org_order as report from "dkic_b"."f_report_s001_index_org_order"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 报表页面 部门收款 -->
|
|
|
<if test="param.type == 'f_report_s001_index_org_repay'">
|
|
|
- select f_report_s001_index_org_repay as report from "dkic_b"."f_report_s001_index_org_repay"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_index_org_repay as report from "dkic_b"."f_report_s001_index_org_repay"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 报表页面 业务员成交 -->
|
|
|
<if test="param.type == 'f_report_s001_index_staff_order'">
|
|
|
- select f_report_s001_index_staff_order as report from "dkic_b"."f_report_s001_index_staff_order"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_index_staff_order as report from "dkic_b"."f_report_s001_index_staff_order"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 报表页面 业务员收款 -->
|
|
|
<if test="param.type == 'f_report_s001_index_staff_repay'">
|
|
|
- select f_report_s001_index_staff_repay as report from "dkic_b"."f_report_s001_index_staff_repay"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_index_staff_repay as report from "dkic_b"."f_report_s001_index_staff_repay"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 明细页面 收款分析-收款任务 f_report_s001_index_org_repay 部分收款同一个函数-->
|
|
|
|
|
|
<!-- 明细页面 收款分析-欠款情况 -->
|
|
|
<if test="param.type == 'f_report_s001_repay_debt'">
|
|
|
- select f_report_s001_repay_debt as report from "dkic_b"."f_report_s001_repay_debt"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_repay_debt as report from "dkic_b"."f_report_s001_repay_debt"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 明细页面 客户分析-报价 -->
|
|
|
<if test="param.type == 'f_report_s001_csm_analysis_offer'">
|
|
|
- select f_report_s001_csm_analysis_offer as report from "dkic_b"."f_report_s001_csm_analysis_offer"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_csm_analysis_offer as report from "dkic_b"."f_report_s001_csm_analysis_offer"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 明细页面 客户分析-成交 -->
|
|
|
<if test="param.type == 'f_report_s001_csm_analysis_order'">
|
|
|
- select f_report_s001_csm_analysis_order as report from "dkic_b"."f_report_s001_csm_analysis_order"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_csm_analysis_order as report from "dkic_b"."f_report_s001_csm_analysis_order"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 明细页面 客户来源分布-报价 -->
|
|
|
<if test="param.type == 'f_report_s001_csm_from_offer'">
|
|
|
- select f_report_s001_csm_from_offer as report from "dkic_b"."f_report_s001_csm_from_offer"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_csm_from_offer as report from "dkic_b"."f_report_s001_csm_from_offer"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 明细页面 客户来源分布-潜客 -->
|
|
|
<if test="param.type == 'f_report_s001_csm_from_filing'">
|
|
|
- select f_report_s001_csm_from_filing as report from "dkic_b"."f_report_s001_csm_from_filing"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_csm_from_filing as report from "dkic_b"."f_report_s001_csm_from_filing"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
|
|
|
<!-- 明细页面 销售分析5个 第一个就是部门成交-->
|
|
|
|
|
|
<if test="param.type == 'f_report_s001_order_analysis_reject'">
|
|
|
- select f_report_s001_order_analysis_reject as report from "dkic_b"."f_report_s001_order_analysis_reject"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_order_analysis_reject as report from "dkic_b"."f_report_s001_order_analysis_reject"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<if test="param.type == 'f_report_s001_order_analysis_csm'">
|
|
|
- select f_report_s001_order_analysis_csm as report from "dkic_b"."f_report_s001_order_analysis_csm"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_order_analysis_csm as report from "dkic_b"."f_report_s001_order_analysis_csm"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<if test="param.type == 'f_report_s001_order_analysis_activity'">
|
|
|
- select f_report_s001_order_analysis_activity as report from "dkic_b"."f_report_s001_order_analysis_activity"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_order_analysis_activity as report from "dkic_b"."f_report_s001_order_analysis_activity"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<if test="param.type == 'f_report_s001_order_analysis_specs'">
|
|
|
- select f_report_s001_order_analysis_specs as report from "dkic_b"."f_report_s001_order_analysis_specs"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s001_order_analysis_specs as report from "dkic_b"."f_report_s001_order_analysis_specs"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
|
|
|
<!-- s002部分 -->
|
|
|
<!-- 报表页面 销售分析 -->
|
|
|
<if test="param.type == 'f_report_s002_order_analysis_home'">
|
|
|
- select f_report_s002_order_analysis_home as report from "dkic_b"."f_report_s002_order_analysis_home"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_order_analysis_home as report from "dkic_b"."f_report_s002_order_analysis_home"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
<!-- 报表页面 收款分析 -->
|
|
|
<if test="param.type == 'f_report_s002_repay_analysis'">
|
|
|
- select f_report_s002_repay_analysis as report from "dkic_b"."f_report_s002_repay_analysis"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_repay_analysis as report from "dkic_b"."f_report_s002_repay_analysis"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
<!-- 报表页面 客户分析 -->
|
|
|
<if test="param.type == 'f_report_s002_csm_analysis_home'">
|
|
|
- select f_report_s002_csm_analysis_home as report from "dkic_b"."f_report_s002_csm_analysis_home"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_csm_analysis_home as report from "dkic_b"."f_report_s002_csm_analysis_home"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
|
|
|
<!-- 图形部分 -->
|
|
|
<!-- 报表页面 客户来源分布 -->
|
|
|
<if test="param.type == 'f_report_s002_csm_from_order'">
|
|
|
- select f_report_s002_csm_from_order as report from "dkic_b"."f_report_s002_csm_from_order"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_csm_from_order as report from "dkic_b"."f_report_s002_csm_from_order"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 报表页面 产品分布 -->
|
|
|
<if test="param.type == 'f_report_s002_spu_analysis'">
|
|
|
- select f_report_s002_spu_analysis as report from "dkic_b"."f_report_s002_spu_analysis"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_spu_analysis as report from "dkic_b"."f_report_s002_spu_analysis"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
|
|
|
<!-- 报表页面 业务员成交 -->
|
|
|
<if test="param.type == 'f_report_s002_index_staff_order'">
|
|
|
- select f_report_s002_index_staff_order as report from "dkic_b"."f_report_s002_index_staff_order"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_index_staff_order as report from "dkic_b"."f_report_s002_index_staff_order"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 报表页面 业务员收款 -->
|
|
|
<if test="param.type == 'f_report_s002_index_staff_repay'">
|
|
|
- select f_report_s002_index_staff_repay as report from "dkic_b"."f_report_s002_index_staff_repay"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_index_staff_repay as report from "dkic_b"."f_report_s002_index_staff_repay"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
|
|
|
<!-- 明细页面 收款分析-欠款情况 -->
|
|
|
<if test="param.type == 'f_report_s002_repay_debt'">
|
|
|
- select f_report_s002_repay_debt as report from "dkic_b"."f_report_s002_repay_debt"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_repay_debt as report from "dkic_b"."f_report_s002_repay_debt"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 明细页面 客户分析-报价 -->
|
|
|
<if test="param.type == 'f_report_s002_csm_analysis_offer'">
|
|
|
- select f_report_s002_csm_analysis_offer as report from "dkic_b"."f_report_s002_csm_analysis_offer"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_csm_analysis_offer as report from "dkic_b"."f_report_s002_csm_analysis_offer"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 明细页面 客户分析-成交 -->
|
|
|
<if test="param.type == 'f_report_s002_csm_analysis_order'">
|
|
|
- select f_report_s002_csm_analysis_order as report from "dkic_b"."f_report_s002_csm_analysis_order"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_csm_analysis_order as report from "dkic_b"."f_report_s002_csm_analysis_order"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 明细页面 客户来源分布-报价 -->
|
|
|
<if test="param.type == 'f_report_s002_csm_from_offer'">
|
|
|
- select f_report_s002_csm_from_offer as report from "dkic_b"."f_report_s002_csm_from_offer"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_csm_from_offer as report from "dkic_b"."f_report_s002_csm_from_offer"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 明细页面 客户来源分布-潜客 -->
|
|
|
<if test="param.type == 'f_report_s002_csm_from_filing'">
|
|
|
- select f_report_s002_csm_from_filing as report from "dkic_b"."f_report_s002_csm_from_filing"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_csm_from_filing as report from "dkic_b"."f_report_s002_csm_from_filing"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
|
|
|
<!-- 明细页面 销售分析5个 第一个就是部门成交-->
|
|
|
|
|
|
<if test="param.type == 'f_report_s002_order_analysis_reject'">
|
|
|
- select f_report_s002_order_analysis_reject as report from "dkic_b"."f_report_s002_order_analysis_reject"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_order_analysis_reject as report from "dkic_b"."f_report_s002_order_analysis_reject"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<if test="param.type == 'f_report_s002_order_analysis_csm'">
|
|
|
- select f_report_s002_order_analysis_csm as report from "dkic_b"."f_report_s002_order_analysis_csm"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_order_analysis_csm as report from "dkic_b"."f_report_s002_order_analysis_csm"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<if test="param.type == 'f_report_s002_order_analysis_activity'">
|
|
|
- select f_report_s002_order_analysis_activity as report from "dkic_b"."f_report_s002_order_analysis_activity"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_order_analysis_activity as report from "dkic_b"."f_report_s002_order_analysis_activity"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<if test="param.type == 'f_report_s002_order_analysis_specs'">
|
|
|
- select f_report_s002_order_analysis_specs as report from "dkic_b"."f_report_s002_order_analysis_specs"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s002_order_analysis_specs as report from "dkic_b"."f_report_s002_order_analysis_specs"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 销售分析 -->
|
|
|
<!-- 部门品类排行 -->
|
|
|
<if test="param.type == 'f_report_s003_kpi_org_category'">
|
|
|
- select f_report_s003_kpi_org_category as report from "dkic_b"."f_report_s003_kpi_org_category"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s003_kpi_org_category as report from "dkic_b"."f_report_s003_kpi_org_category"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 部门单品排行 -->
|
|
|
<if test="param.type == 'f_report_s003_kpi_org_spu'">
|
|
|
- select f_report_s003_kpi_org_spu as report from "dkic_b"."f_report_s003_kpi_org_spu"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s003_kpi_org_spu as report from "dkic_b"."f_report_s003_kpi_org_spu"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 业务员品类排行 -->
|
|
|
<if test="param.type == 'f_report_s003_kpi_staff_category'">
|
|
|
- select f_report_s003_kpi_staff_category as report from "dkic_b"."f_report_s003_kpi_staff_category"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s003_kpi_staff_category as report from "dkic_b"."f_report_s003_kpi_staff_category"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
|
|
|
<!-- 业务员单品排行 -->
|
|
|
<if test="param.type == 'f_report_s003_kpi_staff_spu'">
|
|
|
- select f_report_s003_kpi_staff_spu as report from "dkic_b"."f_report_s003_kpi_staff_spu"(#{param.cpId},#{param.orgIds,typeHandler=IntListTypeHandler},#{param.staffIds,typeHandler=IntListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId},#{param.dateType})
|
|
|
+ select f_report_s003_kpi_staff_spu as report from "dkic_b"."f_report_s003_kpi_staff_spu"(#{param.cpId},#{param.orgIds,typeHandler=UuidListTypeHandler},#{param.staffIds,typeHandler=UuidListTypeHandler},to_date(#{param.beginDate},'yyyy-MM-dd'),to_date(#{param.endDate},'yyyy-MM-dd'),#{param.userId, typeHandler=UuidTypeHandler},#{param.dateType})
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
@@ -2933,5 +2933,89 @@
|
|
|
select dkic_b.f_query_mac_pay_current_item(#{cpId},#{objectId} ::uuid,#{orgId} ::uuid,#{macType},#{accDateStart} ::date
|
|
|
,#{accDateEnd} ::date,#{i18n} ,#{currentPage},#{pageSize})
|
|
|
</select>
|
|
|
+ <select id="getCusRecPayReportItemByUser" resultType="java.util.Map">
|
|
|
+ SELECT a.object_id as "objectId"
|
|
|
+ , a.biznis_no as "biznisNo"
|
|
|
+ , COALESCE(SUM(tpo.out_amt), 0) as "outAmt"
|
|
|
+ , COALESCE(SUM(tpo.return_amt), 0) as "returnAmt"
|
|
|
+ , COALESCE(SUM(tmrp.sum_amt_rec), 0) as "sumAmtRec"
|
|
|
+ , a.acc_date as "accDate"
|
|
|
+ FROM
|
|
|
+ dkic_b.t_mac_account_item a
|
|
|
+ LEFT JOIN dkic_b.t_psi_outbound tpo ON tpo.out_id = a.biznis_id
|
|
|
+ LEFT JOIN dkic_b.t_mac_rec_pay tmrp ON tmrp.rp_id = a.biznis_id
|
|
|
+ WHERE a.flg_valid
|
|
|
+ <if test="objectId != null and objectId != ''">
|
|
|
+ AND a.object_id = #{objectId}::uuid
|
|
|
+ </if>
|
|
|
+ <if test="staffId != null and staffId != ''">
|
|
|
+ AND a.staff_id = #{staffId}::uuid
|
|
|
+ </if>
|
|
|
+ <if test="orgId != null and orgId != ''">
|
|
|
+ AND a.org_id = #{orgId}::uuid
|
|
|
+ </if>
|
|
|
+ <if test="makeTimeStart != null and makeTi8meStart != ''">
|
|
|
+ AND a.acc_date >= #{makeTimeStart}::timestamp with time zone
|
|
|
+ </if>
|
|
|
+ <if test="makeTimeEnd != null and makeTimeEnd != ''">
|
|
|
+ AND a.acc_date <= #{makeTimeStart}::timestamp with time zone
|
|
|
+ </if>
|
|
|
+ <if test="staffIds != null and staffIds.size() > 0">
|
|
|
+ AND a.staff_id IN
|
|
|
+ <foreach collection="staffIds" index="index" item="item" separator="," open="(" close=")">
|
|
|
+ #{item}::uuid
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orgIds != null and orgIds.size() > 0">
|
|
|
+ AND a.org_id IN
|
|
|
+ <foreach collection="orgIds" index="index" item="item" separator="," open="(" close=")">
|
|
|
+ #{item}::uuid
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="recTypeIds != null and recTypeIds.size() > 0">
|
|
|
+ <foreach collection="recTypeIds" item="item">
|
|
|
+ <if test="item != null and item != '' and item == '收支类型-出库'">
|
|
|
+ AND tpo.out_amt > 0
|
|
|
+ </if>
|
|
|
+ <if test="item != null and item != '' and item == '收支类型-退货'">
|
|
|
+ AND tpo.out_amt < 0
|
|
|
+ </if>
|
|
|
+ <if test="item != null and item != '' and item == '收支类型-收款'">
|
|
|
+ AND tmrp.sum_amt_rec > 0
|
|
|
+ </if>
|
|
|
+ <if test="item != null and item != '' and item == '收支类型-退款'">
|
|
|
+ AND tmrp.sum_amt_rec < 0
|
|
|
+ </if>
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ group by a.object_id, a.biznis_no, a.acc_date, a.staff_id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getUserArrears" resultType="java.util.Map">
|
|
|
+ SELECT a.object_id as "objectId"
|
|
|
+ , tmc.cus_name as "cusName"
|
|
|
+ , tmc.cus_phone as "cusPhone"
|
|
|
+ , SUM(COALESCE(tpo.out_amt, 0) + COALESCE(tpo.return_amt, 0)) - SUM(COALESCE(tmrp.sum_amt_rec, 0)) as arrears
|
|
|
+ FROM
|
|
|
+ dkic_b.t_mac_account_item a
|
|
|
+ LEFT JOIN dkic_b.t_psi_outbound tpo ON tpo.out_id = a.biznis_id
|
|
|
+ LEFT JOIN dkic_b.t_mac_rec_pay tmrp ON tmrp.rp_id = a.biznis_id
|
|
|
+ LEFT JOIN dkic_b.t_mst_customer tmc ON tmc.cus_id = a.object_id
|
|
|
+ WHERE a.flg_valid
|
|
|
+ AND tmc.cus_name IS NOT NULL AND tmc.cus_name != ''
|
|
|
+ GROUP BY a.object_id, tmc.cus_name, tmc.cus_phone, tmc.address_full
|
|
|
+ HAVING SUM(COALESCE(tpo.out_amt, 0) + COALESCE(tpo.return_amt, 0)) - SUM(COALESCE(tmrp.sum_amt_rec, 0)) > 0
|
|
|
+ <if test="objectId != null">
|
|
|
+ AND a.object_id = #{objectId}::uuid
|
|
|
+ </if>
|
|
|
+ <if test="searchText != null and searchText != ''">
|
|
|
+ AND (tmc.cus_name LIKE concat('%',#{searchText},'%')
|
|
|
+ OR tmc.cus_phone LIKE concat('%',#{searchText},'%')
|
|
|
+ OR tmc.address_full LIKE concat('%',#{searchText},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ LIMIT #{pageSize} OFFSET #{currentPage}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|