package com.palmnest.dao.washcar;

import com.palmnest.application.bean.Page;
import com.palmnest.application.dto.input.WashCarOrderDto;
import com.palmnest.dao.GenericDao;
import com.palmnest.model.washcar.WashCarOrder;

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

/**
 * 洗车订单
 *
 * @author longmeizhen
 */
public interface WashCarOrderDao extends GenericDao<WashCarOrder, Long> {
	/**
	 * 获取订单列表
	 *
	 * @param dto
	 * @param pageNo
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public Page findSearch(WashCarOrderDto dto, int pageNo, int pageSize) throws Exception;

	/**
	 * 获取洗车小哥或者获取洗车主管，根据syscode所传值来区分
	 *
	 * @param syscode
	 * @return
	 * @throws Exception
	 */
	public List<Map<String, Object>> getWashCaeService(String orgId, String syscode) throws Exception;

	/**
	 * 判断该用户是否有该权限
	 *
	 * @param syscode
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public String isPower(String syscode, String userId) throws Exception;

	/**
	 * 获取洗车小哥名下的订单
	 *
	 * @param carWashId
	 * @param status
	 * @param type
	 * @return
	 * @throws Exception
	 */
	public List<WashCarOrder> getWashOrderByCarWasherId(String carWashId, String status, Integer type) throws Exception;

	/**
	 * 获取当天的剩余名额
	 *
	 * @param userId 洗车的用户
	 * @param status 单据状态   status格式('1','2')
	 * @param type   1代表in 2代表not in
	 * @return
	 * @throws Exception
	 */
	public List<WashCarOrder> getWashListByDas(String userId, String status, int type) throws Exception;

	/**
	 * 获取洗车人为carWashId的未取钥匙的订单
	 *
	 * @param carWashId
	 * @return
	 */
	public int getWashByUserId(String carWashId, String orgId);

	/**
	 * 获取排队中的单据
	 *
	 * @return
	 */
	public int getWashByManager(String orgId);

}
