/**
 * 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.Pagination;
import com.wechat.global.base.dao.PagingResult;
import com.wechat.global.base.dao.impl.BaseDao;
import com.wechat.model.dbEntity.MdeShowInfo;
import com.wechat.model.dbEntity.MdeTrends;
import com.wechat.model.dto.TrendsDto;
import com.wechat.model.responseDto.MdeShowListResp;

/**
 * 单表生成DAO接口
 * @author jadyn.wu
 * @version 2019-06-04
 */
@Repository
public class MendunerShowDao extends BaseDao {
	
	public int newMdeShow(MdeShowInfo dbEntity) {
		return super.insert("MdeShowInfoMapper.insertSelective", dbEntity);
	}
	
	public int updMdeShow(MdeShowInfo dbEntity) {
		return super.update("MdeShowInfoMapper.updateByPrimaryKeySelective", dbEntity);
	}
	
	public MdeShowInfo getInfoForUpd(String userCode, int showId) {
		Map<String, Object> map = new HashMap<String,Object>();
		map.put("userCode", userCode);
		map.put("showId", showId);
        return super.selectOne("MdeShowInfoMapper.getInfoById", map);
    }
	
	public MdeShowInfo getInfoById(int showId) {
		Map<String, Object> map = new HashMap<String,Object>();
		map.put("showId", showId);
        return super.selectOne("MdeShowInfoMapper.getInfoById", map);
    }
	
	public int delShow(String userCode, int showId) {
		MdeShowInfo dbEntity = new MdeShowInfo();
		dbEntity.setUserCode(userCode);
		dbEntity.setShowId(showId);
        return super.update("MdeShowInfoMapper.delShow", dbEntity);
    }
	
	public List<MdeShowListResp> getShowList(String userCode) {
		Map<String, Object> map = new HashMap<String,Object>();
		map.put("userCode", userCode);
        return super.select("MdeShowInfoMapper.getShowList", map);
    }


}