diff --git a/fw-valhalla-dao/src/main/resources/mapper/CustomerMapper.xml b/fw-valhalla-dao/src/main/resources/mapper/CustomerMapper.xml index 11e7e13..98eae11 100644 --- a/fw-valhalla-dao/src/main/resources/mapper/CustomerMapper.xml +++ b/fw-valhalla-dao/src/main/resources/mapper/CustomerMapper.xml @@ -145,6 +145,7 @@ left join follow_clue t3 on t1.frame_no=t3.vin and t3.clue_state=2 and t3.clue_type=2 left join follow_clue t4 on t1.frame_no=t4.vin and t4.clue_state=2 and t4.clue_type=4 where t1.yn = 1 and t1.group_id = #{condition.groupId} + and t1.adviser_id is not null and t1.shop_id in @@ -168,7 +169,6 @@ and ( - t1.adviser_id is not null and @@ -191,13 +191,13 @@ and t1.cus_level = #{condition.level} + and t1.adviser_id is not null ) and ( - t1.adviser_id is not null and or ( @@ -241,6 +241,7 @@ left join follow_task t3 on t1.id=t3.customer_id and t3.state=1 and t3.type=2 left join follow_task t4 on t1.id=t4.customer_id and t4.state=1 and t4.type=4 where t1.yn = 1 and t1.group_id = #{condition.groupId} + and t1.adviser_id is not null and t1.shop_id in @@ -264,7 +265,6 @@ and ( - t1.adviser_id is not null and @@ -287,17 +287,16 @@ and t1.cus_level = #{condition.level} + and t1.adviser_id is not null ) and ( - t1.adviser_id is not null and - or ( - t1.current_mileage is not null + or (t1.current_mileage is not null and t1.current_mileage >= #{condition.minMileage} diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java index 32670f7..61810e9 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java @@ -791,6 +791,7 @@ public class CustomerBizService extends AbstractCustomerService { /** * 更新购车日期 + * * @param vin * @param date * @param groupId @@ -987,15 +988,15 @@ public class CustomerBizService extends AbstractCustomerService { public List queryByKeyword(String keyword, Long groupId) { - List list = fromCustomer(keyword,groupId); - if(CollectionUtils.isNotEmpty(list)){ + List list = fromCustomer(keyword, groupId); + if (CollectionUtils.isNotEmpty(list)) { return list; } return fromVehicle(keyword); } - private List fromCustomer(String keyword, Long groupId){ + private List fromCustomer(String keyword, Long groupId) { List list = customerService.queryByKeyword(keyword, groupId); for (BasicsCustomerDTO dto : list) { UserInfoDTO user = userService.user(dto.getAdviserId()); @@ -1010,9 +1011,10 @@ public class CustomerBizService extends AbstractCustomerService { return list; } - private List fromVehicle(String keyword){ + private List fromVehicle(String keyword) { return memberVehicleService.queryByKeyword(keyword); } + public List queryVehicleByMemberId(Long memberId) { List memberVehicleList = memberVehicleService.getMemberVehicle(memberId); if (CollectionUtils.isEmpty(memberVehicleList)) { @@ -1122,6 +1124,12 @@ public class CustomerBizService extends AbstractCustomerService { if (Objects.nonNull(queryReq.getFollowType())) { query.setFollowType(queryReq.getFollowType().getValue()); } + boolean b = (Objects.nonNull(query.getMinMileage()) && Objects.nonNull(query.getMaxMileage())) + || (Objects.nonNull(query.getMinBuyDate()) && Objects.nonNull(query.getMaxBuyDate())) + || Objects.nonNull(query.getLevel()); + if (!b) { + query.setAndCondition(true); + } return query; }