张延森 2 years ago
parent
commit
3435a409b1

+ 2
- 1
src/main/java/com/yunzhi/marketing/borker/controller/BorkerController.java View File

@@ -35,11 +35,12 @@ public class BorkerController  extends BaseController {
35 35
                                       @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
36 36
                                       @ApiParam("手机号") @RequestParam(value ="phone", required = false) String phone,
37 37
                                       @ApiParam("姓名") @RequestParam(value ="name", required = false) String name,
38
+                                      @ApiParam("推荐人") @RequestParam(value ="recommendPersonName", required = false) String recommendPersonName,
38 39
                                       @ApiParam("排序规则") @RequestParam(value ="sortOrder", defaultValue = "DESC") String sortOrder,
39 40
                                       @ApiParam("排序字段") @RequestParam(value ="sortField", defaultValue = "create_date") String sortField) throws Exception {
40 41
 
41 42
         IPage<BorkerVO> page = new Page<>(pageNum, pageSize);
42
-        IPage<BorkerVO> result = iTaPersonService.getBorkerPage(page, name, phone, sortOrder, sortField);
43
+        IPage<BorkerVO> result = iTaPersonService.getBorkerPage(page, name, phone, recommendPersonName, sortOrder, sortField);
43 44
         return ResponseBean.success(result);
44 45
     }
45 46
 

+ 1
- 0
src/main/java/com/yunzhi/marketing/mapper/TaPersonMapper.java View File

@@ -270,6 +270,7 @@ public interface TaPersonMapper extends BaseMapper<TaPerson> {
270 270
                                   @Param("personType") String personType,
271 271
                                   @Param("name") String name,
272 272
                                   @Param("phone") String phone,
273
+                                  @Param("recommendPersonName") String recommendPersonName,
273 274
                                   @Param("sortOrder") String sortOrder,
274 275
                                   @Param("sortField") String sortField);
275 276
 }

+ 1
- 1
src/main/java/com/yunzhi/marketing/service/ITaPersonService.java View File

@@ -132,5 +132,5 @@ public interface ITaPersonService extends IService<TaPerson> {
132 132
      */
133 133
     ResponseBean marketing(PersonMarketingDTO marketingDTO, String openid);
134 134
 
135
-    IPage<BorkerVO> getBorkerPage(IPage<BorkerVO> page, String name, String phone, String sortOrder, String sortField);
135
+    IPage<BorkerVO> getBorkerPage(IPage<BorkerVO> page, String name, String phone, String recommendPersonName, String sortOrder, String sortField);
136 136
 }

+ 2
- 2
src/main/java/com/yunzhi/marketing/service/impl/TaPersonServiceImpl.java View File

@@ -1347,7 +1347,7 @@ public class TaPersonServiceImpl extends ServiceImpl<TaPersonMapper, TaPerson> i
1347 1347
     }
1348 1348
 
1349 1349
     @Override
1350
-    public IPage<BorkerVO> getBorkerPage(IPage<BorkerVO> page, String name, String phone, String sortOrder, String sortField) {
1351
-        return baseMapper.getBorkerPage(page, CommConstant.PERSON_BORKER, name, phone, sortOrder, sortField);
1350
+    public IPage<BorkerVO> getBorkerPage(IPage<BorkerVO> page, String name, String phone, String recommendPersonName, String sortOrder, String sortField) {
1351
+        return baseMapper.getBorkerPage(page, CommConstant.PERSON_BORKER, name, phone, recommendPersonName, sortOrder, sortField);
1352 1352
     }
1353 1353
 }

+ 4
- 1
src/main/resources/mapper/TaPersonMapper.xml View File

@@ -679,11 +679,14 @@ FROM
679 679
             t.person_type = #{personType}
680 680
           AND t.`status` &gt; -1
681 681
           <if test="name != null and name != ''">
682
-              AND ( t.NAME LIKE CONCAT( '%', #{name}, '%' ) OR t.nickname LIKE CONCAT( '%', #{name}, '%' ) )
682
+              AND ( t.`name` LIKE CONCAT( '%', #{name}, '%' ) OR t.nickname LIKE CONCAT( '%', #{name}, '%' ) )
683 683
           </if>
684 684
           <if test="phone != null and phone != ''">
685 685
               AND t.phone LIKE CONCAT( '%', #{phone}, '%' )
686 686
           </if>
687
+        <if test="recommendPersonName != null and recommendPersonName != ''">
688
+            AND ( m.`name` LIKE CONCAT( '%', #{recommendPersonName}, '%' ) OR m.nickname LIKE CONCAT( '%', #{recommendPersonName}, '%' ) )
689
+        </if>
687 690
         ORDER BY
688 691
             <if test="sortField == 'customer_num'">
689 692
                 s.customer_num