package com.ruoyi.web.modules.industryservice.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.web.modules.industryservice.domain.BizYakHerdInventory;

/**
 * 牦牛存栏数据填报 Mapper
 */
public interface BizYakHerdInventoryMapper
{
    BizYakHerdInventory selectBizYakHerdInventoryById(Long id);

    BizYakHerdInventory selectByYearMonthAndTown(@Param("statYear") Integer statYear,
            @Param("statMonth") Integer statMonth, @Param("townDeptId") Long townDeptId);

    BizYakHerdInventory selectByYearMonthAndVillage(@Param("statYear") Integer statYear,
            @Param("statMonth") Integer statMonth, @Param("villageDeptId") Long villageDeptId);

    int countByYearMonthAndTownExcludeId(@Param("statYear") Integer statYear,
            @Param("statMonth") Integer statMonth, @Param("townDeptId") Long townDeptId,
            @Param("excludeId") Long excludeId);

    int countByYearMonthAndVillageExcludeId(@Param("statYear") Integer statYear,
            @Param("statMonth") Integer statMonth, @Param("villageDeptId") Long villageDeptId,
            @Param("excludeId") Long excludeId);

    List<BizYakHerdInventory> selectBizYakHerdInventoryList(BizYakHerdInventory query);

    int insertBizYakHerdInventory(BizYakHerdInventory row);

    int updateBizYakHerdInventory(BizYakHerdInventory row);

    int deleteBizYakHerdInventoryByIds(@Param("ids") Long[] ids);

    /** 按填报年月全量删除（保留；当前导入已改为 upsert，一般不调用） */
    int deleteByYearMonth(@Param("statYear") Integer statYear, @Param("statMonth") Integer statMonth);
}
