package com.huimv.management.service.impl;

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.HealthIsolationRecordDao;
import com.huimv.management.entity.HealthIsolationRecordEntity;
import com.huimv.management.service.HealthIsolationRecordService;


@Service("healthIsolationRecordService")
public class HealthIsolationRecordServiceImpl extends ServiceImpl<HealthIsolationRecordDao, HealthIsolationRecordEntity> implements HealthIsolationRecordService {

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

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

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

        return new PageUtils(page);
    }

}