package com.limap.core.basic.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.limap.common.utils.StringUtils;
import com.limap.core.basic.mapper.BasicEquipmentPriceMapper;
import com.limap.core.basic.domain.BasicEquipmentPrice;
import com.limap.core.basic.service.IBasicEquipmentPriceService;

/**
 * 设备基础价格信息Service业务层处理
 * 
 * @author jjb
 * @date 2025-04-11
 */
@Service
public class BasicEquipmentPriceServiceImpl extends ServiceImpl<BasicEquipmentPriceMapper, BasicEquipmentPrice> implements IBasicEquipmentPriceService {
    @Autowired
    private BasicEquipmentPriceMapper basicEquipmentPriceMapper;
    
    /**
     * 查询设备基础价格信息列表
     * 
     * @param basicEquipmentPrice 设备基础价格信息
     * @return 设备基础价格信息
     */
    @Override
    public List<BasicEquipmentPrice> selectBasicEquipmentPriceList(BasicEquipmentPrice basicEquipmentPrice) {
    	LambdaQueryWrapper<BasicEquipmentPrice> queryWrapper = Wrappers.lambdaQuery();
        if (StringUtils.isNotEmpty(basicEquipmentPrice.getName())) {
			queryWrapper.like(BasicEquipmentPrice::getName, basicEquipmentPrice.getName());
		}
        if (StringUtils.isNotEmpty(basicEquipmentPrice.getSharingCode())) {
			queryWrapper.eq(BasicEquipmentPrice::getSharingCode, basicEquipmentPrice.getSharingCode());
		}
        if (StringUtils.isNotEmpty(basicEquipmentPrice.getProductKey())) {
			queryWrapper.eq(BasicEquipmentPrice::getProductKey, basicEquipmentPrice.getProductKey());
		}
        queryWrapper.orderByDesc(BasicEquipmentPrice::getCreateTime);
        return basicEquipmentPriceMapper.selectList(queryWrapper);
    }
}
