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

/**
 * @Author: jinyd
 * @CreateTime: 2024/8/19  11:34
 * @Description:
 * @Version: 4.0
 */

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.biz.vo.DeviceModelPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.ManufacturerModelRespVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.DeviceModelDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 床位变更记录 Mapper
 *
 * @author 系统管理员
 */
@Mapper
public interface DeviceModelMapper extends BaseMapperX<DeviceModelDO> {

    default PageResult<DeviceModelDO> selectPage(DeviceModelPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeviceModelDO>()
                .eq(DeviceModelDO::getParentId, 0)
                .eqIfPresent(DeviceModelDO::getDeviceCategoryId, reqVO.getDeviceCategoryId())
                .eqIfPresent(DeviceModelDO::getDeviceManufacturerId, reqVO.getDeviceManufacturerId())
                .likeIfPresent(DeviceModelDO::getDeviceName, reqVO.getDeviceName())
                .likeIfPresent(DeviceModelDO::getModelName, reqVO.getModelName())
                .eqIfPresent(DeviceModelDO::getStatus, reqVO.getStatus())
                .eqIfPresent(DeviceModelDO::getType, reqVO.getType())
                .eqIfPresent(DeviceModelDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(DeviceModelDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DeviceModelDO::getId));
    }


    List<ManufacturerModelRespVO> getManufacturerModelList();
}
