Browse Source

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents into dev

魏超 5 years ago
parent
commit
fe3f04b703

+ 14
- 0
src/main/java/com/huiju/estateagents/excel/PrivateCustomerExport.java View File

86
     @ColumnWidth(15)
86
     @ColumnWidth(15)
87
     @ExcelProperty(value = "意向度(意向值)", index = 8)
87
     @ExcelProperty(value = "意向度(意向值)", index = 8)
88
     private String intention ;
88
     private String intention ;
89
+
90
+    /**
91
+     * 意向度
92
+     */
93
+    @ColumnWidth(15)
94
+    @ExcelProperty(value = "推广人员", index = 10)
95
+    private String sharePersonName ;
96
+
97
+    /**
98
+     * 意向度
99
+     */
100
+    @ColumnWidth(15)
101
+    @ExcelProperty(value = "积分值", index = 11)
102
+    private String points ;
89
 }
103
 }

+ 14
- 0
src/main/java/com/huiju/estateagents/excel/PublicCustomerExport.java View File

72
     @ColumnWidth(15)
72
     @ColumnWidth(15)
73
     @ExcelProperty(value = "项目名称", index = 3)
73
     @ExcelProperty(value = "项目名称", index = 3)
74
     private String buildingName;
74
     private String buildingName;
75
+
76
+    /**
77
+     * 意向度
78
+     */
79
+    @ColumnWidth(15)
80
+    @ExcelProperty(value = "推广人员", index = 8)
81
+    private String sharePersonName ;
82
+
83
+    /**
84
+     * 意向度
85
+     */
86
+    @ColumnWidth(15)
87
+    @ExcelProperty(value = "积分值", index = 9)
88
+    private String points ;
75
 }
89
 }

+ 11
- 4
src/main/resources/mapper/TaRecommendCustomerMapper.xml View File

551
           concat(b.country, b.province) as province,
551
           concat(b.country, b.province) as province,
552
           z.intention,
552
           z.intention,
553
           d.scene_alias as sceneType,
553
           d.scene_alias as sceneType,
554
-          t.building_name
554
+          t.building_name,
555
+          ifnull( c.nickname, c.NAME ) AS sharePersonName ,
556
+          s.points
555
         FROM
557
         FROM
556
         ta_person b
558
         ta_person b
557
         LEFT JOIN ta_person_from_record r ON b.person_id = r.person_id AND r.is_first_time = 1 and r.org_id = #{orgId}
559
         LEFT JOIN ta_person_from_record r ON b.person_id = r.person_id AND r.is_first_time = 1 and r.org_id = #{orgId}
558
         left join ta_building t on b.building_id = t.building_id
560
         left join ta_building t on b.building_id = t.building_id
561
+        LEFT JOIN ta_person c ON b.recommend_person = c.person_id AND c.org_id = #{orgId}
562
+        left JOIN (select sum(points_amount) as points,person_id from ta_points_records where org_id = #{orgId} GROUP BY person_id) s on b.person_id = s.person_id
559
         left join (select sum(t.intention) as intention,t.person_id From ta_person_intention_record t where t.org_id = #{orgId} group by t.person_id) z on z.person_id = b.person_id
563
         left join (select sum(t.intention) as intention,t.person_id From ta_person_intention_record t where t.org_id = #{orgId} group by t.person_id) z on z.person_id = b.person_id
560
         left join td_wx_dict d on r.scene_id = d.scene_id
564
         left join td_wx_dict d on r.scene_id = d.scene_id
561
         <where>
565
         <where>
591
             <if test="consultTel != null and consultTel !=''">
595
             <if test="consultTel != null and consultTel !=''">
592
                 and b.tel like CONCAT('%',#{consultTel}, '%')
596
                 and b.tel like CONCAT('%',#{consultTel}, '%')
593
             </if>
597
             </if>
594
-            and NOT EXISTS ( select * from ta_recommend_customer a where a.org_id = #{orgId} and a.recommend_person = b.person_id)
598
+<!--            and NOT EXISTS ( select * from ta_recommend_customer a where a.org_id = #{orgId} and a.recommend_person = b.person_id)-->
595
             AND b.person_id not IN ( SELECT c.person_id FROM ta_recommend_customer c WHERE c.org_id = #{orgId} AND person_id is not null AND person_id != ''  )
599
             AND b.person_id not IN ( SELECT c.person_id FROM ta_recommend_customer c WHERE c.org_id = #{orgId} AND person_id is not null AND person_id != ''  )
596
         </where>
600
         </where>
597
         order by b.create_date desc
601
         order by b.create_date desc
667
         z.intention,
671
         z.intention,
668
         a.create_date,
672
         a.create_date,
669
         concat(a.country,a.province) as province,
673
         concat(a.country,a.province) as province,
670
-        w.scene_alias as scene_type
674
+        w.scene_alias as scene_type,
675
+        IFNULL( c.NAME, c.nickname ) AS sharePersonName,
676
+        s.points
671
         FROM
677
         FROM
672
         ta_recommend_customer a
678
         ta_recommend_customer a
673
         LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
679
         LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
674
-        LEFT JOIN ta_person c ON a.realty_consultant = c.user_id
675
         LEFT JOIN ta_user d on d.user_id = a.realty_consultant
680
         LEFT JOIN ta_user d on d.user_id = a.realty_consultant
676
         LEFT JOIN ta_person_from_record p ON a.person_id = p.person_id AND p.is_first_time = 1 and p.org_id = #{orgId}
681
         LEFT JOIN ta_person_from_record p ON a.person_id = p.person_id AND p.is_first_time = 1 and p.org_id = #{orgId}
682
+        LEFT JOIN ta_person c ON p.share_person_id = c.person_id
677
         left join ta_building t on a.building_id = t.building_id
683
         left join ta_building t on a.building_id = t.building_id
678
         LEFT JOIN td_wx_dict w ON p.scene_id = w.scene_id
684
         LEFT JOIN td_wx_dict w ON p.scene_id = w.scene_id
685
+        left JOIN (select sum(points_amount) as points,person_id from ta_points_records where org_id = #{orgId} GROUP BY person_id) s on a.person_id = s.person_id
679
         left join (select sum(t.intention) as intention,t.person_id From ta_person_intention_record t where t.org_id = #{orgId} group by t.person_id) z on z.person_id = a.person_id
686
         left join (select sum(t.intention) as intention,t.person_id From ta_person_intention_record t where t.org_id = #{orgId} group by t.person_id) z on z.person_id = a.person_id
680
         <where>
687
         <where>
681
             a.status > 0
688
             a.status > 0