package com.yijia.label.service.impl;

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

/**
 * 标签规则明细Service业务层处理
 * 
 * @author yijia
 * @date 2021-06-15
 */
@Service
public class LabelRuleDetailServiceImpl implements ILabelRuleDetailService 
{
    @Autowired
    private LabelRuleDetailMapper labelRuleDetailMapper;

    /**
     * 查询标签规则明细
     * 
     * @param id 标签规则明细ID
     * @return 标签规则明细
     */
    @Override
    public LabelRuleDetail selectLabelRuleDetailById(Integer id)
    {
        return labelRuleDetailMapper.selectLabelRuleDetailById(id);
    }

    /**
     * 查询标签规则明细列表
     * 
     * @param labelRuleDetail 标签规则明细
     * @return 标签规则明细
     */
    @Override
    public List<LabelRuleDetail> selectLabelRuleDetailList(LabelRuleDetail labelRuleDetail)
    {
        return labelRuleDetailMapper.selectLabelRuleDetailList(labelRuleDetail);
    }

    /**
     * 新增标签规则明细
     * 
     * @param labelRuleDetail 标签规则明细
     * @return 结果
     */
    @Override
    public int insertLabelRuleDetail(LabelRuleDetail labelRuleDetail)
    {
        labelRuleDetail.setCreateTime(DateUtils.getNowDate());
        return labelRuleDetailMapper.insertLabelRuleDetail(labelRuleDetail);
    }

    /**
     * 修改标签规则明细
     * 
     * @param labelRuleDetail 标签规则明细
     * @return 结果
     */
    @Override
    public int updateLabelRuleDetail(LabelRuleDetail labelRuleDetail)
    {
        labelRuleDetail.setUpdateTime(DateUtils.getNowDate());
        return labelRuleDetailMapper.updateLabelRuleDetail(labelRuleDetail);
    }

    /**
     * 批量删除标签规则明细
     * 
     * @param ids 需要删除的标签规则明细ID
     * @return 结果
     */
    @Override
    public int deleteLabelRuleDetailByIds(Integer[] ids)
    {
        return labelRuleDetailMapper.deleteLabelRuleDetailByIds(ids);
    }

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

    /**
     * 查询规则明细
     * @param labelRule
     * @return
     */
    @Override
    public List<LabelRuleDetail> labelRuleDetailList(LabelRule labelRule) {
        return labelRuleDetailMapper.labelRuleDetailList(labelRule);
    }
}
