package com.ruoyi.model.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.AppletOrderMapper;
import com.ruoyi.model.domain.AppletOrder;
import com.ruoyi.model.service.IAppletOrderService;

/**
 * 订单信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-28
 */
@Service
public class AppletOrderServiceImpl implements IAppletOrderService 
{
    @Autowired
    private AppletOrderMapper appletOrderMapper;

    /**
     * 查询订单信息
     * 
     * @param id 订单信息主键
     * @return 订单信息
     */
    @Override
    public AppletOrder selectAppletOrderById(Long id)
    {
        return appletOrderMapper.selectAppletOrderById(id);
    }


    @Override
    public AppletOrder selectAppletOrderByOrderId(Long orderId){
        return appletOrderMapper.selectAppletOrderByOrderId(orderId);
    }

    /**
     * 查询订单信息列表
     * 
     * @param appletOrder 订单信息
     * @return 订单信息
     */
    @Override
    public List<AppletOrder> selectAppletOrderList(AppletOrder appletOrder)
    {
        return appletOrderMapper.selectAppletOrderList(appletOrder);
    }


    @Override
    public List<AppletOrder> selectAppletOrderListLikeUserIdJson(AppletOrder appletOrder){
        return appletOrderMapper.selectAppletOrderListLikeUserIdJson(appletOrder);
    }
    /**
     * 新增订单信息
     * 
     * @param appletOrder 订单信息
     * @return 结果
     */
    @Override
    public int insertAppletOrder(AppletOrder appletOrder)
    {
//        appletOrder.setCreateTime(new Date());
        return appletOrderMapper.insertAppletOrder(appletOrder);
    }

    /**
     * 修改订单信息
     * 
     * @param appletOrder 订单信息
     * @return 结果
     */
    @Override
    public int updateAppletOrder(AppletOrder appletOrder)
    {
//        appletOrder.setUpdateTime(DateUtils.getNowDate());
        return appletOrderMapper.updateAppletOrder(appletOrder);
    }

    /**
     * 批量删除订单信息
     * 
     * @param ids 需要删除的订单信息主键
     * @return 结果
     */
    @Override
    public int deleteAppletOrderByIds(Long[] ids)
    {
        return appletOrderMapper.deleteAppletOrderByIds(ids);
    }

    /**
     * 删除订单信息信息
     * 
     * @param id 订单信息主键
     * @return 结果
     */
    @Override
    public int deleteAppletOrderById(Long id)
    {
        return appletOrderMapper.deleteAppletOrderById(id);
    }
}
