傅行帆 5 years ago
parent
commit
24c5c3cb91

+ 14
- 14
src/main/java/com/huiju/estateagents/controller/TaRecommendCustomerController.java View File

791
             // 设置 sheet, 同一个sheet只需要设置一次
791
             // 设置 sheet, 同一个sheet只需要设置一次
792
             WriteSheet writeSheet = EasyExcel.writerSheet("客户列表-公客").build();
792
             WriteSheet writeSheet = EasyExcel.writerSheet("客户列表-公客").build();
793
 
793
 
794
-            Integer count = taRecommendCustomerMapper.getPublicCustomerExportListCount(name, tel,  entryType, verifyStatus, sex, orgId,consultTel);
795
-            pageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
796
-            List<PublicCustomerExport> publicList = null;
797
-            do {
798
-                publicList = taRecommendCustomerMapper.getPublicCustomerExportList(pageCode * pageSize, pageSize, name, tel,  entryType, verifyStatus, sex, orgId,consultTel);
794
+//            Integer count = taRecommendCustomerMapper.getPublicCustomerExportListCount(name, tel,  entryType, verifyStatus, sex, orgId,consultTel);
795
+//            pageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
796
+//            List<PublicCustomerExport> publicList = null;
797
+//            do {
798
+                List<PublicCustomerExport> publicList = taRecommendCustomerMapper.getPublicCustomerExportList(pageCode * pageSize, pageSize, name, tel,  entryType, verifyStatus, sex, orgId,consultTel);
799
                 excelWriter.write(publicList, writeSheet);
799
                 excelWriter.write(publicList, writeSheet);
800
 
800
 
801
-                pageCode ++;
802
-            } while (pageCode <= pageCount);
801
+//                pageCode ++;
802
+//            } while (pageCode <= pageCount);
803
 
803
 
804
             // finish 会帮忙关闭流
804
             // finish 会帮忙关闭流
805
             excelWriter.finish();
805
             excelWriter.finish();
813
             // 设置 sheet, 同一个sheet只需要设置一次
813
             // 设置 sheet, 同一个sheet只需要设置一次
814
             WriteSheet writeSheet = EasyExcel.writerSheet("客户列表-私客").build();
814
             WriteSheet writeSheet = EasyExcel.writerSheet("客户列表-私客").build();
815
 
815
 
816
-            Integer count = taRecommendCustomerMapper.getCustomerExportListCount(buildingId, name, tel, consultName, consultTel, entryType, verifyStatus, sex, orgId,status,getTaPersonBuildingListByUserId(request));
817
-            pageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
818
-            List<PrivateCustomerExport> privateList = null;
819
-            do {
820
-                privateList = taRecommendCustomerMapper.getCustomerExportList(pageCode *  pageSize, pageSize, buildingId, name, tel, consultName, consultTel, entryType, verifyStatus, sex, orgId,status,getTaPersonBuildingListByUserId(request));
816
+//            Integer count = taRecommendCustomerMapper.getCustomerExportListCount(buildingId, name, tel, consultName, consultTel, entryType, verifyStatus, sex, orgId,status,getTaPersonBuildingListByUserId(request));
817
+//            pageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
818
+//            List<PrivateCustomerExport> privateList = null;
819
+//            do {
820
+                List<PrivateCustomerExport> privateList = taRecommendCustomerMapper.getCustomerExportList(pageCode *  pageSize, pageSize, buildingId, name, tel, consultName, consultTel, entryType, verifyStatus, sex, orgId,status,getTaPersonBuildingListByUserId(request));
821
                 excelWriter.write(privateList, writeSheet);
821
                 excelWriter.write(privateList, writeSheet);
822
 
822
 
823
-                pageCode ++;
824
-            } while (pageCode <= pageCount);
823
+//                pageCode ++;
824
+//            } while (pageCode <= pageCount);
825
             // finish 会帮忙关闭流
825
             // finish 会帮忙关闭流
826
             excelWriter.finish();
826
             excelWriter.finish();
827
 
827
 

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

547
             <if test="consultTel != null and consultTel !=''">
547
             <if test="consultTel != null and consultTel !=''">
548
                 and b.tel like CONCAT('%',#{consultTel}, '%')
548
                 and b.tel like CONCAT('%',#{consultTel}, '%')
549
             </if>
549
             </if>
550
-            and NOT EXISTS ( select * from ta_recommend_customer a where a.recommend_person = b.person_id)
550
+            and NOT EXISTS ( select * from ta_recommend_customer a where a.org_id = #{orgId} and a.recommend_person = b.person_id)
551
             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 != ''  )
551
             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 != ''  )
552
         </where>
552
         </where>
553
         order by b.create_date desc
553
         order by b.create_date desc
554
-        limit #{pageCode}, #{pageSize}
555
     </select>
554
     </select>
555
+    <!--        limit #{pageCode}, #{pageSize}-->
556
 
556
 
557
     <select id="getCustomerExportListCount" resultType="Integer" >
557
     <select id="getCustomerExportListCount" resultType="Integer" >
558
         SELECT
558
         SELECT
671
         </where>
671
         </where>
672
         group by a.customer_id,a.building_id
672
         group by a.customer_id,a.building_id
673
         order by a.create_date desc
673
         order by a.create_date desc
674
-        limit #{pageCode}, #{pageSize}
675
     </select>
674
     </select>
675
+    <!--        limit #{pageCode}, #{pageSize}-->
676
 
676
 
677
     <select id="getMyCustStatistics" resultType="java.util.Map">
677
     <select id="getMyCustStatistics" resultType="java.util.Map">
678
         SELECT
678
         SELECT