package com.bonus.canteen.core.account.v3.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bonus.canteen.core.account.v3.mapper.AccPayFrozenDetailMapper;
import com.bonus.canteen.core.account.v3.model.AccPayFrozenDetail;
import com.bonus.canteen.core.account.v3.po.AccPayFrozenDetailPO;
import com.bonus.canteen.core.account.v3.service.AccPayFrozenDetailService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.lang.invoke.SerializedLambda;
import java.util.List;

@Service
public class AccPayFrozenDetailServiceImpl extends ServiceImpl<AccPayFrozenDetailMapper, AccPayFrozenDetail> implements AccPayFrozenDetailService {
   private static final Logger log = LoggerFactory.getLogger(AccPayFrozenDetailServiceImpl.class);

   public void insertAccPayFrozenDetail(AccPayFrozenDetailPO accPayFrozenDetailPO) {
      AccPayFrozenDetail accPayFrozenDetail = new AccPayFrozenDetail();
      BeanUtil.copyProperties(accPayFrozenDetailPO, accPayFrozenDetail, new String[0]);
      ((AccPayFrozenDetailMapper)this.baseMapper).insert(accPayFrozenDetail);
   }

   public List<AccPayFrozenDetail> queryAccPayFrozenDetailByOrderId(Long orderId) {
      return ((AccPayFrozenDetailMapper)this.baseMapper).selectList((Wrapper)Wrappers.lambdaQuery(AccPayFrozenDetail.class).eq(AccPayFrozenDetail::getOrdId, orderId));
   }

   public void deleteFrozenDetailByOrderId(Long orderId) {
      ((AccPayFrozenDetailMapper)this.baseMapper).delete((Wrapper)Wrappers.lambdaQuery(AccPayFrozenDetail.class).eq(AccPayFrozenDetail::getOrdId, orderId));
   }
}
