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

import com.chinaweal.aiccs.aiccs.market.entity.DraftRevokeEntity;
import com.chinaweal.aiccs.aiccs.market.mapper.DraftRevokeEntityMapper;
import com.chinaweal.aiccs.aiccs.market.service.IDraftRevokeEntityService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chinaweal.youfool.framework.springboot.mybatis.plus.BaseServiceImpl;
import org.springframework.stereotype.Service;
import com.chinaweal.youfool.framework.springboot.base.query.BaseQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;

/**
 * <p>
 * 拟撤销主体信息表 服务实现类
 * </p>
 *
 * @author chinaweal
 * @since 2022-05-31
 */
@Service
public class DraftRevokeEntityServiceImpl extends BaseServiceImpl<DraftRevokeEntityMapper, DraftRevokeEntity> implements IDraftRevokeEntityService {

    @Override
    public DraftRevokeEntity saveDraftRevokeEntity(DraftRevokeEntity draftRevokeEntity) {
        save(draftRevokeEntity);
        return draftRevokeEntity;
    }

    @Override
    public void updateDraftRevokeEntity(DraftRevokeEntity draftRevokeEntity) {
        updateById(draftRevokeEntity);
    }

    @Override
    public IPage<DraftRevokeEntity> listDraftRevokeEntity(BaseQuery<DraftRevokeEntity> query) {
        DraftRevokeEntity entity = query.getEntity(DraftRevokeEntity.class);
        Page<DraftRevokeEntity> page = query.getPage();

        LambdaQueryWrapper<DraftRevokeEntity> lambdaQueryWrapper = Wrappers.lambdaQuery();

        return page(page, lambdaQueryWrapper);
    }

}
