package com.zhyc.module.produce.breed.service.impl;

import java.util.List;
import com.zhyc.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhyc.module.produce.breed.mapper.ScDryMilkMapper;
import com.zhyc.module.produce.breed.domain.ScDryMilk;
import com.zhyc.module.produce.breed.service.IScDryMilkService;

/**
 * 干奶记录Service业务层处理
 * * @author ruoyi
 * @date 2025-07-15
 */
@Service
public class ScDryMilkServiceImpl implements IScDryMilkService
{
    @Autowired
    private ScDryMilkMapper scDryMilkMapper;

    /**
     * 查询干奶记录
     * * @param id 干奶记录主键
     * @return 干奶记录
     */
    @Override
    public ScDryMilk selectScDryMilkById(Long id)
    {
        return scDryMilkMapper.selectScDryMilkById(id);
    }

    /**
     * 查询干奶记录列表
     * * @param scDryMilk 干奶记录
     * @return 干奶记录
     */
    @Override
    public List<ScDryMilk> selectScDryMilkList(ScDryMilk scDryMilk)
    {
        return scDryMilkMapper.selectScDryMilkList(scDryMilk);
    }

    /**
     * 新增干奶记录
     * * @param scDryMilk 干奶记录
     * @return 结果
     */
    @Override
    public int insertScDryMilk(ScDryMilk scDryMilk)
    {
        scDryMilk.setCreateTime(DateUtils.getNowDate());
        return scDryMilkMapper.insertScDryMilk(scDryMilk);
    }

    /**
     * 修改干奶记录
     * * @param scDryMilk 干奶记录
     * @return 结果
     */
    @Override
    public int updateScDryMilk(ScDryMilk scDryMilk)
    {
        return scDryMilkMapper.updateScDryMilk(scDryMilk);
    }

    /**
     * 批量删除干奶记录
     * * @param ids 需要删除的干奶记录主键
     * @return 结果
     */
    @Override
    public int deleteScDryMilkByIds(Long[] ids)
    {
        String[] strIds = new String[ids.length];
        for(int i=0; i<ids.length; i++){
            strIds[i] = String.valueOf(ids[i]);
        }
        return scDryMilkMapper.deleteScDryMilkByIds(strIds);
    }

    /**
     * 删除干奶记录信息
     * * @param id 干奶记录主键
     * @return 结果
     */
    @Override
    public int deleteScDryMilkById(Long id)
    {
        return scDryMilkMapper.deleteScDryMilkById(id);
    }

    @Override
    public Long selectSheepIdByManageTags(String manageTags) {
        return scDryMilkMapper.selectSheepIdByManageTags(manageTags);
    }

    @Override
    public List<String> selectSheepEarNumberList(String query) {
        return scDryMilkMapper.selectSheepEarNumberList(query);
    }

    @Override
    public List<String> selectTechnicianList(String query) {
        return scDryMilkMapper.searchTechnicianList(query);
    }
}