package com.inspect.metadata.alg.service.impl;

import com.inspect.metadata.alg.domain.BasedataAlgSubtype;
import com.inspect.metadata.alg.mapper.BasedataAlgSubtypeMapper;
import com.inspect.metadata.alg.service.IBasedataAlgSubtypeService;
import com.inspect.base.core.utils.DateUtils;

import java.util.List;

import org.springframework.stereotype.Service;

@Service
public class BasedataAlgSubtypeServiceImpl implements IBasedataAlgSubtypeService {
    private final BasedataAlgSubtypeMapper basedataAlgSubtypeMapper;

    public BasedataAlgSubtypeServiceImpl(BasedataAlgSubtypeMapper basedataAlgSubtypeMapper) {
        this.basedataAlgSubtypeMapper = basedataAlgSubtypeMapper;
    }

    public BasedataAlgSubtype selectBasedataAlgSubtypeByAlgSubtypeId(Long algSubtypeId) {
        return this.basedataAlgSubtypeMapper.selectBasedataAlgSubtypeByAlgSubtypeId(algSubtypeId);
    }

    public List<BasedataAlgSubtype> selectBasedataAlgSubtypeList(BasedataAlgSubtype basedataAlgSubtype) {
        return this.basedataAlgSubtypeMapper.selectBasedataAlgSubtypeList(basedataAlgSubtype);
    }

    public int insertBasedataAlgSubtype(BasedataAlgSubtype basedataAlgSubtype) {
        basedataAlgSubtype.setCreateTime(DateUtils.getNowDate());
        return this.basedataAlgSubtypeMapper.insertBasedataAlgSubtype(basedataAlgSubtype);
    }

    public int updateBasedataAlgSubtype(BasedataAlgSubtype basedataAlgSubtype) {
        basedataAlgSubtype.setUpdateTime(DateUtils.getNowDate());
        return this.basedataAlgSubtypeMapper.updateBasedataAlgSubtype(basedataAlgSubtype);
    }

    public int deleteBasedataAlgSubtypeByAlgSubtypeIds(Long[] algSubtypeIds) {
        return this.basedataAlgSubtypeMapper.deleteBasedataAlgSubtypeByAlgSubtypeIds(algSubtypeIds);
    }

    public int deleteBasedataAlgSubtypeByAlgSubtypeId(Long algSubtypeId) {
        return this.basedataAlgSubtypeMapper.deleteBasedataAlgSubtypeByAlgSubtypeId(algSubtypeId);
    }

    public int checkAlgSubtypeNameIsExit(String algSubtypeId, String algId, String algSubtypeName) {
        return this.basedataAlgSubtypeMapper.checkAlgSubtypeNameIsExit(algSubtypeId, algId, algSubtypeName);
    }
}
