package com.caimei.mapper; import com.caimei.model.po.CmPayShopRecordPo; import com.caimei.model.po.UserSearchHistoryPo; import com.caimei.model.vo.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.math.BigDecimal; import java.util.List; /** * Description * * @author : plf * @date : 2021/3/26 */ @Mapper public interface OrderMapper { /** * 查询 * * @param userId * @param orderState * @return */ List findOrderList(@Param("userId") Integer userId, @Param("orderState") Integer orderState); /** * 查询物流详情 * * @param orderId * @return */ List findLogistics(Integer orderId); /** * 查询该主订单下所有子订单 * * @param orderId * @return */ List findAllShopOrder(Integer orderId); /** * 查询子订单下所有商品 * * @param shopOrderId * @return */ List findOrderProduct(Integer shopOrderId); /** * 查询收款记录 * * @param orderId * @return */ List findDiscernReceipt(Integer orderId); /** * 查询订单收货地址 * * @param orderId * @return */ UserInfoVo findUserInfo(Integer orderId); /** * 查询订单信息 * * @param orderId * @return */ OrderVo findOrder(Integer orderId); /** * 查询已退货数量 * * @param shopOrderId * @param productId * @return */ Integer returnedPurchase(@Param("shopOrderId") Integer shopOrderId, @Param("productId") Integer productId); /** * 查询已取消发货数量 * * @param shopOrderId * @param productId * @return */ Integer actualCancelNum(@Param("shopOrderId") Integer shopOrderId, @Param("productId") Integer productId); /** * 查询退款记录 * * @param orderId * @return */ BigDecimal findReturnedPurchase(Integer orderId); /** * 查询批次物流信息 * * @param shopOrderId * @param batchId * @return */ List findLogisticsRecord(@Param("shopOrderId") Integer shopOrderId, @Param("batchId") Long batchId); /** * 物流信息 * * @param batchId * @return */ List findLogisticsInfo(Long batchId); /** * 更新物流状态 * * @param orderId */ void updateLogisticsBatch(Integer orderId); /** * 更新订单状态 * * @param order */ void updateOrderStatus(OrderVo order); /** * 逻辑删除主订单 * * @param orderId */ void deleteOrder(Integer orderId); /** * 逻辑删除子订单 * * @param orderId */ void deleteShopOrder(Integer orderId); /** * 逻辑删除订单收款记录 * * @param orderId */ void deleteReceiptOrderRelation(Integer orderId); /** * 逻辑删除收款记录 * * @param id */ void deleteDiscernReceipt(Integer id); /** * 查询付款记录 * * @param shopOrderId * @return */ List findPayShopRecord(Integer shopOrderId); /** * 逻辑删除子订单付款记录 * * @param shopOrderId */ void deletePayShopRecord(Integer shopOrderId); /** * 逻辑删除付款记录 * * @param payShopId */ void updatePayShop(Integer payShopId); /** * 取消订单 * * @param orderId */ void cancelOrder(Integer orderId); /** * 查询相关商品名称订单 * * @param searchWord * @param userId * @return */ List searchOrder(@Param("searchWord") String searchWord, @Param("userId") Integer userId); /** * 查询组织订单搜索历史记录 * * @param userId * @return */ List getSearchHistoryList(Integer userId); /** * 删除订单搜索历史记录 * * @param userId */ void deleteSearchHistory(Integer userId); /** * 保存订单搜索历史记录 * * @param searchHistoryPo */ void insertHistory(UserSearchHistoryPo searchHistoryPo); /** * 查询订单关键字历史是否存在 * * @param userId * @param searchWord * @return */ Long getHistoryIdByWord(@Param("userId") Integer userId, @Param("searchWord") String searchWord); /** * 更新订单搜索历史记录 * * @param historyRecord */ void updateHistoryById(UserSearchHistoryPo historyRecord); /** * 删除10条以上的记录 * * @param userId */ void deleteHistoryByUserId(Integer userId); /** * 查询订单数量 * * @param userId 用户id * @param status * @return */ Integer findOrderCount(@Param("userId") Integer userId,@Param("status") int status); }