package com.usky.fire.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.usky.common.mybatis.core.AbstractCrudService;
import com.usky.fire.domain.DemFireLabelAttribute;
import com.usky.fire.mapper.DemFireLabelAttributeMapper;
import com.usky.fire.service.DemFireLabelAttributeService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author JCB
 * @since 2022-09-27
 */
@Service
public class DemFireLabelAttributeServiceImpl extends AbstractCrudService<DemFireLabelAttributeMapper, DemFireLabelAttribute> implements DemFireLabelAttributeService {

    @Override
    public List<DemFireLabelAttribute> freLabelAttributeList(Integer labelId) {
        LambdaQueryWrapper<DemFireLabelAttribute> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(labelId != null && labelId != 0, DemFireLabelAttribute::getLabelId, labelId);
        List<DemFireLabelAttribute> list = this.list(queryWrapper);
        return list;
    }

    @Override
    public void delDemFireLabelAttribute(Integer id){
        this.removeById(id);
    }
}
