package com.kidgrow.oprationcenter.service.impl;

import org.springframework.stereotype.Service;
import com.kidgrow.common.model.PageResult;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kidgrow.common.service.impl.SuperServiceImpl;

import java.util.List;
import java.util.Map;
import org.apache.commons.collections4.MapUtils;
import lombok.extern.slf4j.Slf4j;

import com.kidgrow.oprationcenter.model.DoctorServer;
import com.kidgrow.oprationcenter.mapper.DoctorServerMapper;
import com.kidgrow.oprationcenter.service.IDoctorServerService;

/**
 * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br>
 * @Description: 医生业务服务信息表<br>
 * @Project: 用户中心<br>
 * @CreateDate: Created in 2020-04-01 09:37:05 <br>
 * @Author: <a href="4345453@kidgrow.com">liuke</a>
 * @version 1.0
 */
@Slf4j
@Service
public class DoctorServerServiceImpl extends SuperServiceImpl<DoctorServerMapper, DoctorServer> implements IDoctorServerService {
    /**
     * 列表
     * @param params
     * @return
     */
    @Override
    public PageResult<DoctorServer> findList(Map<String, Object> params){
        Page<DoctorServer> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit"));
        List<DoctorServer> list  =  baseMapper.findList(page, params);
        return PageResult.<DoctorServer>builder().data(list).code(0).count(page.getTotal()).build();
    }

    /**
   * 根据DoctorServer对象当做查询条件进行查询
   * @param doctorServer
   * @return DoctorServer
   */
    @Override
    public DoctorServer findByObject(DoctorServer doctorServer){
        return baseMapper.findByObject(doctorServer);
    }
}