package com.ankaibei.workFlow.webadmin.ankaibei.mapper;

import com.ankaibei.workFlow.webadmin.ankaibei.entity.AccesoryInfoEntity;
import com.ankaibei.workFlow.webadmin.ankaibei.entity.ProjectAuditInfoEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;

/**
 * @author
 * @version 1.0
 * @description:
 * @date 2022/10/13 17:56
 */
public interface ProjectAuditInfoMapper extends JpaRepository<ProjectAuditInfoEntity, Integer>, JpaSpecificationExecutor<ProjectAuditInfoEntity> {

    @Query(value = "SELECT p.project_audit_id projectAuditId,p.project_name projectName,p.printcipal printcipal,p.create_date createDate," +
            "p.audit_status auditStatus,p.matter matter from project_audit_info p WHERE p.printcipal = ?1 "
            , countQuery = "SELECT count(1) WHERE p.printcipal = ?1 ", nativeQuery = true)
    Page<Map<String, String>> findByPrintcipalEquals(String printcipal, Pageable page);
}
