package com.ruoyi.oa.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.oa.mapper.CmcPriceMapper;
import com.ruoyi.oa.domain.CmcPrice;
import com.ruoyi.oa.service.ICmcPriceService;

/**
 * cmc结算单价Service业务层处理
 * 
 * @author cmc
 * @date 2024-03-21
 */
@Service
public class CmcPriceServiceImpl implements ICmcPriceService 
{
    @Autowired
    private CmcPriceMapper cmcPriceMapper;

    /**
     * 查询单价表
     *
     * @param id 单价表ID
     * @return 单价表
     */
    @Override
    public CmcPrice selectCmcPriceById(Long id)
    {
        return cmcPriceMapper.selectCmcPriceById(id);
    }

    /**
     * 查询单价表列表
     *
     * @param cmcPrice 单价表
     * @return 单价表
     */
    @Override
    public List<CmcPrice> selectCmcPriceList(CmcPrice cmcPrice)
    {
        return cmcPriceMapper.selectCmcPriceList(cmcPrice);
    }

    /**
     * 根据工作类别查询单价表
     *
     * @param workType 工作类别
     * @return 单价表
     */
    @Override
    public List<CmcPrice> selectCmcPriceByWorkType(String workType) { return cmcPriceMapper.selectCmcPriceByWorkType(workType); }

    /**
     * 根据工作内容查询单价表
     *
     * @param workItem 工作内容
     * @return 单价表
     */
    @Override
    public List<CmcPrice> selectCmcPriceByWorkItem(String workItem) { return cmcPriceMapper.selectCmcPriceByWorkItem(workItem); }

    /**
     * 根据比例等级查询出单位、一般地类、复杂地类
     *
     * @param workItem 工作内容
     * @param subItem 内容细项
     * @param scaleGrade 比例等级
     * @return 单价表
     */
    @Override
    public List<CmcPrice> selectCmcPriceByScaleGrade(String workItem, String subItem, String scaleGrade) { return cmcPriceMapper.selectCmcPriceByScaleGrade(workItem, subItem, scaleGrade); }

    /**
     * 新增单价表
     *
     * @param cmcPrice 单价表
     * @return 结果
     */
    @Override
    public int insertCmcPrice(CmcPrice cmcPrice)
    {
        return cmcPriceMapper.insertCmcPrice(cmcPrice);
    }

    /**
     * 修改单价表
     *
     * @param cmcPrice 单价表
     * @return 结果
     */
    @Override
    public int updateCmcPrice(CmcPrice cmcPrice)
    {
        return cmcPriceMapper.updateCmcPrice(cmcPrice);
    }

    /**
     * 批量删除单价表
     *
     * @param ids 需要删除的单价表ID
     * @return 结果
     */
    @Override
    public int deleteCmcPriceByIds(Long[] ids)
    {
        return cmcPriceMapper.deleteCmcPriceByIds(ids);
    }

    /**
     * 删除单价表信息
     *
     * @param id 单价表ID
     * @return 结果
     */
    @Override
    public int deleteCmcPriceById(Long id)
    {
        return cmcPriceMapper.deleteCmcPriceById(id);
    }
}
