package com.zhyc.module.base.service;

import com.zhyc.module.base.domain.SheepFile;
import org.springframework.transaction.annotation.Transactional;

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

/**
 * 羊只档案Service接口
 * * @author wyt
 * @date 2025-07-13
 */
public interface ISheepFileService
{
    /**
     * 查询羊只档案
     * * @param id 羊只档案主键
     * @return 羊只档案
     */
    public SheepFile selectSheepFileById(Long id);

    /**
     * 查询羊只档案列表
     * * @param sheepFile 羊只档案
     * @return 羊只档案集合
     */
    public List<SheepFile> selectSheepFileList(SheepFile sheepFile);

    /**
     * 新增：搜索耳号接口
     */
    List<String> searchEarNumbers(String query);

    SheepFile selectBasSheepByManageTags(String trim);

    Long countInGroup();

    List<Map<String,Object>> countBySheepType();
    List<Map<String,Object>> countByBreedStatus();
    List<Map<String,Object>> countByVariety();
    List<Map<String,Object>> countParityOfLactation();

    /**
     * 获取指定字段的唯一值列表
     */
    List<String> getFieldValues(String fieldName);

    /**
     * 根据复杂条件查询羊只档案列表
     * @param params 自定义参数Map (用于动态SQL)
     * @param sheepFile 包含List筛选条件的实体对象
     */
    List<SheepFile> selectSheepFileListByCondition(
            Map<String, Object> params,
            SheepFile sheepFile
    );

    @Transactional
    int insertSheepFile(SheepFile sheepFile);

    @Transactional
    int updateSheepFile(SheepFile sheepFile);
}