package com.ruoyi.base.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.base.domain.BaseSiteInfo;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.base.mapper.BaseInquiryMapper;
import com.ruoyi.base.domain.BaseInquiry;
import com.ruoyi.base.service.IBaseInquiryService;

/**
 * 在线询盘设置Service业务层处理
 * 
 * @author vinjor-m
 * @date 2025-06-24
 */
@Service
public class BaseInquiryServiceImpl extends ServiceImpl<BaseInquiryMapper,BaseInquiry>  implements IBaseInquiryService
{
    @Autowired
    private BaseInquiryMapper baseInquiryMapper;

    @Override
    public IPage<BaseInquiry> queryListPage(BaseInquiry pageReqVO, Page<BaseInquiry> page) {
        return baseInquiryMapper.queryListPage(pageReqVO, page);
    }

    /**
     * 查询站点询盘设置
     *
     * @param tenantId 租户id
     * @return com.ruoyi.base.domain.BaseInquiry
     * @author vinjor-M
     * @date 11:01 2025/6/24
     **/
    @Override
    public BaseInquiry getInquiry(String tenantId) {
        LambdaQueryWrapper<BaseInquiry> queryWrapper = new LambdaQueryWrapper<BaseInquiry>()
                .eq(BaseInquiry::getTenantId,tenantId);
        List<BaseInquiry> list = this.list(queryWrapper);
        return list.isEmpty()?null:list.get(0);
    }
}
