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

@Service("hystEngAttrService")
public class AttEngHystServiceImpl implements IEngAttrService<AttEngHyst> {

    @Autowired
    private AttEngHystMapper attEngHystMapper;

    @Override
    public AttEngHyst selectByGuid(String guid) {
        return attEngHystMapper.selectByGuid(guid);
    }

    @Override
    public List<AttEngHyst> selectList(AttEngHyst entity) {
        return attEngHystMapper.selectList(entity);
    }

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

    @Override
    public int update(AttEngHyst entity) {
        EntityUtils.emptyStringToNull(entity);
        return attEngHystMapper.update(entity);
    }

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

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