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

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chinaweal.aiccs.aiccs.business.entity.XrOpinion;
import com.chinaweal.aiccs.aiccs.business.mapper.XrOpinionMapper;
import com.chinaweal.aiccs.aiccs.business.service.IXrOpinionService;
import com.chinaweal.youfool.framework.springboot.base.query.BaseQuery;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 监管共用审批意见表 服务实现类
 * </p>
 *
 * @author quebh
 * @since 2023-05-06
 */
@Service
public class XrOpinionServiceImpl extends ServiceImpl<XrOpinionMapper, XrOpinion> implements IXrOpinionService {

    @Override
    public XrOpinion saveXrOpinion(XrOpinion xrOpinion) {
        save(xrOpinion);
        return xrOpinion;
    }

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

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

        return page(page, lambdaQueryWrapper);
    }

}
