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

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.C2cOrderComplainDao;
import com.qnfhq.modules.c2c.dto.C2cOrderComplainDTO;
import com.qnfhq.modules.c2c.entity.C2cOrderComplainEntity;
import com.qnfhq.modules.c2c.service.C2cOrderComplainService;
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 C2cOrderComplainServiceImpl extends BaseServiceImpl<C2cOrderComplainDao, C2cOrderComplainEntity> implements C2cOrderComplainService {

//    @Override
//    public QueryWrapper<C2cOrderComplainEntity> getWrapper(Map<String, Object> params){
//        String id = (String)params.get("id");
//
//        QueryWrapper<C2cOrderComplainEntity> wrapper = new QueryWrapper<>();
//        wrapper.eq(StrUtil.isNotBlank(id), "id", id);
//
//        return wrapper;
//    }
    @Override
    public List<C2cOrderComplainEntity> selectC2cOrderComplainList(Long orderId) {
        return baseDao.selectList(new LambdaQueryWrapper<C2cOrderComplainEntity>()
                .eq(Objects.nonNull(orderId),C2cOrderComplainEntity::getOrderId, orderId)
                .orderByDesc(C2cOrderComplainEntity::getId)
            );
    }

}