张延森 пре 5 година
родитељ
комит
2a35c64aec

+ 5
- 1
src/main/java/com/huiju/estateagents/controller/TaRecommendCustomerController.java Прегледај датотеку

263
         try{
263
         try{
264
             IPage<TaRecommendCustomer>pg = new Page<>(pageNumber,pageSize);
264
             IPage<TaRecommendCustomer>pg = new Page<>(pageNumber,pageSize);
265
             QueryWrapper<TaRecommendCustomer>queryWrapper = new QueryWrapper<>();
265
             QueryWrapper<TaRecommendCustomer>queryWrapper = new QueryWrapper<>();
266
-            queryWrapper.eq("realty_consultant",person.getPersonId());
266
+
267
+            // 2020-4-1 yansen realty_consultant 可能是 person_id, 可能是 user_id
268
+//            queryWrapper.eq("realty_consultant",person.getPersonId());
269
+            queryWrapper.eq("org_id", person.getOrgId());   // 主要是为了走索引
270
+            queryWrapper.nested(query -> query.eq("realty_consultant",person.getPersonId()).or().eq("realty_consultant", person.getUserId()));
267
            // queryWrapper.eq("report_recommend_status",CommConstant.REPORTED);
271
            // queryWrapper.eq("report_recommend_status",CommConstant.REPORTED);
268
             queryWrapper.gt("status",CommConstant.STATUS_UNACCALIMED);
272
             queryWrapper.gt("status",CommConstant.STATUS_UNACCALIMED);
269
             queryWrapper.orderByDesc("create_date");
273
             queryWrapper.orderByDesc("create_date");

+ 1
- 1
src/main/resources/mapper/TaRecommendCustomerMapper.xml Прегледај датотеку

812
     <select id="getCustomersIRecommended" resultType="com.huiju.estateagents.entity.TaRecommendCustomer">
812
     <select id="getCustomersIRecommended" resultType="com.huiju.estateagents.entity.TaRecommendCustomer">
813
         select a.*,b.avatarurl from ta_recommend_customer a left join ta_person b on a.person_id = b.person_id
813
         select a.*,b.avatarurl from ta_recommend_customer a left join ta_person b on a.person_id = b.person_id
814
         where a.recommend_person = #{customerId}
814
         where a.recommend_person = #{customerId}
815
-        and a.status = #{status}
815
+        and a.status &gt;= #{status}
816
         and a.org_id = #{orgId}
816
         and a.org_id = #{orgId}
817
         <if test="personBuildingList != null and personBuildingList.size > 0">
817
         <if test="personBuildingList != null and personBuildingList.size > 0">
818
             AND a.building_id in
818
             AND a.building_id in