Commit a78dc8be250323bbdaa4f091c1b93be002d686a7
1 parent
77d74af7
feature(*): 查询的bug修复
- 查询的bug修复
Showing
2 changed files
with
17 additions
and
10 deletions
fw-valhalla-dao/src/main/resources/mapper/CustomerMapper.xml
... | ... | @@ -145,6 +145,7 @@ |
145 | 145 | left join follow_clue t3 on t1.frame_no=t3.vin and t3.clue_state=2 and t3.clue_type=2 |
146 | 146 | left join follow_clue t4 on t1.frame_no=t4.vin and t4.clue_state=2 and t4.clue_type=4 |
147 | 147 | where t1.yn = 1 and t1.group_id = #{condition.groupId} |
148 | + and t1.adviser_id is not null | |
148 | 149 | <if test="condition.shopList !=null and condition.shopList.size() != 0"> |
149 | 150 | and t1.shop_id in |
150 | 151 | <foreach collection="condition.shopList" item="id" index="index" open="(" close=")" separator=","> |
... | ... | @@ -168,7 +169,6 @@ |
168 | 169 | </if> |
169 | 170 | <if test="condition.andCondition==true"> |
170 | 171 | and ( |
171 | - t1.adviser_id is not null and | |
172 | 172 | <trim prefixOverrides="and"> |
173 | 173 | <if test="condition.minMileage !=null and condition.maxMileage !=null"> |
174 | 174 | <if test="condition.minMileage !=null"> |
... | ... | @@ -191,13 +191,13 @@ |
191 | 191 | <if test="condition.level !=null"> |
192 | 192 | and t1.cus_level = #{condition.level} |
193 | 193 | </if> |
194 | + and t1.adviser_id is not null | |
194 | 195 | </trim> |
195 | 196 | ) |
196 | 197 | </if> |
197 | 198 | |
198 | 199 | <if test="condition.andCondition==false"> |
199 | 200 | and ( |
200 | - t1.adviser_id is not null and | |
201 | 201 | <trim prefixOverrides="or"> |
202 | 202 | <if test="condition.minMileage !=null and condition.maxMileage !=null"> |
203 | 203 | or ( |
... | ... | @@ -241,6 +241,7 @@ |
241 | 241 | left join follow_task t3 on t1.id=t3.customer_id and t3.state=1 and t3.type=2 |
242 | 242 | left join follow_task t4 on t1.id=t4.customer_id and t4.state=1 and t4.type=4 |
243 | 243 | where t1.yn = 1 and t1.group_id = #{condition.groupId} |
244 | + and t1.adviser_id is not null | |
244 | 245 | <if test="condition.shopList !=null and condition.shopList.size() != 0"> |
245 | 246 | and t1.shop_id in |
246 | 247 | <foreach collection="condition.shopList" item="id" index="index" open="(" close=")" separator=","> |
... | ... | @@ -264,7 +265,6 @@ |
264 | 265 | </if> |
265 | 266 | <if test="condition.andCondition==true"> |
266 | 267 | and ( |
267 | - t1.adviser_id is not null and | |
268 | 268 | <trim prefixOverrides="and"> |
269 | 269 | <if test="condition.minMileage !=null and condition.maxMileage !=null"> |
270 | 270 | <if test="condition.minMileage !=null"> |
... | ... | @@ -287,17 +287,16 @@ |
287 | 287 | <if test="condition.level !=null"> |
288 | 288 | and t1.cus_level = #{condition.level} |
289 | 289 | </if> |
290 | + and t1.adviser_id is not null | |
290 | 291 | </trim> |
291 | 292 | ) |
292 | 293 | </if> |
293 | 294 | |
294 | 295 | <if test="condition.andCondition==false"> |
295 | 296 | and ( |
296 | - t1.adviser_id is not null and | |
297 | 297 | <trim prefixOverrides="or"> |
298 | 298 | <if test="condition.minMileage !=null and condition.maxMileage !=null"> |
299 | - or ( | |
300 | - t1.current_mileage is not null | |
299 | + or (t1.current_mileage is not null | |
301 | 300 | <if test="condition.minMileage !=null"> |
302 | 301 | and t1.current_mileage >= #{condition.minMileage} |
303 | 302 | </if> | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java
... | ... | @@ -791,6 +791,7 @@ public class CustomerBizService extends AbstractCustomerService { |
791 | 791 | |
792 | 792 | /** |
793 | 793 | * 更新购车日期 |
794 | + * | |
794 | 795 | * @param vin |
795 | 796 | * @param date |
796 | 797 | * @param groupId |
... | ... | @@ -987,15 +988,15 @@ public class CustomerBizService extends AbstractCustomerService { |
987 | 988 | |
988 | 989 | public List<BasicsCustomerDTO> queryByKeyword(String keyword, Long groupId) { |
989 | 990 | |
990 | - List<BasicsCustomerDTO> list = fromCustomer(keyword,groupId); | |
991 | - if(CollectionUtils.isNotEmpty(list)){ | |
991 | + List<BasicsCustomerDTO> list = fromCustomer(keyword, groupId); | |
992 | + if (CollectionUtils.isNotEmpty(list)) { | |
992 | 993 | return list; |
993 | 994 | } |
994 | 995 | return fromVehicle(keyword); |
995 | 996 | } |
996 | 997 | |
997 | 998 | |
998 | - private List<BasicsCustomerDTO> fromCustomer(String keyword, Long groupId){ | |
999 | + private List<BasicsCustomerDTO> fromCustomer(String keyword, Long groupId) { | |
999 | 1000 | List<BasicsCustomerDTO> list = customerService.queryByKeyword(keyword, groupId); |
1000 | 1001 | for (BasicsCustomerDTO dto : list) { |
1001 | 1002 | UserInfoDTO user = userService.user(dto.getAdviserId()); |
... | ... | @@ -1010,9 +1011,10 @@ public class CustomerBizService extends AbstractCustomerService { |
1010 | 1011 | return list; |
1011 | 1012 | } |
1012 | 1013 | |
1013 | - private List<BasicsCustomerDTO> fromVehicle(String keyword){ | |
1014 | + private List<BasicsCustomerDTO> fromVehicle(String keyword) { | |
1014 | 1015 | return memberVehicleService.queryByKeyword(keyword); |
1015 | 1016 | } |
1017 | + | |
1016 | 1018 | public List<MemberVehicleDTO> queryVehicleByMemberId(Long memberId) { |
1017 | 1019 | List<MemberVehicle> memberVehicleList = memberVehicleService.getMemberVehicle(memberId); |
1018 | 1020 | if (CollectionUtils.isEmpty(memberVehicleList)) { |
... | ... | @@ -1122,6 +1124,12 @@ public class CustomerBizService extends AbstractCustomerService { |
1122 | 1124 | if (Objects.nonNull(queryReq.getFollowType())) { |
1123 | 1125 | query.setFollowType(queryReq.getFollowType().getValue()); |
1124 | 1126 | } |
1127 | + boolean b = (Objects.nonNull(query.getMinMileage()) && Objects.nonNull(query.getMaxMileage())) | |
1128 | + || (Objects.nonNull(query.getMinBuyDate()) && Objects.nonNull(query.getMaxBuyDate())) | |
1129 | + || Objects.nonNull(query.getLevel()); | |
1130 | + if (!b) { | |
1131 | + query.setAndCondition(true); | |
1132 | + } | |
1125 | 1133 | |
1126 | 1134 | return query; |
1127 | 1135 | } | ... | ... |