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

@Service("wagaEngAttrService")
public class AttEngWagaServiceImpl implements IEngAttrService<AttEngWaga> {

    @Autowired
    private AttEngWagaMapper attEngWagaMapper;

    @Override
    public AttEngWaga selectByGuid(String guid) {
        return attEngWagaMapper.selectByGuid(guid);
    }

    @Override
    public List<AttEngWaga> selectList(AttEngWaga entity) {
        return attEngWagaMapper.selectList(entity);
    }

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

    @Override
    public int update(AttEngWaga entity) {
        EntityUtils.emptyStringToNull(entity);
        return attEngWagaMapper.update(entity);
    }

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

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