package com.jojubanking.boot.module.system.dal.mysql.xymain;

import java.util.*;

import com.jojubanking.boot.framework.common.pojo.PageResult;
import com.jojubanking.boot.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.jojubanking.boot.framework.mybatis.core.mapper.BaseMapperX;
import com.jojubanking.boot.module.system.controller.app.xytjinfo.vo.xyMainUpdateByOpenidVO;
import com.jojubanking.boot.module.system.dal.dataobject.xymain.xyMainDO;
import org.apache.ibatis.annotations.Mapper;
import com.jojubanking.boot.module.system.controller.admin.xymain.vo.*;

/**
 * 体检信息 Mapper
 *
 * @author admin
 */
@Mapper
public interface xyMainMapper extends BaseMapperX<xyMainDO> {

    default PageResult<xyMainDO> selectPage(xyMainPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<xyMainDO>()
                .eqIfPresent(xyMainDO::getBatchno, reqVO.getBatchno())
                .likeIfPresent(xyMainDO::getBatchname, reqVO.getBatchname())
                .eqIfPresent(xyMainDO::getPatid, reqVO.getPatid())
                .likeIfPresent(xyMainDO::getName, reqVO.getName())
                .eqIfPresent(xyMainDO::getSex, reqVO.getSex())
                .eqIfPresent(xyMainDO::getAge, reqVO.getAge())
                .eqIfPresent(xyMainDO::getNationId, reqVO.getNationId())
                .eqIfPresent(xyMainDO::getDeptId, reqVO.getDeptId())
                .likeIfPresent(xyMainDO::getClassName, reqVO.getClassName())
                .likeIfPresent(xyMainDO::getSchoolName, reqVO.getSchoolName())
                .likeIfPresent(xyMainDO::getSqName, reqVO.getSqName())
                .likeIfPresent(xyMainDO::getJdName, reqVO.getJdName())
                .eqIfPresent(xyMainDO::getEmail, reqVO.getEmail())
                .eqIfPresent(xyMainDO::getMobile, reqVO.getMobile())
                .eqIfPresent(xyMainDO::getRemark, reqVO.getRemark())
                .eqIfPresent(xyMainDO::getFeeflag, reqVO.getFeeflag())
                .eqIfPresent(xyMainDO::getFeetotal, reqVO.getFeetotal())
                .eqIfPresent(xyMainDO::getTjpkgfee, reqVO.getTjpkgfee())
                .eqIfPresent(xyMainDO::getTjpkgno, reqVO.getTjpkgno())
                .eqIfPresent(xyMainDO::getTjkxfee, reqVO.getTjkxfee())
                .eqIfPresent(xyMainDO::getTjorderno, reqVO.getTjorderno())
                .betweenIfPresent(xyMainDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(xyMainDO::getId));
    }

    default List<xyMainDO> selectListSimple(xyMainExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<xyMainDO>()
                .eqIfPresent(xyMainDO::getBatchno, reqVO.getBatchno())
                .likeIfPresent(xyMainDO::getBatchname, reqVO.getBatchname())
                .eqIfPresent(xyMainDO::getPatid, reqVO.getPatid())
                .likeIfPresent(xyMainDO::getName, reqVO.getName())
                .eqIfPresent(xyMainDO::getSex, reqVO.getSex())
                .eqIfPresent(xyMainDO::getAge, reqVO.getAge())
                .eqIfPresent(xyMainDO::getNationId, reqVO.getNationId())
                .eqIfPresent(xyMainDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(xyMainDO::getOpenid, reqVO.getOpenid())
                .likeIfPresent(xyMainDO::getClassName, reqVO.getClassName())
                .likeIfPresent(xyMainDO::getSchoolName, reqVO.getSchoolName())
                .likeIfPresent(xyMainDO::getSqName, reqVO.getSqName())
                .likeIfPresent(xyMainDO::getJdName, reqVO.getJdName())
                .eqIfPresent(xyMainDO::getEmail, reqVO.getEmail())
                .eqIfPresent(xyMainDO::getMobile, reqVO.getMobile())
                .eqIfPresent(xyMainDO::getRemark, reqVO.getRemark())
                .eqIfPresent(xyMainDO::getFeeflag, reqVO.getFeeflag())
                .eqIfPresent(xyMainDO::getFeetotal, reqVO.getFeetotal())
                .eqIfPresent(xyMainDO::getTjpkgfee, reqVO.getTjpkgfee())
                .eqIfPresent(xyMainDO::getTjpkgno, reqVO.getTjpkgno())
                .eqIfPresent(xyMainDO::getTjkxfee, reqVO.getTjkxfee())
                .eqIfPresent(xyMainDO::getTjorderno, reqVO.getTjorderno())
                .betweenIfPresent(xyMainDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(xyMainDO::getId));
    }

    default List<xyMainDO> selectList(xyMainExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<xyMainDO>()
                .eqIfPresent(xyMainDO::getBatchno, reqVO.getBatchno())
                .likeIfPresent(xyMainDO::getBatchname, reqVO.getBatchname())
                .eqIfPresent(xyMainDO::getPatid, reqVO.getPatid())
                .likeIfPresent(xyMainDO::getName, reqVO.getName())
                .eqIfPresent(xyMainDO::getSex, reqVO.getSex())
                .eqIfPresent(xyMainDO::getAge, reqVO.getAge())
                .eqIfPresent(xyMainDO::getNationId, reqVO.getNationId())
                .eqIfPresent(xyMainDO::getDeptId, reqVO.getDeptId())
                .likeIfPresent(xyMainDO::getClassName, reqVO.getClassName())
                .likeIfPresent(xyMainDO::getSchoolName, reqVO.getSchoolName())
                .likeIfPresent(xyMainDO::getSqName, reqVO.getSqName())
                .likeIfPresent(xyMainDO::getJdName, reqVO.getJdName())
                .eqIfPresent(xyMainDO::getEmail, reqVO.getEmail())
                .eqIfPresent(xyMainDO::getMobile, reqVO.getMobile())
                .eqIfPresent(xyMainDO::getRemark, reqVO.getRemark())
                .eqIfPresent(xyMainDO::getFeeflag, reqVO.getFeeflag())
                .eqIfPresent(xyMainDO::getFeetotal, reqVO.getFeetotal())
                .eqIfPresent(xyMainDO::getTjpkgfee, reqVO.getTjpkgfee())
                .eqIfPresent(xyMainDO::getTjpkgno, reqVO.getTjpkgno())
                .eqIfPresent(xyMainDO::getTjkxfee, reqVO.getTjkxfee())
                .eqIfPresent(xyMainDO::getTjorderno, reqVO.getTjorderno())
                .betweenIfPresent(xyMainDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(xyMainDO::getId));
    }

}
