package com.ruoyi.system.mapper.grid;

import com.ruoyi.system.domain.grid.GridRegion;
import com.ruoyi.system.domain.grid.GridRegionExample;
import com.ruoyi.system.domain.grid.enums.GridRegionSearchParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GridRegionMapper {
    long countByExample(GridRegionExample example);

    int deleteByExample(GridRegionExample example);

    int deleteByPrimaryKey(String id);

    int insert(GridRegion record);

    int insertSelective(GridRegion record);

    List<GridRegion> selectByExample(GridRegionExample example);
    List<GridRegion> selectByExampleWithBLOBs(GridRegionExample example);

    GridRegion selectByPrimaryKey(String id);
    GridRegion getWgLevel(@Param("wgCode") String wgCode);
    String getRootWgCode();
    String getWgNameByCode(@Param("wgCode") String wgCode);

    int updateByExampleSelective(@Param("record") GridRegion record, @Param("example") GridRegionExample example);

    int updateByExampleWithBLOBs(@Param("record") GridRegion record, @Param("example") GridRegionExample example);

    int updateByExample(@Param("record") GridRegion record, @Param("example") GridRegionExample example);

    int updateByPrimaryKeySelective(GridRegion record);

    int updateByPrimaryKeyWithBLOBs(GridRegion record);

    int updateByPrimaryKey(GridRegion record);
    //三级网格信息
    List<GridRegion> selectThirdGridByBaseId();

    List<GridRegion> selectThirdGridNameByBaseId();

    List<GridRegion> getByParams(GridRegionSearchParam param);

    Integer countByParams(GridRegionSearchParam param);

    List<GridRegion> getSecondOrThirdRegion(@Param("wgType")String wgType, @Param("wgCodeLikes")List<String> wgCodeLikes, @Param("name")String name, @Param("level")String level);

    String getWgTypeByWgCode(@Param("wgCode")String wgCode);
}