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

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chinaweal.aiccs.aiccs.punishment.entity.QgCasePubNbaseinfo;
import com.chinaweal.aiccs.aiccs.punishment.mapper.QgCasePubNbaseinfoMapper;
import com.chinaweal.aiccs.aiccs.punishment.service.IQgCasePubNbaseinfoService;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Map;

/**
 * <p>
 * 跨省行政处罚基本信息表 服务实现类
 * </p>
 *
 * @author developer
 * @since 2026-03-30
 */
@Service
public class IQgCasePubNbaseinfoServiceImpl extends ServiceImpl<QgCasePubNbaseinfoMapper, QgCasePubNbaseinfo> implements IQgCasePubNbaseinfoService {

    @Override
    public IPage<QgCasePubNbaseinfo> searchByPage(Page<QgCasePubNbaseinfo> page, Map<String, Object> params) {
        return this.baseMapper.searchByPage(page, params);
    }

    @Override
    public QgCasePubNbaseinfo findById(String caseid) {
        return this.baseMapper.findById(caseid);
    }

    @Override
    public boolean updateForRepair(String caseid, LocalDate approvalDate) {
        int rows = this.baseMapper.updateForRepair(caseid, approvalDate, LocalDateTime.now());
        return rows > 0;
    }
}
