package com.cyl.h5.service;

import com.cyl.manager.ums.domain.PetCare;
import com.cyl.manager.ums.mapper.PetCareMapper;
import com.cyl.manager.ums.service.PetCareService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 宠物服务档案Service业务层处理
 *
 * @author daixiande
 */
@Service
public class H5PetCareService {
    @Autowired
    private PetCareMapper petCareMapper;

    /**
     * 查询宠物服务档案
     *
     * @param id 宠物服务档案主键
     * @return 宠物服务档案
     */
    public PetCare selectPetCareById(Integer id) {
        return petCareMapper.selectById(id);
    }

    /**
     * 查询宠物服务档案列表
     *
     * @param petCare 宠物服务档案
     * @return 宠物服务档案
     */
    public List<PetCare> selectPetCareList(PetCare petCare) {
        return petCareMapper.selectList(petCare);
    }

    /**
     * 新增宠物服务档案
     *
     * @param petCare 宠物服务档案
     * @return 结果
     */
    public int insertPetCare(PetCare petCare) {
        return petCareMapper.insert(petCare);
    }

    /**
     * 修改宠物服务档案
     *
     * @param petCare 宠物服务档案
     * @return 结果
     */
    public int updatePetCare(PetCare petCare) {
        return petCareMapper.update(petCare);
    }

    /**
     * 批量删除宠物服务档案
     *
     * @param ids 需要删除的宠物服务档案主键
     * @return 结果
     */
    public int deletePetCareByIds(Integer[] ids) {
        return petCareMapper.deleteByIds(ids);
    }

    /**
     * 删除宠物服务档案信息
     *
     * @param id 宠物服务档案主键
     * @return 结果
     */
    public int deletePetCareById(Integer id) {
        return petCareMapper.deleteById(id);
    }

    public PetCare selectPetCareByPetId(Integer id) {
        return petCareMapper.selectPetCareByPetId(id);
    }
}
