package com.inspect.metadata.area.mapper;

import com.inspect.metadata.area.domain.BaseDataArea;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface BaseDataAreaMapper {
    List<BaseDataArea> selectAreaList(BaseDataArea area);
    List<BaseDataArea> selectAreaRelationList(BaseDataArea area);

    List<Long> selectAreaListByRoleId(@Param("roleId") Long roleId, @Param("areaCheckStrictly") boolean areaCheckStrictly);

    BaseDataArea selectAreaById(Long id);

    BaseDataArea selectAreaRelationById(Long id);

    void updateAreaRelationById(@Param("areaId") Long areaId, @Param("toAreaId") Long toAreaId, @Param("ancestors") String ancestors);

    List<BaseDataArea> selectChildrenAreaById(Long id);

    int selectNormalChildrenAreaById(Long id);

    int hasChildByAreaId(Long areaId);

    int checkAreaExistBook(Long bookId);

    BaseDataArea checkAreaNameUnique(@Param("areaName") String areaName, @Param("parentId") Long parentId);

    int insertArea(BaseDataArea area);

    int updateArea(BaseDataArea area);

    void updateAreaStatusNormal(Long[] statusIds);

    int updateAreaChildren(@Param("areas") List<BaseDataArea> areas);

    int deleteAreaById(Long id);

    BaseDataArea selectBasedataAreaByPatrolPointId(String pointId);

    String selectAreaIdByName(@Param("areaName") String areaName, @Param("parentId") String parentId);

    int deleteAreaBySendCode(@Param("sendCode") String sendCode);
}
