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.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.RelativesPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.RelativesDO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface RelativesMapper extends BaseMapperX<RelativesDO> {


    default PageResult<RelativesDO> selectPage(RelativesPageReqVO pageReqVO){
        return selectPage(pageReqVO,new LambdaQueryWrapperX<RelativesDO>()
                .likeIfPresent(RelativesDO::getPeopleName,pageReqVO.getElderName())
                .likeIfPresent(RelativesDO::getName,pageReqVO.getName())
                .likeIfPresent(RelativesDO::getPhone,pageReqVO.getPhone())
                .orderByDesc(RelativesDO::getCreateDate));
    }

}
