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

import com.chinaweal.aiccs.crgs.entity.CppenaltyInfoGs;
import com.chinaweal.aiccs.crgs.mapper.CppenaltyInfoGsMapper;
import com.chinaweal.aiccs.crgs.service.ICppenaltyInfoGsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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 2021-12-25
 */
@Service
public class CppenaltyInfoGsServiceImpl extends ServiceImpl<CppenaltyInfoGsMapper, CppenaltyInfoGs> implements ICppenaltyInfoGsService {

    @Override
    public CppenaltyInfoGs saveCppenaltyInfoGs(CppenaltyInfoGs cppenaltyInfoGs) {
        save(cppenaltyInfoGs);
        return cppenaltyInfoGs;
    }

    @Override
    public void updateCppenaltyInfoGs(CppenaltyInfoGs cppenaltyInfoGs) {
        updateById(cppenaltyInfoGs);
    }

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

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

        return page(page, lambdaQueryWrapper);
    }

}
