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.C2cPayWayDao;
import com.qnfhq.modules.c2c.dto.C2cPayWayDTO;
import com.qnfhq.modules.c2c.entity.C2cLegalCoinEntity;
import com.qnfhq.modules.c2c.entity.C2cPayWayEntity;
import com.qnfhq.modules.c2c.service.C2cPayWayService;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Service;

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

/**
 * 法币支付方式
 *
 * @author yelz 30262728@qq.com
 * @since 1.0.0 2025-11-18
 */
@Service
public class C2cPayWayServiceImpl extends BaseServiceImpl<C2cPayWayDao, C2cPayWayEntity> implements C2cPayWayService {

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

    @Override
    public List<C2cPayWayEntity> selectListByLegalCoin(String legalCoin) {
        return baseDao.selectList(new LambdaQueryWrapper<C2cPayWayEntity>()
                .eq(StrUtil.isNotBlank(legalCoin), C2cPayWayEntity::getCurrencyCode, legalCoin)
                .eq(C2cPayWayEntity::getStatus,1)
        );
    }

}