package io.hmit.modules.serviceOrder.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.hmit.common.dao.BaseDao;
import io.hmit.common.page.PageData;
import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
import io.hmit.modules.serviceOrder.entity.PensionOrderEntity;
import org.apache.ibatis.annotations.Mapper;

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

/**
 * 订单表
 *
 * @author zsh 408538940@qq.com
 * @since 1.0.0 2021-01-26
 */
@Mapper
public interface PensionOrderDao extends BaseDao<PensionOrderEntity> {

    /**
     * 志愿者：今日订单接单接口
     * @param page
     * @return
     */
    IPage<PensionOrderDTO> getTodayNoProceedOrderPage(IPage<PensionOrderEntity> page);

    PensionOrderEntity getOrderInfoByIdAndStatus(Long orderId, Integer status);

    IPage<PensionOrderDTO> getOrderPageByStatusOrUserId(IPage<PensionOrderEntity> page, Long userId, Integer status);

    PensionOrderDTO getOrderInfoByIdAndUserIdOrStatus(Long orderId, Long userId, Integer status);

    /**
     * 老人：今日订单
     * @param page
     * @param creator
     * @return
     */
    IPage<PensionOrderDTO> getElderTodayOrderPage(IPage<PensionOrderEntity> page, Long creator);

    /**
     * 老人：全部订单
     * @param params
     * @param creator
     * @return
     */
    List<PensionOrderDTO> getElderAllOrderOrByStatusList(Map<String, Object> params, Long creator, Integer status);

    /**
     * 社工：查询本社区全部订单（根据社区人员id查询所属社区内全部订单）
     * @param page
     * @param userId
     * @return
     */
    IPage<PensionOrderDTO> getAllOrderByCommunityUserIdPage(IPage<PensionOrderEntity> page, Long userId);

    /**
     * 社工：查询本社区某老人全部订单
     * @param page
     * @param userId
     * @return
     */
    IPage<PensionOrderDTO> getElderAllOrderByCommunityUserIdPage(IPage<PensionOrderEntity> page, Long userId, String appointmentPerson);

    /**
     * 根据服务Id查询订单
     * @param serviceId
     * @return
     */
    List<PensionOrderDTO> getAllOrderByServiceId(Long serviceId, Integer status);

}
