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.C2cMerchantConfigDao;
import com.qnfhq.modules.c2c.dto.C2cMerchantConfigDTO;
import com.qnfhq.modules.c2c.entity.C2cMerchantConfigEntity;
import com.qnfhq.modules.c2c.service.C2cMerchantConfigService;
import cn.hutool.core.util.StrUtil;
import com.qnfhq.modules.user.entity.AppUserEntity;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * C2C认证商家配置表
 *
 * @author yelz 30262728@qq.com
 * @since 1.0.0 2025-11-17
 */
@Service
public class C2cMerchantConfigServiceImpl extends BaseServiceImpl<C2cMerchantConfigDao, C2cMerchantConfigEntity> implements C2cMerchantConfigService {

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

    @Override
    public C2cMerchantConfigEntity getMerchantConfig(String legalCoin) {
        return baseDao.selectOne(new LambdaQueryWrapper<C2cMerchantConfigEntity>()
                .eq(C2cMerchantConfigEntity::getLegalCoin, legalCoin)
                .last(" limit 1")
        );
    }

}