package com.yijia.label.service.impl;

import java.util.List;
import com.yijia.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yijia.label.mapper.LabelRuleMapper;
import com.yijia.label.domain.LabelRule;
import com.yijia.label.service.ILabelRuleService;

/**
 * 标签规则
Service业务层处理
 * 
 * @author yijia
 * @date 2021-06-15
 */
@Service
public class LabelRuleServiceImpl implements ILabelRuleService 
{
    @Autowired
    private LabelRuleMapper labelRuleMapper;

    /**
     * 查询标签规则

     * 
     * @param id 标签规则
ID
     * @return 标签规则

     */
    @Override
    public LabelRule selectLabelRuleById(Integer id)
    {
        return labelRuleMapper.selectLabelRuleById(id);
    }

    /**
     * 查询标签规则
列表
     * 
     * @param labelRule 标签规则

     * @return 标签规则

     */
    @Override
    public List<LabelRule> selectLabelRuleList(LabelRule labelRule)
    {
        return labelRuleMapper.selectLabelRuleList(labelRule);
    }

    /**
     * 新增标签规则

     * 
     * @param labelRule 标签规则

     * @return 结果
     */
    @Override
    public int insertLabelRule(LabelRule labelRule)
    {
        labelRule.setCreateTime(DateUtils.getNowDate());
        return labelRuleMapper.insertLabelRule(labelRule);
    }

    /**
     * 修改标签规则

     * 
     * @param labelRule 标签规则

     * @return 结果
     */
    @Override
    public int updateLabelRule(LabelRule labelRule)
    {
        labelRule.setUpdateTime(DateUtils.getNowDate());
        return labelRuleMapper.updateLabelRule(labelRule);
    }

    /**
     * 批量删除标签规则

     * 
     * @param ids 需要删除的标签规则
ID
     * @return 结果
     */
    @Override
    public int deleteLabelRuleByIds(Integer[] ids)
    {
        return labelRuleMapper.deleteLabelRuleByIds(ids);
    }

    /**
     * 删除标签规则
信息
     * 
     * @param id 标签规则
ID
     * @return 结果
     */
    @Override
    public int deleteLabelRuleById(Integer id)
    {
        return labelRuleMapper.deleteLabelRuleById(id);
    }
}
