package com.chinaweal.aiccs.aiccs.temp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.chinaweal.aiccs.aiccs.temp.entity.TemporarySave;
import com.chinaweal.aiccs.aiccs.temp.mapper.TemporarySaveMapper;
import com.chinaweal.aiccs.aiccs.temp.service.TemporarySaveService;
import com.chinaweal.youfool.framework.springboot.mybatis.plus.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 业务暂存表 服务实现类
 * </p>
 *
 * @author sh
 * @since 2023-04-07
 */
@Service
public class TemporarySaveServiceImpl extends BaseServiceImpl<TemporarySaveMapper, TemporarySave> implements TemporarySaveService {

    @Override
    public void delByBizseq(String bizseq) {
        List<TemporarySave> list = list(new LambdaQueryWrapper<TemporarySave>().eq(TemporarySave::getBizseq, bizseq));
        if(list.size() > 0){
            for(TemporarySave atom : list){
                removeById(atom.getId());
            }
        }
    }
}
