傅行帆 5 years ago
parent
commit
8ff8f7a15a

+ 2
- 1
src/main/java/com.huiju.welcome/controller/TaCustomerController.java View File

@@ -306,6 +306,7 @@ public class TaCustomerController extends BaseController {
306 306
         @RequestParam(defaultValue = "") String identity,
307 307
         @RequestParam(defaultValue = "", name = "nameOrPhone") String nameOrPhoneOrReceiver,
308 308
         @RequestParam(defaultValue = "" ) Integer consultant,
309
+        @RequestParam(defaultValue = "all" ) String customerType,
309 310
         HttpServletRequest request
310 311
     ){
311 312
         ResponseBean responseBean = new ResponseBean();
@@ -319,7 +320,7 @@ public class TaCustomerController extends BaseController {
319 320
                 consultantId = consultant;
320 321
             }
321 322
 
322
-            IPage<TaCustomer> result = iTaCustomerService.getCustomerListOfFront(pageNumber, pageSize, consultantId, nameOrPhoneOrReceiver, identity, consultantType);
323
+            IPage<TaCustomer> result = iTaCustomerService.getCustomerListOfFront(pageNumber, pageSize, consultantId, nameOrPhoneOrReceiver, identity, consultantType,customerType);
323 324
             List<TaCustomer> custs = result.getRecords();
324 325
 
325 326
             if (null != custs && custs.size() > 0) {

+ 1
- 1
src/main/java/com.huiju.welcome/mapper/TaCustomerMapper.java View File

@@ -27,7 +27,7 @@ public interface TaCustomerMapper extends BaseMapper<TaCustomer> {
27 27
 
28 28
     List<TaCustomer> getSomeCustMayBe(@Param("plateNumber") String plateNumber, @Param("phone") String phone);
29 29
 
30
-    IPage<TaCustomer> getCustomerListOfFront(IPage<TaCustomer> page, @Param("consultantId") Integer consultantId, @Param("nameOrPhoneOrReceiver") String nameOrPhoneOrReceiver, @Param("customerType") String customerType, @Param("consultantType") Integer consultantType);
30
+    IPage<TaCustomer> getCustomerListOfFront(IPage<TaCustomer> page, @Param("consultantId") Integer consultantId, @Param("nameOrPhoneOrReceiver") String nameOrPhoneOrReceiver, @Param("identityParams") String identityParams, @Param("consultantType") Integer consultantType,@Param("customerType") String customerType);
31 31
     
32 32
     IPage<TaCustomer> getAttributionList(IPage<TaCustomer> page);
33 33
     

+ 1
- 1
src/main/java/com.huiju.welcome/service/ITaCustomerService.java View File

@@ -49,7 +49,7 @@ public interface ITaCustomerService extends IService<TaCustomer> {
49 49
     List<CustomerExcel> getCustomersEqualCustomerPage(String customerName, String phone, String platNumber, Integer agentUserId);
50 50
 
51 51
 
52
-    IPage<TaCustomer> getCustomerListOfFront(int pageNumber, int pageSize, Integer consultantId, String nameOrPhoneOrReceiver, String identity, Integer consultantType);
52
+    IPage<TaCustomer> getCustomerListOfFront(int pageNumber, int pageSize, Integer consultantId, String nameOrPhoneOrReceiver, String identity, Integer consultantType,String customerType);
53 53
 	
54 54
 	IPage<TaCustomer> getAttributionList(int pageNumber, int pageSize);
55 55
     

+ 3
- 3
src/main/java/com.huiju.welcome/service/impl/TaCustomerServiceImpl.java View File

@@ -548,12 +548,12 @@ public class TaCustomerServiceImpl extends ServiceImpl<TaCustomerMapper, TaCusto
548 548
     }
549 549
 
550 550
     @Override
551
-    public IPage<TaCustomer> getCustomerListOfFront(int pageNumber, int pageSize, Integer consultantId, String nameOrPhoneOrReceiver, String identity, Integer consultantType) {
551
+    public IPage<TaCustomer> getCustomerListOfFront(int pageNumber, int pageSize, Integer consultantId, String nameOrPhoneOrReceiver, String identity, Integer consultantType,String customerType) {
552 552
         IPage<TaCustomer> page = new Page<>(pageNumber, pageSize);
553 553
 
554
-        String customerType = StringUtils.isEmpty(identity) ? null : identity;
554
+        String identityParams = StringUtils.isEmpty(identity) ? null : identity;
555 555
 
556
-        return taCustomerMapper.getCustomerListOfFront(page, consultantId, nameOrPhoneOrReceiver, customerType, consultantType);
556
+        return taCustomerMapper.getCustomerListOfFront(page, consultantId, nameOrPhoneOrReceiver, identityParams, consultantType,customerType);
557 557
     }
558 558
 
559 559
     @Override

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

@@ -104,9 +104,12 @@
104 104
             <if test="nameOrPhoneOrReceiver !=null and nameOrPhoneOrReceiver != ''">
105 105
               AND ( t.customer_name LIKE CONCAT('%',#{nameOrPhoneOrReceiver},'%') OR t.phone LIKE CONCAT('%',#{nameOrPhoneOrReceiver},'%') OR t.receiver LIKE CONCAT('%',#{nameOrPhoneOrReceiver},'%'))
106 106
             </if>
107
-            <if test='null != customerType and customerType == "channel"'>
107
+            <if test='null != identityParams and identityParams == "channel"'>
108 108
                 AND IFNULL(t.customer_type, '') = 'channel'
109 109
             </if>
110
+            <if test='null != customerType and customerType != "all"'>
111
+                AND IFNULL(t.customer_type, '') = #{customerType}
112
+            </if>
110 113
             <if test="null != consultantType and consultantType == 1">
111 114
                 AND t.consultant_id is null
112 115
             </if>