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

@Service("pustEngAttrService")
public class AttEngPustServiceImpl implements IEngAttrService<AttEngPust> {

    @Autowired
    private AttEngPustMapper attEngPustMapper;

    @Override
    public AttEngPust selectByGuid(String guid) {
        return attEngPustMapper.selectByGuid(guid);
    }

    @Override
    public List<AttEngPust> selectList(AttEngPust entity) {
        return attEngPustMapper.selectList(entity);
    }

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

    @Override
    public int update(AttEngPust entity) {
        EntityUtils.emptyStringToNull(entity);
        return attEngPustMapper.update(entity);
    }

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

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