package com.qnfhq.modules.c2c.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qnfhq.common.service.impl.BaseServiceImpl;
import com.qnfhq.common.service.impl.CrudServiceImpl;
import com.qnfhq.modules.c2c.dao.C2cPaymentVoucherDao;
import com.qnfhq.modules.c2c.dto.C2cPaymentVoucherDTO;
import com.qnfhq.modules.c2c.entity.C2cPaymentVoucherEntity;
import com.qnfhq.modules.c2c.service.C2cPaymentVoucherService;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Service;

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

/**
 * c2c付款证明
 *
 * @author yelz 30262728@qq.com
 * @since 1.0.0 2025-11-17
 */
@Service
public class C2cPaymentVoucherServiceImpl extends BaseServiceImpl<C2cPaymentVoucherDao, C2cPaymentVoucherEntity> implements C2cPaymentVoucherService {
    private final C2cPaymentVoucherDao c2cPaymentVoucherDao;

    public C2cPaymentVoucherServiceImpl(C2cPaymentVoucherDao c2cPaymentVoucherDao) {
        super();
        this.c2cPaymentVoucherDao = c2cPaymentVoucherDao;
    }

//    @Override
//    public QueryWrapper<C2cPaymentVoucherEntity> getWrapper(Map<String, Object> params){
//        String id = (String)params.get("id");
//
//        QueryWrapper<C2cPaymentVoucherEntity> wrapper = new QueryWrapper<>();
//        wrapper.eq(StrUtil.isNotBlank(id), "id", id);
//
//        return wrapper;
//    }

    @Override
    public List<C2cPaymentVoucherEntity> selectList(Long orderId) {
        return baseDao.selectList(new QueryWrapper<C2cPaymentVoucherEntity>().eq("order_id", orderId)
                .eq("status", 1).orderByDesc("id"));

    }

    @Override
    public List<C2cPaymentVoucherEntity> selectC2cPaymentVoucherByIds(Long[] ids) {
        return c2cPaymentVoucherDao.selectC2cPaymentVoucherByIds(ids);
    }
}