package com.ruoyi.system.mapper.grid;

import com.ruoyi.system.domain.grid.GridRegionUser;
import com.ruoyi.system.domain.grid.GridRegionUserExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GridRegionUserMapper {

    long countByExample(GridRegionUserExample example);

    int deleteByExample(GridRegionUserExample example);

    int deleteByPrimaryKey(String id);

    int insert(GridRegionUser record);

    int insertSelective(GridRegionUser record);

    List<GridRegionUser> selectByExample(GridRegionUserExample example);

    GridRegionUser selectByPrimaryKey(String id);

    int updateByExampleSelective(@Param("record") GridRegionUser record, @Param("example") GridRegionUserExample example);

    int updateByExample(@Param("record") GridRegionUser record, @Param("example") GridRegionUserExample example);

    int updateByPrimaryKeySelective(GridRegionUser record);

    int updateByPrimaryKey(GridRegionUser record);

    //一级网格
    List<GridRegionUser> selectOneGridUserByWgCode(@Param("wgCode") String wgCode);

    //二级网格长
    List<GridRegionUser> selectTwoGridUserByWgCode(@Param("wgCode") String wgCode);

    //三级网格长
    List<GridRegionUser> selectThreeGirdUserByWgCode(@Param("wgCode") String wgCode);

    /**
     * 查找2，3级网格员
     * @param wgCode
     * @return
     */
    List<GridRegionUser> selectChildGirdUserByWgCode(@Param("wgCode") String wgCode);

    List<GridRegionUser> selectParentGirdUserByWgCode(@Param("wgCode") String wgCode);

    List<GridRegionUser> selectRandom(@Param("userNum") int userNum);

    void batchUpdateStatus(@Param("userId") String userId, @Param("status") String status);

}
