package cn.iocoder.yudao.module.system.service.biz;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
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 cn.iocoder.yudao.module.system.dal.mysql.biz.RelativesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RelativesServiceImpl implements RelativesService {

    @Autowired
    private RelativesMapper relativesMapper;

    @Override
    public PageResult<RelativesDO> queryPage(RelativesPageReqVO pageReqVO) {
        return relativesMapper.selectPage(pageReqVO);
    }

    @Override
    public List<RelativesDO> getDetailsByElderId(Long elderId) {
        List<RelativesDO> relativesList = relativesMapper
                .selectList(new LambdaQueryWrapperX<RelativesDO>()
                .eq(RelativesDO::getPeopleId, elderId));
        return relativesList;
    }
}
