package com.ruoyi.ibs.draw.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.ibs.draw.domain.entity.DrawGridShapeRelate;
import com.ruoyi.ibs.grid.domain.entity.RegionCustUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author 吴凯程
 * @Date 2024/12/20
 **/
@Mapper
public interface DrawGridShapeRelateMapper extends BaseMapper<DrawGridShapeRelate> {

    /**
     * 根据网格ID查询关联的图形（用于异步导入客群，原生SQL绕过拦截器）
     * @param gridId 网格ID
     * @return 图形关联列表
     */
    List<DrawGridShapeRelate> selectByGridId(@Param("gridId") Long gridId);

    /**
     * 根据绘制网格ID查询所有客户（用于客群导入，直接拼接headId绕过拦截器）
     */
    List<RegionCustUser> selectCustByDrawGridId(@Param("gridId") Long gridId, @Param("headId") String headId);
}
