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

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.houselane.vo.WareHouseLanePageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.houselane.WareHouseLaneDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 线库/巷道 Mapper
 *
 * @author 陈宾顺
 */
@Mapper
public interface WareHouseLaneMapper extends BaseMapperX<WareHouseLaneDO> {

    default PageResult<WareHouseLaneDO> selectPage(WareHouseLanePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WareHouseLaneDO>()
                .eqIfPresent(WareHouseLaneDO::getPositionMapId, reqVO.getPositionMapId())
                .likeIfPresent(WareHouseLaneDO::getLaneName, reqVO.getLaneName())
                .eqIfPresent(WareHouseLaneDO::getLaneMsg, reqVO.getLaneMsg())
                .betweenIfPresent(WareHouseLaneDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WareHouseLaneDO::getId));
    }

    /**
     * 根据地图id删除
     * @param mapId
     */
    void deleteHouseLaneByMapId(@Param("mapId") Long mapId);
}
