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

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.biz.vo.pressuresores.ElderlyPressureSoresPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.pressuresores.ElderlyPressureSoresRespVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.ElderlyPressureSoresDO;
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
public interface ElderlyPressureSoresMapper extends BaseMapperX<ElderlyPressureSoresDO> {

    List<ElderlyPressureSoresRespVO> selectPageWithElderInfo(Page<ElderlyPressureSoresRespVO> page,
                                                             @Param("reqVO") ElderlyPressureSoresPageReqVO reqVO);

    ElderlyPressureSoresRespVO selectByIdWithElderInfo(@Param("id") Long id);

    default PageResult<ElderlyPressureSoresRespVO> selectPageWithElderInfo(ElderlyPressureSoresPageReqVO reqVO) {
        Page<ElderlyPressureSoresRespVO> page = new Page<>(reqVO.getPageNo(), reqVO.getPageSize());
        List<ElderlyPressureSoresRespVO> list = selectPageWithElderInfo(page, reqVO);
        return new PageResult<>(list, page.getTotal());
    }
}

