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

import com.pcloud.book.cultivate.dao.CultivateRaysRecordDao;
import com.pcloud.book.cultivate.entity.CultivateRaysRecord;
import com.pcloud.common.core.dao.BaseDaoImpl;

import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName com.pcloud.book.cultivate.dao.impl.CultivateRaysRecordDaoImpl
 * @Author zhuyajie
 * @Description 记录
 * @Date 2021/7/16 13:58
 * @Version 1.0
 **/
@Component
public class CultivateRaysRecordDaoImpl extends BaseDaoImpl<CultivateRaysRecord> implements CultivateRaysRecordDao {
    @Override
    public CultivateRaysRecord getLastRecord(Long cultivateId, Integer changeType) {
        Map<String,Object> map = new HashMap<>();
        map.put("cultivateId", cultivateId);
        map.put("changeType", changeType);
        return getSessionTemplate().selectOne(getStatement("getLastRecord"), map);
    }
}
