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.C2cOrderComplainVoucherDao;
import com.qnfhq.modules.c2c.dto.C2cOrderComplainVoucherDTO;
import com.qnfhq.modules.c2c.entity.C2cOrderComplainVoucherEntity;
import com.qnfhq.modules.c2c.service.C2cOrderComplainVoucherService;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Service;

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

/**
 * c2c申诉证明材料
 *
 * @author yelz 30262728@qq.com
 * @since 1.0.0 2025-11-17
 */
@Service
public class C2cOrderComplainVoucherServiceImpl extends BaseServiceImpl<C2cOrderComplainVoucherDao, C2cOrderComplainVoucherEntity> implements C2cOrderComplainVoucherService {

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

    @Override
    public List<C2cOrderComplainVoucherEntity> selectList(Long complainId) {
        return baseDao.selectList(new QueryWrapper<C2cOrderComplainVoucherEntity>()
                .eq(Objects.nonNull(complainId),"complain_id", complainId)
                .eq("status", 1)
                .orderByDesc("id")
        );
    }
}