package cn.iocoder.yudao.module.system.dal.mysql.houselocation;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointBindingDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 取货点位绑定 Mapper
 *
 * @author 陈宾顺
 */
@Mapper
public interface WareHouseTakePointBindingMapper extends BaseMapperX<WareHouseTakePointBindingDO> {

    default PageResult<WareHouseTakePointBindingDO> selectPage(WareHouseTakePointBindingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WareHouseTakePointBindingDO>()
                .eqIfPresent(WareHouseTakePointBindingDO::getBindingType, reqVO.getBindingType())
                .eqIfPresent(WareHouseTakePointBindingDO::getBindingId, reqVO.getBindingId())
                .eqIfPresent(WareHouseTakePointBindingDO::getTakePointId, reqVO.getTakePointId())
                .betweenIfPresent(WareHouseTakePointBindingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WareHouseTakePointBindingDO::getId));
    }

    void deleteByBindingId(@Param("bindingId") Long bindingId);
}