package com.pcloud.book.cultivate.dao.impl;

import com.pcloud.book.cultivate.dao.CultivateDao;
import com.pcloud.book.cultivate.entity.Cultivate;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;

import java.util.List;

@Component("cultivateDao")
public class CultivateDaoImpl extends BaseDaoImpl<Cultivate> implements CultivateDao {
    @Override
    public Cultivate getByWechatUserId(Long wechatUserId) {
        return  super.getSqlSession().selectOne(getStatement("getByWechatUserId"),wechatUserId);
    }

    @Override
    public List<Cultivate> getAllOrderByStar() {
        return getSessionTemplate().selectList(getStatement("getAllOrderByStar"));
    }
}
