魏超 hace 5 años
padre
commit
8353fdc0c8
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4
    4
      src/main/resources/mapper/TaRecommendCustomerMapper.xml

+ 4
- 4
src/main/resources/mapper/TaRecommendCustomerMapper.xml Ver fichero

@@ -92,7 +92,7 @@ FROM
92 92
             a.person_type in ('estate agent', 'channel agent')
93 93
             and a.status >0
94 94
             <if test="name != null and name !=''">
95
-                and a.nickname like concat('%', #{name}, '%')
95
+                and (a.nickname like concat('%', #{name}, '%') or  a.name like concat('%', #{name}, '%'))
96 96
             </if>
97 97
             <if test="tel != null and tel!=''">
98 98
                 and a.phone like concat('%', #{tel}, '%')
@@ -490,7 +490,7 @@ FROM
490 490
 
491 491
     <select id="getIndependentAgentsExport" resultType="com.huiju.estateagents.excel.AgentsRecommendCustomer">
492 492
         SELECT
493
-        a.nickname as nickname,
493
+        ifnull(a.nickname, a.name) as nickname,
494 494
         a.phone as phone,
495 495
         if(a.gender = '1', '男', if(a.gender = '2', '女', '未知')) as gender,
496 496
         '专业经纪人' as personType,
@@ -515,7 +515,7 @@ FROM
515 515
         ) AS recommedCount
516 516
         FROM
517 517
         ta_person a
518
-        left join ta_channel_person tcp on a.person_id = tcp.person_id
518
+        left join ta_channel_person tcp on a.person_id = tcp.person_id and tcp.status = 1
519 519
         left join ta_channel tc on tc.channel_id = tcp.channel_id
520 520
         <where>
521 521
             ifnull(a.person_type, '') in ('channel agent', 'estate agent')
@@ -524,7 +524,7 @@ FROM
524 524
                 and a.org_id = #{orgId}
525 525
             </if>
526 526
             <if test="name != null and name != ''">
527
-                and a.nickname like concat('%', #{name}, '%')
527
+                and (a.nickname like concat('%', #{name}, '%') or  a.name like concat('%', #{name}, '%'))
528 528
             </if>
529 529
             <if test="tel != null and tel != null">
530 530
                 and a.phone like concat('%', #{tel}, '%')