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

import com.pcloud.book.pcloudKeyword.dto.RobotClassifyDTO;
import com.pcloud.book.pcloudkeyword.dao.PcloudRobotDao;
import com.pcloud.book.pcloudkeyword.dao.PcloudRobotMemoGroupDao;
import com.pcloud.book.pcloudkeyword.entity.PcloudRobot;
import com.pcloud.book.pcloudkeyword.entity.PcloudRobotMemoGroup;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;

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

@Component("pcloudRobotMemoGroupDao")
public class PcloudRobotMemoGroupDaoImpl extends BaseDaoImpl<PcloudRobotMemoGroup> implements PcloudRobotMemoGroupDao {


    @Override
    public List<PcloudRobotMemoGroup> getAllGroup() {
        return this.getSessionTemplate().selectList(this.getStatement("getAllGroup"));
    }

    @Override
    public void updateById(PcloudRobotMemoGroup pcloudRobotMemoGroup) {
        Map<String, Object> paramMap = new HashMap<>();
        paramMap.put("id", pcloudRobotMemoGroup.getId());
        paramMap.put("groupName", pcloudRobotMemoGroup.getGroupName());
        this.getSqlSession().update(this.getStatement("updateById"), paramMap);
    }
}
