package com.gtiit.shr.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gtiit.shr.common.Result;
import com.gtiit.shr.entity.vo.JobInfoVo;
import com.gtiit.shr.mapper.JobMapper;
import com.gtiit.shr.service.JobService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class JobServiceImpl implements JobService {
    @Autowired
    private JobMapper jobMapper;



    public int insertBatchJob(List<JobInfoVo> jobInfoVos) {
        return this.jobMapper.insertBatch(jobInfoVos);
    }

    public int updateBatchJob(List<JobInfoVo> jobInfoVos) {
        return this.jobMapper.updateBatch(jobInfoVos);
    }

    public Result findPage(List<String> shrIds) {
        QueryWrapper<JobInfoVo> queryWrapper = new QueryWrapper();
        queryWrapper.in("ID", shrIds);
        List<JobInfoVo> jobInfoVos = this.jobMapper.selectList(queryWrapper);
        Result result = new Result();
        if (jobInfoVos != null && jobInfoVos.size() > 0) {
            result.setMessage("职务查询成功！");
            result.setCode(1);
            result.setFlag(true);
            result.setData(jobInfoVos);
        } else {
            result.setMessage("职务查询失败！");
            result.setCode(0);
            result.setFlag(false);
        }

        return result;
    }
}
