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

import com.chinaweal.aiccs.aiccs.fraudreg.entity.VFraudInfo;
import com.chinaweal.aiccs.aiccs.fraudreg.mapper.VFraudInfoMapper;
import com.chinaweal.aiccs.aiccs.fraudreg.service.IVFraudInfoService;
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>
 * VIEW 服务实现类
 * </p>
 *
 * @author chinaweal
 * @since 2021-11-19
 */
@Service
public class VFraudInfoServiceImpl extends BaseServiceImpl<VFraudInfoMapper, VFraudInfo> implements IVFraudInfoService {

    @Override
    public VFraudInfo saveVFraudInfo(VFraudInfo vFraudInfo) {
        save(vFraudInfo);
        return vFraudInfo;
    }

    @Override
    public void updateVFraudInfo(VFraudInfo vFraudInfo) {
        updateById(vFraudInfo);
    }

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

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

        return page(page, lambdaQueryWrapper);
    }

}
