xuhy
2025-01-09 712f70b2936079a131ecb1e63c6d337171618cad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.stylefeng.guns.modular.system.service.impl;
 
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.dao.RecruitMapper;
import com.stylefeng.guns.modular.system.model.Recruit;
import com.stylefeng.guns.modular.system.service.IRecruitService;
import org.springframework.stereotype.Service;
 
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
@Service
public class RecruitServiceImpl extends ServiceImpl<RecruitMapper, Recruit> implements IRecruitService {
 
    @Override
    public Map<String, Object> list(String createTime, String title, String experienceRequirements, String insertUser, String driverType, Integer offset, Integer limit) throws Exception {
        Integer companyId = ShiroKit.getUser().getRoleType() == 1 ? null : ShiroKit.getUser().getObjectId();
        String start = "";
        String end = "";
        if(ToolUtil.isNotEmpty(createTime)){
            String[] split = createTime.split(" - ");
            start = split[0];
            end = split[1];
        }
        Map<String, Object> map = new HashMap<>();
        List<Map<String, Object>> list = this.baseMapper.list(companyId, start, end, title, experienceRequirements, insertUser, driverType, offset, limit);
        int count = this.baseMapper.listCount(companyId, start, end, title, experienceRequirements, insertUser, driverType);
        map.put("rows", list);
        map.put("total", count);
        return map;
    }
}