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

import com.pcloud.book.applet.dao.AppletLinkClickDao;
import com.pcloud.book.applet.dto.PvuvDTO;
import com.pcloud.book.applet.entity.AppletLinkClick;
import com.pcloud.common.core.dao.BaseDaoImpl;

import org.springframework.stereotype.Component;

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

/**
 * @ClassName com.pcloud.book.applet.dao.impl.AppletLinkClickDaoImpl
 * @Author zhuyajie
 * @Description
 * @Date 2020/5/11 13:56
 * @Version 1.0
 **/
@Component
public class AppletLinkClickDaoImpl extends BaseDaoImpl<AppletLinkClick> implements AppletLinkClickDao {

    @Override
    public Map<Long, PvuvDTO> mapPVUV(Integer typeId, Integer recordType, List<Long> fromIds) {
        Map<String,Object> map = new HashMap<>();
        map.put("list",fromIds);
        map.put("recordType",recordType);
        map.put("typeId",typeId);
        return getSessionTemplate().selectMap(getStatement("mapPVUV"),map,"fromId");
    }

    @Override
    public Map<Long, PvuvDTO> mapCouponUseCount(List<Long> fromIds) {
        Map<String,Object> map = new HashMap<>();
        map.put("list",fromIds);
        return getSessionTemplate().selectMap(getStatement("mapCouponUseCount"),map,"fromId");
    }
}
