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.MdeTicketCategory;

@Repository
public class MdeTicketCategoryDao extends BaseDao {
	private Map<String,Object> map = new HashMap<String,Object>();
	public MdeTicketCategory getInfoById(String tcCode) {
        return super.selectOne("MdeTicketCategoryMapper.get", tcCode);
    }
	public List<MdeTicketCategory> accquireTicket(String issuedType, String receiveFlag){
		map.clear();
		map.put("issuedType", issuedType);
		map.put("receiveFlag", receiveFlag);
		return super.select("MdeTicketCategoryMapper.accquireTicket",map);
	}
	public int reduceLeftNum(String tcCode) {
		return sqlSession.update("MdeTicketCategoryMapper.reduceLeftNum",tcCode);
	}
	public MdeTicketCategory getByCode(String tcCode, String lang) {
		map.clear();
		map.put("tcCode", tcCode);
		map.put("lang", lang);
		return super.selectOne("MdeTicketCategoryMapper.getByCode", map);
	}
}
