package com.huimv.management.service.impl;

import com.huimv.management.entity.HealthIsolationRecordEntity;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huimv.common.utils.PageUtils;
import com.huimv.common.utils.Query;

import com.huimv.management.dao.HealthMedicalRecordDao;
import com.huimv.management.entity.HealthMedicalRecordEntity;
import com.huimv.management.service.HealthMedicalRecordService;


@Service("healthMedicalRecordService")
public class HealthMedicalRecordServiceImpl extends ServiceImpl<HealthMedicalRecordDao, HealthMedicalRecordEntity> implements HealthMedicalRecordService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {

        //根据牧场查询
        String farmId = (String) params.get("farmId");

        QueryWrapper<HealthMedicalRecordEntity> wrapper = new QueryWrapper<HealthMedicalRecordEntity>();
        wrapper.eq(StringUtils.isNotBlank(farmId),"farm_id",farmId);
        IPage<HealthMedicalRecordEntity> page = this.page(
                new Query<HealthMedicalRecordEntity>().getPage(params),
                wrapper
        );

        return new PageUtils(page);
    }

}