package com.goldenwater.slaj.eng.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.goldenwater.common.utils.uuid.IdUtils;
import com.goldenwater.slaj.common.utils.EntityUtils;
import com.goldenwater.slaj.eng.domain.AttEngIrr;
import com.goldenwater.slaj.eng.mapper.AttEngIrrMapper;
import com.goldenwater.slaj.eng.service.IEngAttrService;

@Service("irrEngAttrService")
public class AttEngIrrServiceImpl implements IEngAttrService<AttEngIrr> {

    @Autowired
    private AttEngIrrMapper attEngIrrMapper;

    @Override
    public AttEngIrr selectByGuid(String guid) {
        return attEngIrrMapper.selectByGuid(guid);
    }

    @Override
    public List<AttEngIrr> selectList(AttEngIrr entity) {
        return attEngIrrMapper.selectList(entity);
    }

    @Override
    public int insert(AttEngIrr entity) {
        String guid = IdUtils.fastSimpleUUID();
        entity.setGuid(guid);
        entity.setEngGuid(guid);
        EntityUtils.emptyStringToNull(entity);
        return attEngIrrMapper.insert(entity);
    }

    @Override
    public int update(AttEngIrr entity) {
        EntityUtils.emptyStringToNull(entity);
        return attEngIrrMapper.update(entity);
    }

    @Override
    public int deleteByGuid(String guid) {
        return attEngIrrMapper.deleteByGuid(guid);
    }

    @Override
    public int deleteByGuids(String[] guids) {
        return attEngIrrMapper.deleteByGuids(guids);
    }
}
