张延森 5 lat temu
rodzic
commit
11697d6e9d

+ 3
- 3
src/main/resources/mapper/TaRecommendCustomerMapper.xml Wyświetl plik

266
             <if test="consultTel != null and consultTel !=''">
266
             <if test="consultTel != null and consultTel !=''">
267
                 and b.tel like CONCAT('%',#{consultTel}, '%')
267
                 and b.tel like CONCAT('%',#{consultTel}, '%')
268
             </if>
268
             </if>
269
-            and NOT EXISTS ( select * from ta_recommend_customer a where a.recommend_person = b.person_id)
269
+            and NOT EXISTS ( select * from ta_recommend_customer a where a.org_id = #{orgId} and a.recommend_person = b.person_id)
270
         </where>
270
         </where>
271
         order by b.create_date desc
271
         order by b.create_date desc
272
     </select>
272
     </select>
514
             <if test="consultTel != null and consultTel !=''">
514
             <if test="consultTel != null and consultTel !=''">
515
                 and b.tel like CONCAT('%',#{consultTel}, '%')
515
                 and b.tel like CONCAT('%',#{consultTel}, '%')
516
             </if>
516
             </if>
517
-            and NOT EXISTS ( select * from ta_recommend_customer a where a.recommend_person = b.person_id)
517
+            and NOT EXISTS ( select * from ta_recommend_customer a where a.org_id = #{orgId} and a.recommend_person = b.person_id)
518
         </where>
518
         </where>
519
         order by b.create_date desc
519
         order by b.create_date desc
520
     </select>
520
     </select>
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