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

@Service("wadiEngAttrService")
public class AttEngWadiServiceImpl implements IEngAttrService<AttEngWadi> {

    @Autowired
    private AttEngWadiMapper attEngWadiMapper;

    @Override
    public AttEngWadi selectByGuid(String guid) {
        return attEngWadiMapper.selectByGuid(guid);
    }

    @Override
    public List<AttEngWadi> selectList(AttEngWadi entity) {
        return attEngWadiMapper.selectList(entity);
    }

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

    @Override
    public int update(AttEngWadi entity) {
        EntityUtils.emptyStringToNull(entity);
        return attEngWadiMapper.update(entity);
    }

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

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