package com.fs.course.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.fs.course.mapper.FsCourseProductMapper;
import com.fs.course.domain.FsCourseProduct;
import com.fs.course.service.IFsCourseProductService;

/**
 * 拍单商品Service业务层处理
 * 
 * @author fs
 * @date 2025-07-28
 */
@Service
public class FsCourseProductServiceImpl extends ServiceImpl<FsCourseProductMapper, FsCourseProduct> implements IFsCourseProductService {

    /**
     * 查询拍单商品
     * 
     * @param id 拍单商品主键
     * @return 拍单商品
     */
    @Override
    public FsCourseProduct selectFsCourseProductById(Long id)
    {
        return baseMapper.selectFsCourseProductById(id);
    }

    /**
     * 查询拍单商品列表
     * 
     * @param fsCourseProduct 拍单商品
     * @return 拍单商品
     */
    @Override
    public List<FsCourseProduct> selectFsCourseProductList(FsCourseProduct fsCourseProduct)
    {
        return baseMapper.selectFsCourseProductList(fsCourseProduct);
    }

    /**
     * 新增拍单商品
     * 
     * @param fsCourseProduct 拍单商品
     * @return 结果
     */
    @Override
    public int insertFsCourseProduct(FsCourseProduct fsCourseProduct)
    {
        fsCourseProduct.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertFsCourseProduct(fsCourseProduct);
    }

    /**
     * 修改拍单商品
     * 
     * @param fsCourseProduct 拍单商品
     * @return 结果
     */
    @Override
    public int updateFsCourseProduct(FsCourseProduct fsCourseProduct)
    {
        fsCourseProduct.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateFsCourseProduct(fsCourseProduct);
    }

    /**
     * 批量删除拍单商品
     * 
     * @param ids 需要删除的拍单商品主键
     * @return 结果
     */
    @Override
    public int deleteFsCourseProductByIds(Long[] ids)
    {
        return baseMapper.deleteFsCourseProductByIds(ids);
    }

    /**
     * 删除拍单商品信息
     * 
     * @param id 拍单商品主键
     * @return 结果
     */
    @Override
    public int deleteFsCourseProductById(Long id)
    {
        return baseMapper.deleteFsCourseProductById(id);
    }
}
