package com.gz.mapper.archive;

import com.gz.dto.archive.ArchiveDTO;
import com.gz.rvo.archive.ArchiveRVO;
import com.gz.rvo.borrow.ArchiveBorrowListRVO;
import com.gz.vo.archive.AgainSearchVO;
import com.gz.vo.archive.SearchArchiveVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @description 档案Mapper
 * @author LiuChangLan
 * @since 2021/2/23 18:11
 */
public interface ArchiveMapper extends Mapper<ArchiveDTO> {

    List<ArchiveRVO> searchList(SearchArchiveVO vo);

    List<ArchiveRVO> againSearchList(AgainSearchVO vo);

    ArchiveRVO selectByPk(Integer id);

    ArchiveRVO selectByDh(String dh);

    /**
     * @description 查询当前件号
     * @author LiuChangLan
     * @since 2021/2/24 17:44
     */
    @Select("SELECT auto_increment FROM information_schema.tables where table_schema=\"guihua_archives\" and table_name=\"tab_archives\";")
    Integer selectCurrAutoIncrement();

    List<ArchiveBorrowListRVO> selectBorrowList(@Param("roleId") Integer roleId);

    Integer selectMaxJH(String mlCode);


    List<ArchiveDTO> selectRoleAll(Integer roleId);

    ArchiveDTO selectByRolePrimaryKey(Integer roleId, Object id);

    ArchiveRVO selectByPrimaryKeyText(Integer id);

    Integer getMenuId(@Param("id") Integer id);

    String getDeptId(@Param("id") String id);
}
