gongzuming
2024-09-02 a92e296c28d4c09055f53293378da001117ec979
src/main/java/com/mzl/flower/service/customer/CustomerService.java
@@ -14,8 +14,10 @@
import com.mzl.flower.dto.response.partner.PartnerDTO;
import com.mzl.flower.entity.customer.Customer;
import com.mzl.flower.entity.partner.Partner;
import com.mzl.flower.enums.TrueOrFalseEnum;
import com.mzl.flower.mapper.customer.CustomerMapper;
import com.mzl.flower.mapper.partner.PartnerMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@@ -25,6 +27,7 @@
@Service
@Transactional
@Slf4j
public class CustomerService {
@@ -200,4 +203,21 @@
        }
        return null;
    }
    /**
     * 根据会员等级获取等级下的customer信息
     * @param levelId
     * @return
     */
    public List<Customer> getCustomerListByLevelId(Integer levelId){
        if(null != levelId){
            QueryWrapper<Customer> customerQueryWrapper=new QueryWrapper<>();
            customerQueryWrapper.lambda()
                    .eq(Customer::getDeleted, TrueOrFalseEnum.FALSE.isFlag())
                    .eq(Customer::getLevelId,levelId);
            return customerMapper.selectList(customerQueryWrapper);
        }
        return null;
    }
}