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.VolunteerTeamPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.VolunteerTeamRespVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.VolunteerTeamDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * @Author: jinyd
 * @CreateTime: 2025/3/7  11:33
 * @Description:
 * @Version: 4.0
 */


@Mapper
public interface VolunteerTeamMapper extends BaseMapperX<VolunteerTeamDO> {

    default PageResult<VolunteerTeamDO> selectPage(VolunteerTeamPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<VolunteerTeamDO>()
                .likeIfPresent(VolunteerTeamDO::getTeamName, reqVO.getTeamName())
                .betweenIfPresent(VolunteerTeamDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(VolunteerTeamDO::getOrgType, reqVO.getOrgType())
                .inIfPresent(VolunteerTeamDO::getTenantId, reqVO.getTenantIds())
                .eq(VolunteerTeamDO::getDeleted, false)
                .orderByDesc(VolunteerTeamDO::getId));
    }

}
