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

@Service("cwsEngAttrService")
public class AttEngCwsServiceImpl implements IEngAttrService<AttEngCws> {

    @Autowired
    private AttEngCwsMapper attEngCwsMapper;

    @Override
    public AttEngCws selectByGuid(String guid) {
        return attEngCwsMapper.selectByGuid(guid);
    }

    @Override
    public List<AttEngCws> selectList(AttEngCws entity) {
        return attEngCwsMapper.selectList(entity);
    }

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

    @Override
    public int update(AttEngCws entity) {
        EntityUtils.emptyStringToNull(entity);
        return attEngCwsMapper.update(entity);
    }

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

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