package com.ghy.worker.service.impl;

import com.ghy.worker.domain.WorkerBank;
import com.ghy.worker.mapper.WorkerBankMapper;
import com.ghy.worker.service.WorkerBankService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

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

@Slf4j
@Service
public class WorkerBankServiceImpl implements WorkerBankService {

    @Resource
    private WorkerBankMapper workerBankMapper;

    @Override
    public int insertWorkerBank(WorkerBank workerBank) {
        return workerBankMapper.insertWorkerBank(workerBank);
    }

    @Override
    public int updateByMemberId(WorkerBank workerBank) {
        return workerBankMapper.updateByMemberId(workerBank);
    }

    @Override
    public WorkerBank getByWorkerId(Long workerId, Long deptId) {
        if (workerId == null || deptId == null) {
            return null;
        }
        return workerBankMapper.getByWorkerId(workerId, deptId);
    }

    @Override
    public WorkerBank getByMemberId(String memberId) {
        return workerBankMapper.getByMemberId(memberId);
    }

    @Override
    public List<WorkerBank> getByWorkerIds(String ids) {
        return workerBankMapper.getByWorkerIds(ids);
    }

    @Override
    public List<WorkerBank> select(WorkerBank workerBank) {
        return workerBankMapper.select(workerBank);
    }
}
