package com.hs.api.service.Impl;

import com.hs.api.mapper.DicIndInfoMapper;
import com.hs.api.model.DicIndInfo;
import com.hs.api.service.DicIndService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DicIndServiceImpl implements DicIndService {
    @Resource
    private DicIndInfoMapper dicIndMapper;

    @Override
    public int add(DicIndInfo dicInd) {
        return dicIndMapper.insert(dicInd);
    }

    @Override
    public List<DicIndInfo> findAll() {
        return dicIndMapper.selectAll();
    }

    @Override
    public DicIndInfo find(Long id) {
        return dicIndMapper.selectByPrimaryKey(id);
    }

    @Override
    public int delete(Long id) {
        return dicIndMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int logicDelete(Long id) {
        return 0;
    }

    @Override
    public int update(DicIndInfo dicInd) {
        return dicIndMapper.updateByPrimaryKey(dicInd);
    }

    @Override
    public List<DicIndInfo> selectAll(Integer pageCode, String filter) {
        List<DicIndInfo> list = dicIndMapper.selectAllByFilter(pageCode, filter);
        return list;
    }

}
