package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PolicyGuideMapper;
import com.ruoyi.system.domain.PolicyGuide;
import com.ruoyi.system.service.IPolicyGuideService;

/**
 * 政策指南Service业务层处理
 * 
 * @author boman
 * @date 2022-06-16
 */
@Service
public class PolicyGuideServiceImpl implements IPolicyGuideService 
{
    @Autowired
    private PolicyGuideMapper policyGuideMapper;

    /**
     * 查询政策指南
     * 
     * @param policyId 政策指南主键
     * @return 政策指南
     */
    @Override
    public PolicyGuide selectPolicyGuideByPolicyId(Long policyId)
    {
        return policyGuideMapper.selectPolicyGuideByPolicyId(policyId);
    }

    /**
     * 查询政策指南列表
     * 
     * @param policyGuide 政策指南
     * @return 政策指南
     */
    @Override
    public List<PolicyGuide> selectPolicyGuideList(PolicyGuide policyGuide)
    {
        return policyGuideMapper.selectPolicyGuideList(policyGuide);
    }

    /**
     * 新增政策指南
     * 
     * @param policyGuide 政策指南
     * @return 结果
     */
    @Override
    public int insertPolicyGuide(PolicyGuide policyGuide)
    {
        policyGuide.setCreateTime(DateUtils.getNowDate());
        return policyGuideMapper.insertPolicyGuide(policyGuide);
    }

    /**
     * 修改政策指南
     * 
     * @param policyGuide 政策指南
     * @return 结果
     */
    @Override
    public int updatePolicyGuide(PolicyGuide policyGuide)
    {
        policyGuide.setUpdateTime(DateUtils.getNowDate());
        return policyGuideMapper.updatePolicyGuide(policyGuide);
    }

    /**
     * 批量删除政策指南
     * 
     * @param policyIds 需要删除的政策指南主键
     * @return 结果
     */
    @Override
    public int deletePolicyGuideByPolicyIds(Long[] policyIds)
    {
        return policyGuideMapper.deletePolicyGuideByPolicyIds(policyIds);
    }

    /**
     * 删除政策指南信息
     * 
     * @param policyId 政策指南主键
     * @return 结果
     */
    @Override
    public int deletePolicyGuideByPolicyId(Long policyId)
    {
        return policyGuideMapper.deletePolicyGuideByPolicyId(policyId);
    }
}
