package com.ruoyi.liandao.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.query.LambdaQueryWrapperX;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.liandao.domain.TicketCheck;
import com.ruoyi.liandao.service.TicketCheckService;
import com.ruoyi.liandao.mapper.TicketCheckMapper;
import org.springframework.stereotype.Service;

/**
* @author admin
* @description 针对表【TICKET_CHECK】的数据库操作Service实现
* @createDate 2024-04-08 16:22:33
*/
@Service
@DataSource(DataSourceType.SLAVE)
public class TicketCheckServiceImpl extends ServiceImpl<TicketCheckMapper, TicketCheck>
    implements TicketCheckService{

    @Override
    public Long getTheRealTimeNumberOfVisitors() {
        return count(new LambdaQueryWrapperX<TicketCheck>()
                .eq(TicketCheck::getAdmissiondate, DateUtils.getDate())
                .eq(TicketCheck::getIsOut, "入园"));
    }
}




