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

import com.pcloud.book.push.dao.PersonalAppletsDao;
import com.pcloud.book.push.dao.SelfPushDao;
import com.pcloud.book.push.entity.PersonalApplets;
import com.pcloud.book.push.entity.SelfPush;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;

import java.lang.reflect.MalformedParameterizedTypeException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @描述：个人号群发
 * @作者：zhuyajie
 * @创建时间：18:57 2019/11/26
 * @版本：1.0
 */
@Component("personalAppletsDao")
public class PersonalAppletsDaoImpl extends BaseDaoImpl<PersonalApplets> implements PersonalAppletsDao {


    @Override
    public List<PersonalApplets> getAllApplets(String appletsId, String content) {
        Map<String,Object> map=new HashMap<>();
        map.put("appletsId",appletsId);
        map.put("content",content);
        return getSessionTemplate().selectList(getStatement("getAllApplets"),map);
    }

    @Override
    public Map<Long, PersonalApplets> mapByIds(List<Long> list) {
        return this.sqlSessionTemplate.selectMap(getStatement("mapByIds"), list, "id");
    }
}
