package com.fjs.scenic.mapper.order;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.fjs.scenic.dto.OrderDetailModel;
import com.fjs.scenic.dto.OrdersDto;
import com.fjs.scenic.entity.order.OrderNum;
import com.fjs.scenic.entity.order.Orders;
import org.apache.ibatis.annotations.Param;

/**
 * 订单
 * @author Administrator
 *
 */
public interface OrdersMapper {

    public int insert(Orders record);
    
    public int insertSelective(Orders record);

	public List<Orders> select(Orders record);

	public int update(Orders record);

	public void delete(Orders record);

	public List<Orders> selectByParam(Map<String, String> param);

	public void updateByParam(Map<String, String> params);

	public void deleteByParam(Map<String, String> params);
	
	public List<Orders> selectByJoin(Map<String, String> param);

	public List<Orders> selectByStatus(@Param("userId")Integer userId,@Param("type")String type);

	public OrderDetailModel selectOrderDetail(@Param("id")Integer id,@Param("userID")Integer userID);

	public int updateByPrimaryKeySelective(Orders record);

	public Orders selectByPrimaryKey(Integer id);

	public int deleteByPrimaryKey(Integer id);
	
	public List<OrderNum> selectByCount(Map<String, String> params);

	/**根据订单号查询订单*/
	public Orders getOrderByOrderNo(@Param("orderNo")String orderNo);
	
	/**根据cyt订单号查询订单*/
	public Orders getCytOrderByOrderNo(@Param("cytOrderNo")String cytOrderNo);
	
	/**删除过期的订单*/
	public void deleteExpireOrder(@Param("orderTime")Date orderTime);
	
	public void updateOrderByCancel();
	
	/**查询订单列表*/
	public List<Map<String, String>> selectByOption(OrdersDto orders);
	
	/***跟新未使用的订单为已过期*/
	void updateOrderByExpire();

    Orders selectByOrderNo(@Param("orderNo") String orderNo);

	/**
	 * 根据条件查询id集合（分页）
	 * @param orders
	 * @return
	 */
	List<String> selectIdsPage(OrdersDto orders);

	/**
	 * 通过id集合获取订单信息
	 * @param ids
	 * @return
	 */
	List<Map<String,Object>> selectByIds(List<String> ids);
	
	List<Orders> select30MinuteOrder();
	
	Map<String, String> getPhoneByOrdersNo(@Param("ordersNo")String ordersNo);
}