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.modules.c2c.dao.C2cAdLogDao;
import com.qnfhq.modules.c2c.dto.C2cAdLogDTO;
import com.qnfhq.modules.c2c.entity.C2cAdLogEntity;
import com.qnfhq.modules.c2c.service.C2cAdLogService;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Date;


/**
 * c2c商家广告日志
 *
 * @author yelz 30262728@qq.com
 * @since 1.0.0 2025-11-17
 */
@Service
public class C2cAdLogServiceImpl extends BaseServiceImpl<C2cAdLogDao, C2cAdLogEntity> implements C2cAdLogService {

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


    @Override
    public boolean insertC2cAdLog(Long adId,Long orderId,BigDecimal symbolNum,
                              BigDecimal availableNum,BigDecimal afterAvailNum,
                              BigDecimal beforeMaxAmount,BigDecimal afterMaxAmount,String remark) {
        C2cAdLogEntity c2cAdLogEntity = new C2cAdLogEntity();
        c2cAdLogEntity.setAdId(adId);
        c2cAdLogEntity.setOrderId(orderId);
        c2cAdLogEntity.setSymbolNum(symbolNum);
        c2cAdLogEntity.setBeforeAvailNum(availableNum);
        c2cAdLogEntity.setAfterAvailNum(afterAvailNum);
        c2cAdLogEntity.setBeforeMaxAmount(beforeMaxAmount);
        c2cAdLogEntity.setAfterMaxAmount(afterMaxAmount);
        c2cAdLogEntity.setRemark(remark);
        c2cAdLogEntity.setCreateTime(new Date());
        return insert(c2cAdLogEntity);
    }


}