package com.ruoyi.busi.service.impl;

import java.util.List;

import com.ruoyi.busi.vo.ProdNewVO;
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.busi.mapper.BusiProdNewMapper;
import com.ruoyi.busi.domain.BusiProdNew;
import com.ruoyi.busi.service.IBusiProdNewService;

/**
 * 产品、文章Service业务层处理
 * 
 * @author vinjor-m
 * @date 2025-06-25
 */
@Service
public class BusiProdNewServiceImpl extends ServiceImpl<BusiProdNewMapper,BusiProdNew>  implements IBusiProdNewService
{
    @Autowired
    private BusiProdNewMapper busiProdNewMapper;

    @Override
    public IPage<ProdNewVO> queryListPage(BusiProdNew pageReqVO, Page<BusiProdNew> page) {
        return busiProdNewMapper.queryListPage(pageReqVO, page);
    }

    /**
     * 获取产品表当前最大排序
     *
     * @param tenantId 站点id
     * @return java.lang.Long
     * @author vinjor-M
     * @date 16:15 2025/6/25
     **/
    @Override
    public Long getMaxSort(String tenantId) {
        Long sort = busiProdNewMapper.selectMaxSort(tenantId);
        return null==sort?1:sort+1;
    }
}
