|
@@ -2,6 +2,7 @@ package com.ruoyi.demo.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateField;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -267,20 +268,16 @@ public class BrandServiceImpl implements BrandService {
|
|
|
queryWrapper.select("enterprise_usci");
|
|
|
//获取符合条件的企业id
|
|
|
//营业状态
|
|
|
- if (body.getBusinessStatus() != null && !body.getBusinessStatus().equals("")) {
|
|
|
+ if (StrUtil.isNotEmpty(body.getBusinessStatus())) {
|
|
|
queryWrapper.eq("business_status",body.getBusinessStatus());
|
|
|
}
|
|
|
//企业类型
|
|
|
- if (body.getEnterpriseType() != null && !body.getEnterpriseType().equals("")) {
|
|
|
- queryWrapper.and(stringQueryWrapper -> {
|
|
|
- stringQueryWrapper.eq("enterprise_type",body.getEnterpriseType());
|
|
|
- });
|
|
|
+ if (StrUtil.isNotEmpty(body.getEnterpriseType())) {
|
|
|
+ queryWrapper.eq("enterprise_type", body.getEnterpriseType());
|
|
|
}
|
|
|
//企业名称
|
|
|
- if (body.getEnterpriseName() != null && !body.getEnterpriseName().equals("")) {
|
|
|
- queryWrapper.and(stringQueryWrapper -> {
|
|
|
- stringQueryWrapper.like("enterprise_name",body.getEnterpriseName());
|
|
|
- });
|
|
|
+ if (StrUtil.isNotEmpty(body.getEnterpriseName())) {
|
|
|
+ queryWrapper.like("enterprise_name", body.getEnterpriseName());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -308,7 +305,7 @@ public class BrandServiceImpl implements BrandService {
|
|
|
|
|
|
Page<BrandSearch> brandSearches = brandMapper.searchSearchByMulti(page,body.getText(), countUp, countDown, coverUp, coverDown,queryWrapper);
|
|
|
// 赋予attention字段信息,0:未关注;1:已关注
|
|
|
- if (userId == null || userId.equals("")) { // 用户未登录或无效用户id,都是未关注状态
|
|
|
+ if (StrUtil.isEmpty(userId)) { // 用户未登录或无效用户id,都是未关注状态
|
|
|
for (BrandSearch search : brandSearches.getRecords()) {
|
|
|
search.setAttention(0);
|
|
|
}
|