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

import com.pcloud.book.push.dao.SelfPushDao;
import com.pcloud.book.push.entity.SelfPush;
import com.pcloud.common.core.dao.BaseDaoImpl;

import org.springframework.stereotype.Component;

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

/**
 * @描述：个人号群发
 * @作者：zhuyajie
 * @创建时间：18:57 2019/11/26
 * @版本：1.0
 */
@Component("selfPushDao")
public class SelfPushDaoImpl extends BaseDaoImpl<SelfPush> implements SelfPushDao {
    @Override
    public List<SelfPush> getUnclosedByRobot(String altId) {
        return getSessionTemplate().selectList(getStatement("getUnclosedByRobot"), altId);
    }

    @Override
    public void updatePushStatusById(Integer pushStatus, Long id) {
        Map<String, Object> map = new HashMap<>();
        map.put("pushStatus", pushStatus);
        map.put("id", id);
        getSessionTemplate().update(getStatement("updatePushStatusById"), map);
    }
}
