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.DoctorAnswer;
import com.kidgrow.oprationcenter.mapper.DoctorAnswerMapper;
import com.kidgrow.oprationcenter.service.IDoctorAnswerService;

/**
 * 石家庄喜高科技有限责任公司 版权所有 © 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 DoctorAnswerServiceImpl extends SuperServiceImpl<DoctorAnswerMapper, DoctorAnswer> implements IDoctorAnswerService {
    /**
     * 列表
     * @param params
     * @return
     */
    @Override
    public PageResult<DoctorAnswer> findList(Map<String, Object> params){
        Page<DoctorAnswer> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit"));
        List<DoctorAnswer> list  =  baseMapper.findList(page, params);
        return PageResult.<DoctorAnswer>builder().data(list).code(0).count(page.getTotal()).build();
    }

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