package com.sckw.product.repository;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sckw.product.dao.KwpGoodsMapper;
import com.sckw.product.model.KwpGoods;
import jakarta.validation.constraints.NotBlank;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Objects;

/**
 * @author :chenXiaoFei
 * @version :1.0
 * @description : 商品接口
 * @create :2025-11-04 15:50:00
 */
@Repository
public class KwpGoodsRepository extends ServiceImpl<KwpGoodsMapper, KwpGoods> {
    public List<KwpGoods> queryByEntIdAndGoodsName(Long entId, String goodsName) {
        return list(Wrappers.<KwpGoods>lambdaQuery()
                .eq(KwpGoods::getDelFlag,0)
                .eq(KwpGoods::getEntId,entId)
                .like(StringUtils.isNotBlank(goodsName),KwpGoods::getName,goodsName));

    }
}
