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

import java.util.Date;
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.MdeGoods;
import com.wechat.model.dto.GoodsDetailDto;
import com.wechat.model.dto.GoodsListDto;
import com.wechat.model.dto.UpTimeGroupDto;

/**
 * 单表生成DAO接口
 * @author jadyn.wu
 * @version 2019-08-28
 */
@Repository
public class MdeGoodsDao extends BaseDao {
	
	/**
	 *  获取上架时间分类
	 * 
	 * @return
	 */
	public List<UpTimeGroupDto> getUpTimeGroup() {
        return super.select("MdeGoodsMapper.getUpTimeGroup");
    }
	
	/**
	 *  根据指定时间获取显示的上架时间
	 * @return
	 */
	public UpTimeGroupDto getUpTimeShow(Date date) {
        return super.selectOne("MdeGoodsMapper.getUpTimeShow", date);
    }
	
	/**
	 *  根据上架时间获取商品列表
	 * @return
	 */
	public List<GoodsListDto> getGoodsListByUpTime(Map<String,Object> map) {
        return super.select("MdeGoodsMapper.getGoodsListByUpTime", map);
    }

	/**
	 *  获取商品详情
	 * @return
	 */
	public GoodsDetailDto getGoodsDetail(int goodsId, String lang) {
		Map<String,Object> map =new HashMap<String,Object>();
		map.put("goodsId", goodsId);
		map.put("lang", lang);
        return super.selectOne("MdeGoodsMapper.getGoodsDetail", map);
    }
	
	/**
	 *  获取全部商品详情
	 * @return
	 */
	public MdeGoods getGoodsAllInfo(int goodsId) {
		Map<String,Object> map =new HashMap<String,Object>();
		map.put("goodsId", goodsId);
        return super.selectOne("MdeGoodsMapper.getGoodsAllInfo", map);
    }

}