package com.zhyc.module.base.mapper;

import java.util.List;
import java.util.Map;

import com.zhyc.module.base.domain.BasSheepGroupMapping;
import com.zhyc.module.base.domain.BasGroupTreeVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * 羊只分组关联Mapper接口
 * 
 * @author wyt
 * @date 2025-07-16
 */
@Mapper
public interface BasSheepGroupMappingMapper 
{
    /**
     * 查询羊只分组关联
     * 
     * @param id 羊只分组关联主键
     * @return 羊只分组关联
     */
    public BasSheepGroupMapping selectBasSheepGroupMappingById(Long id);

    /**
     * 查询羊只分组关联列表
     * 
     * @param basSheepGroupMapping 羊只分组关联
     * @return 羊只分组关联集合
     */
    public List<BasSheepGroupMapping> selectBasSheepGroupMappingList(BasSheepGroupMapping basSheepGroupMapping);


    /**
     * 联表查询羊只分组关联列表（支持耳号列表）
     */
    List<Map<String, Object>> selectBasSheepGroupMappingList(
            @Param("sheepId")      Long sheepId,
            @Param("groupId")      Long groupId,
            @Param("bsManageTags") List<String> bsManageTags
    );





    /**
     * 新增羊只分组关联
     * 
     * @param basSheepGroupMapping 羊只分组关联
     * @return 结果
     */
    public int insertBasSheepGroupMapping(BasSheepGroupMapping basSheepGroupMapping);

    /**
     * 修改羊只分组关联
     * 
     * @param basSheepGroupMapping 羊只分组关联
     * @return 结果
     */
    public int updateBasSheepGroupMapping(BasSheepGroupMapping basSheepGroupMapping);

    /**
     * 删除羊只分组关联
     * 
     * @param id 羊只分组关联主键
     * @return 结果
     */
    public int deleteBasSheepGroupMappingById(Long id);

    /**
     * 批量删除羊只分组关联
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteBasSheepGroupMappingByIds(Long[] ids);


    List<Map<String, Object>> selectSheepIdsByEarTags(@Param("earTags") List<String> earTags);

    int batchInsert(@Param("list") List<BasSheepGroupMapping> list);


    List<BasSheepGroupMapping> selectListByGroupId(@Param("groupId") Long groupId);

    List<BasGroupTreeVo> selectGroupTree();

}
