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

@Service("dikeEngAttrService")
public class AttEngDikeServiceImpl implements IEngAttrService<AttEngDike> {

    @Autowired
    private AttEngDikeMapper attEngDikeMapper;

    @Override
    public AttEngDike selectByGuid(String guid) {
        return attEngDikeMapper.selectByGuid(guid);
    }

    @Override
    public List<AttEngDike> selectList(AttEngDike entity) {
        return attEngDikeMapper.selectList(entity);
    }

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

    @Override
    public int update(AttEngDike entity) {
        EntityUtils.emptyStringToNull(entity);
        return attEngDikeMapper.update(entity);
    }

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

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