package io.hmit.modules.appointment.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.modules.appointment.dao.CalendarrDao;
import io.hmit.modules.appointment.dto.CalendarrDTO;
import io.hmit.modules.appointment.entity.CalendarrEntity;
import io.hmit.modules.appointment.service.CalendarrService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 新闻管理
 *
 * @author zsh 408538940@qq.com
 * @since 1.0.0 2021-01-26
 */
@Service
public class CalendarrServiceImpl extends CrudServiceImpl<CalendarrDao, CalendarrEntity, CalendarrDTO> implements CalendarrService {

    @Override
    public QueryWrapper<CalendarrEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<CalendarrEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id);


        return wrapper;
    }

    @Override
    public CalendarrEntity selectByDay(String day) {
        CalendarrEntity calendarr= baseDao.selectOne(new QueryWrapper<CalendarrEntity>().like("day",day));
        return calendarr;
    }
}