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

@Service("otheEngAttrService")
public class AttEngOtheServiceImpl implements IEngAttrService<AttEngOthe> {

    @Autowired
    private AttEngOtheMapper attEngOtheMapper;

    @Override
    public AttEngOthe selectByGuid(String guid) {
        return attEngOtheMapper.selectByGuid(guid);
    }

    @Override
    public List<AttEngOthe> selectList(AttEngOthe entity) {
        return attEngOtheMapper.selectList(entity);
    }

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

    @Override
    public int update(AttEngOthe entity) {
        EntityUtils.emptyStringToNull(entity);
        return attEngOtheMapper.update(entity);
    }

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

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