package com.unis.module.coding.dal.mysql.fmxx;

import java.util.*;

import com.unis.framework.common.pojo.PageResult;
import com.unis.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.unis.framework.mybatis.core.mapper.BaseMapperX;
import com.unis.module.coding.dal.dataobject.caxx.CaxxDO;
import com.unis.module.coding.dal.dataobject.fmxx.FmxxDO;
import org.apache.ibatis.annotations.Mapper;
import com.unis.module.coding.controller.admin.fmxx.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 赋码结果信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface FmxxMapper extends BaseMapperX<FmxxDO> {

    default PageResult<FmxxDO> selectPage(FmxxPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FmxxDO>()
                .eqIfPresent(FmxxDO::getBaseDwxxId, reqVO.getBaseDwxxId())
                .eqIfPresent(FmxxDO::getBaseKqxxId, reqVO.getBaseKqxxId())
                .eqIfPresent(FmxxDO::getBaseYgxxId, reqVO.getBaseYgxxId())
                .eqIfPresent(FmxxDO::getBaseCaxxId, reqVO.getBaseCaxxId())
                .eqIfPresent(FmxxDO::getTyshxydm, reqVO.getTyshxydm())
                .eqIfPresent(FmxxDO::getFrdwdm, reqVO.getFrdwdm())
                .eqIfPresent(FmxxDO::getDwmc, reqVO.getDwmc())
                .eqIfPresent(FmxxDO::getKqdm, reqVO.getKqdm())
                .eqIfPresent(FmxxDO::getKqmc, reqVO.getKqmc())
                .eqIfPresent(FmxxDO::getCfdm, reqVO.getCfdm())
                .eqIfPresent(FmxxDO::getCfmc, reqVO.getCfmc())
                .eqIfPresent(FmxxDO::getAjdm, reqVO.getAjdm())
                .eqIfPresent(FmxxDO::getAjmc, reqVO.getAjmc())
                .eqIfPresent(FmxxDO::getCreateDeptId, reqVO.getCreateDeptId())
                .betweenIfPresent(FmxxDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(FmxxDO::getStatus, reqVO.getStatus())
                .eqIfPresent(FmxxDO::getSfdc, reqVO.getSfdc())
                .eqIfPresent(FmxxDO::getDcqyid, reqVO.getDcqyid())
                .likeIfPresent(FmxxDO::getLqdwName, reqVO.getLqdwName())
                .eqIfPresent(FmxxDO::getLqdwId, reqVO.getLqdwId())
                .eqIfPresent(FmxxDO::getLsxz, reqVO.getLsxz())
                .eqIfPresent(FmxxDO::getLqDwmc, reqVO.getLqDwmc())
                .eqIfPresent(FmxxDO::getLqQyshxydm, reqVO.getLqQyshxydm())
                .eqIfPresent(FmxxDO::getLqKqmc, reqVO.getLqKqmc())
                .eqIfPresent(FmxxDO::getLqCfmc, reqVO.getLqCfmc())
                .eqIfPresent(FmxxDO::getLqAjmc, reqVO.getLqAjmc())
                .eqIfPresent(FmxxDO::getIsUnanimous, reqVO.getIsUnanimous())
                .eqIfPresent(FmxxDO::getReason, reqVO.getReason())
                .eqIfPresent(FmxxDO::getAjid, reqVO.getAjid())
                .eqIfPresent(FmxxDO::getZxsj, reqVO.getZxsj())
                .eqIfPresent(FmxxDO::getZxyy, reqVO.getZxyy())
                .orderByDesc(FmxxDO::getId));
    }
   default List<FmxxDO> selectListByKqId(Long  kqId){
        return  selectList(
                new LambdaQueryWrapperX<FmxxDO>()
                        .eqIfPresent(FmxxDO::getBaseKqxxId, kqId)
        );
    }
    default List<FmxxDO>  selectListByCaId(List<Long> caIds) {
        return selectList(
                new LambdaQueryWrapperX<FmxxDO>()
                        .inIfPresent(FmxxDO::getBaseCaxxId, caIds)
        );
     }


}