package com.liquidnet.service.util;

import com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component;

@Component
public class SmileMongoUtils {
    @Autowired
    MongoTemplate mongoTemplate;

    public KylinPerformanceVo getPerFormance(String id){
        return mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(id)),
                KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
    }


}
