package com.zcloud.personnel.positioning.persistence.mapper;

import com.zcloud.personnel.positioning.persistence.dataobject.OrgLocalCorpDO;
import com.zcloud.personnel.positioning.persistence.dataobject.OrgLocalDepartmentDO;
import com.zcloud.personnel.positioning.persistence.dataobject.OrgMatchSnapshotDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface OrgMatchMapper {
    OrgMatchSnapshotDO findMatched(@Param("sourceConfigCode") String sourceConfigCode,
                                   @Param("findsCorpinfoName") String findsCorpinfoName,
                                   @Param("findsDepartmentName") String findsDepartmentName);
    List<OrgLocalCorpDO> listCorpCandidates(@Param("params") Map<String, Object> params);
    List<OrgLocalDepartmentDO> listDepartmentCandidates(@Param("departmentName") String departmentName);
    int upsert(@Param("params") Map<String, Object> params);
    int touch(@Param("sourceConfigCode") String sourceConfigCode,
              @Param("findsCorpinfoName") String findsCorpinfoName,
              @Param("findsDepartmentName") String findsDepartmentName,
              @Param("seenTime") LocalDateTime seenTime);
    long countAll();
    long countMatched();
}
