package cn.iocoder.yudao.module.system.dal.mysql.extra;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.controller.admin.extra.vo.SafetyCommitmentPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.extra.ElderlyExtraSafetyCommitmentDO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * (附件)长者安全承诺书 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface ElderlyExtraSafetyCommitmentMapper extends BaseMapperX<ElderlyExtraSafetyCommitmentDO> {

    List<ElderlyExtraSafetyCommitmentDO> selectPageWithJoin(Page<ElderlyExtraSafetyCommitmentDO> page,
                                                             @Param("reqVO") SafetyCommitmentPageReqVO reqVO);

    default PageResult<ElderlyExtraSafetyCommitmentDO> selectPage(SafetyCommitmentPageReqVO reqVO) {
        Page<ElderlyExtraSafetyCommitmentDO> page = new Page<>(reqVO.getPageNo(), reqVO.getPageSize());
        List<ElderlyExtraSafetyCommitmentDO> list = selectPageWithJoin(page, reqVO);
        return new PageResult<>(list, page.getTotal());
    }

}
