package com.engine.organization.mapper.resource;

import com.alibaba.fastjson.JSONObject;
import com.engine.organization.entity.hrmresource.po.ResourcePO;
import com.engine.organization.entity.hrmresource.param.SearchTemplateParam;
import com.engine.organization.entity.hrmresource.po.SearchTemplatePO;
import com.engine.organization.entity.resume.po.HrmFamilyInfoPO;
import com.engine.organization.entity.resume.po.PersonnelResumePO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author weaver_cl
 * @Description:
 * @Date 2022/12/15
 * @Version V1.0
 **/
public interface HrmResourceMapper {

    List<ResourcePO> selectFilterDatas();

    List<ResourcePO> listByFilter(@Param("resourcePO") ResourcePO resourcePO);

    PersonnelResumePO getPersonnelResumeById(@Param("id") Integer id);

    List<PersonnelResumePO> getPersonnelResumeList();

    List<HrmFamilyInfoPO> getHrmFamilyInfoByUser(@Param("resourceId") Integer resourceId);

    /**
     * 获取人员过滤后的人员信息
     *
     * @param subcompanyid1
     * @param departmentid
     * @param jobId
     * @param resourceId
     * @return
     */
    List<ResourcePO> getPersonnelScreening(@Param("subCompanyIds") List<Integer> subcompanyid1, @Param("departmentIds") List<Integer> departmentid, @Param("jobIds") List<Long> jobId, @Param("resourceIds") List<Long> resourceId);

    /**
     * 根据用户ID获取查询模板
     *
     * @param userId
     * @return
     */
    List<SearchTemplateParam> getSearchTemplatesByUser(@Param("userId") Integer userId);

    /**
     * 根据用户ID获取列定制模板
     *
     * @param userId
     * @return
     */
    List<SearchTemplateParam> getCustomTemplatesByUser(@Param("userId") Integer userId);

    SearchTemplatePO getSearchTemplateById(@Param("id") String id);

    SearchTemplatePO getSearchTemplateByName(@Param("userId") Integer userId, @Param("name") String name);

    SearchTemplatePO getCustomTemplateById(@Param("id") String id);

    SearchTemplatePO getCustomTemplateByName(@Param("userId") Integer userId, @Param("name") String name);

    Integer insertSearchTemplate(SearchTemplatePO templatePO);

    Integer deleteSearchTemplate(@Param("id") Integer Id, @Param("userId") Integer userId);

    Integer insertCustomTemplate(SearchTemplatePO templatePO);

    Integer deleteCustomTemplate(@Param("id") Integer Id, @Param("userId") Integer userId);

    List<JSONObject> queryAllResColumns(@Param("level") String level,@Param("grade") String grade);


}
