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

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.controller.admin.hwk.vo.HwkPageReqVO;
import com.unis.module.coding.dal.dataobject.hwk.HwkDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 货位卡信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface HwkMapper extends BaseMapperX<HwkDO> {

    default PageResult<HwkDO> selectPage(HwkPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HwkDO>()
                .eqIfPresent(HwkDO::getHwmc, reqVO.getHwmc())
                .eqIfPresent(HwkDO::getBgyxm, reqVO.getBgyxm())
                .eqIfPresent(HwkDO::getLspzmc, reqVO.getLspzmc())
                .eqIfPresent(HwkDO::getLsdjbm, reqVO.getLsdjbm())
                .eqIfPresent(HwkDO::getShnd, reqVO.getShnd())
                .eqIfPresent(HwkDO::getCdbm, reqVO.getCdbm())
                .eqIfPresent(HwkDO::getSjsl, reqVO.getSjsl())
                .eqIfPresent(HwkDO::getJjsl, reqVO.getJjsl())
                .eqIfPresent(HwkDO::getRksj, reqVO.getRksj())
                .eqIfPresent(HwkDO::getBgfs, reqVO.getBgfs())
                .betweenIfPresent(HwkDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(HwkDO::getCfId, reqVO.getCfId())
                .eqIfPresent(HwkDO::getKqid, reqVO.getKqid())
                .orderByDesc(HwkDO::getId));
    }

    HwkDO getHwkByCfId(Long cfId);
}