package com.jeeplus.ccpm.approvalType.mapper;


import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.jeeplus.ccpm.approvalType.domain.CcpmReimbursementTypeInfo;
import com.jeeplus.core.domain.TreeMapper;
import com.jeeplus.sys.domain.WorkAttachmentInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: 王强
 * @create: 2022-11-25 09:02
 **/
public interface CcpmReimbursementTypeMapper extends BaseMapper<CcpmReimbursementTypeInfo>, TreeMapper<CcpmReimbursementTypeInfo> {

    /**
     * 根据name和parentId查询名称是否重复
     * @param name
     * @param parentId
     * @return
     */
    Integer checkNameIsExist(@Param("name") String name, @Param("parentId") String parentId);

    Integer getNo(@Param("parentId") String parentId);

    Integer getLevel(@Param("parentId") String parentId);

    List<String> getChildId(String id);

    /**
     * 获取所有业务类型的数据
     * @param type
     * @return
     */
    List<CcpmReimbursementTypeInfo> getAllList(String type);
    @InterceptorIgnore(tenantLine = "true")
    List<WorkAttachmentInfo> findList(@Param("id") String id);
    /**
     * 根据AttachmentFla 和AttachmentId 查询附件信息
     * @param id
     * @param attachmentFlag
     * @return
     */
    List<WorkAttachmentInfo> findListByIdAndAttachmentFlag(@Param("id") String id, @Param("attachmentFlag")String attachmentFlag);
    @InterceptorIgnore(tenantLine = "true")
    Integer findIsExit(@Param("id") String id, @Param("name")String name);
}
