/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.wechat.dao;

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

import org.springframework.stereotype.Repository;

import com.wechat.global.base.dao.impl.BaseDao;
import com.wechat.model.dbEntity.MdeInformation;

/**
 * 单表生成DAO接口
 * @author tangwc
 * @version 2018-05-23
 */
@Repository
public class MdeInformationDao extends BaseDao {
	
	public MdeInformation getInfoById(int id) {
        return super.selectOne("MdeInformationMapper.get", id);
    }
	/**
	 * 根据type获取资讯
	 * @param limi
	 * @return
	 */
	public List<MdeInformation> hotInformations(String type,Integer index) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("type", type);
		map.put("index", index);
		return super.select("MdeInformationMapper.hotInformations", map);
	}
	
	/**
	 * 根据type获取资讯
	 * @param limi
	 * @return
	 */
	public List<MdeInformation> allHotInformations(String type) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("type", type);
		return super.select("MdeInformationMapper.allHotInformations", map);
	}
	
	/**
	 * 根据 type和userCode 获取资讯
	 * @param type
	 * @param userCode
	 * @return
	 */
	public List<MdeInformation> hotInformations(String type, String userCode,Integer index) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("type", type);
		map.put("userCode", userCode);
		map.put("index", index);
		return super.select("MdeInformationMapper.hotInformationsByTypeAndUserCode", map);
	}
	public List<MdeInformation> getInformationsById(String infoId) {
		return super.select("MdeInformationMapper.getInformationsById", infoId);
	}
}