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.AttEngSd;
import com.goldenwater.slaj.eng.mapper.AttEngSdMapper;
import com.goldenwater.slaj.eng.service.IEngAttrService;

@Service("sdEngAttrService")
public class AttEngSdServiceImpl implements IEngAttrService<AttEngSd> {

    @Autowired
    private AttEngSdMapper attEngSdMapper;

    @Override
    public AttEngSd selectByGuid(String guid) {
        return attEngSdMapper.selectByGuid(guid);
    }

    @Override
    public List<AttEngSd> selectList(AttEngSd entity) {
        return attEngSdMapper.selectList(entity);
    }

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

    @Override
    public int update(AttEngSd entity) {
        EntityUtils.emptyStringToNull(entity);
        return attEngSdMapper.update(entity);
    }

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

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