|
@@ -118,7 +118,7 @@
|
|
GROUP BY b.project_id, a.department_id
|
|
GROUP BY b.project_id, a.department_id
|
|
having IFNULL(SUM(b.custom_data),0) > 0
|
|
having IFNULL(SUM(b.custom_data),0) > 0
|
|
</select>
|
|
</select>
|
|
- <select id="getCustomerTotalCount" resultType="com.management.platform.entity.vo.DepartmentVO">
|
|
|
|
|
|
+<!-- <select id="getCustomerTotalCount" resultType="com.management.platform.entity.vo.DepartmentVO">
|
|
select count(*) as customertotal ,
|
|
select count(*) as customertotal ,
|
|
sum(case when c.close_deal=1 then 1 else 0 end) as customerDeal ,
|
|
sum(case when c.close_deal=1 then 1 else 0 end) as customerDeal ,
|
|
u.department_id as id,d.department_name as departmentName
|
|
u.department_id as id,d.department_name as departmentName
|
|
@@ -136,6 +136,25 @@
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
group by u.department_id
|
|
group by u.department_id
|
|
|
|
+ </select>-->
|
|
|
|
+ <select id="getCustomerTotalCount" resultType="com.management.platform.entity.vo.DepartmentVO">
|
|
|
|
+ select count(*) as customertotal ,
|
|
|
|
+ sum(case when b.stage_id=15 then 1 else 0 end) as customerDeal,
|
|
|
|
+ u.department_id as id,d.department_name as departmentName
|
|
|
|
+ from business_opportunity b
|
|
|
|
+ left join user u on b.incharger_id=u.id
|
|
|
|
+ left join department d on d.department_id=u.department_id
|
|
|
|
+ <where>
|
|
|
|
+ 1=1 AND u.department_id IS NOT NULL and b.company_id=#{companyId}
|
|
|
|
+
|
|
|
|
+ <if test="startDate !=null and startDate !='' and endDate !=null and endDate !=''">
|
|
|
|
+ AND b.create_time BETWEEN #{startDate} AND #{endDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="departmentId !=null ">
|
|
|
|
+ AND u.department_id=#{departmentId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ group by u.department_id
|
|
</select>
|
|
</select>
|
|
<select id="getCustomerTransferRate" resultType="com.management.platform.entity.vo.DepartmentVO">
|
|
<select id="getCustomerTransferRate" resultType="com.management.platform.entity.vo.DepartmentVO">
|
|
select count(distinct c.id) as num, count(distinct s.custom_id) as saleNum,
|
|
select count(distinct c.id) as num, count(distinct s.custom_id) as saleNum,
|