package com.hs.api.service.Impl;

import com.hs.api.mapper.DicOrgMapper;
import com.hs.api.model.DicOrg;
import com.hs.api.service.DicOrgService;
import org.springframework.stereotype.Service;

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

@Service
public class DicOrgServiceImpl implements DicOrgService {
    @Resource
    private DicOrgMapper dicOrgMapper;

    @Override
    public int add(DicOrg dicOrg) {
        return dicOrgMapper.insert(dicOrg);
    }

    @Override
    public List<DicOrg> findAll() {
        return dicOrgMapper.selectAll();
    }

    @Override
    public DicOrg find(Long id) {
        return dicOrgMapper.selectByPrimaryKey(id);
    }

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

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

    @Override
    public int update(DicOrg dicOrg) {
        return dicOrgMapper.updateByPrimaryKey(dicOrg);
    }
}
