package com.zt.plat.module.qms.resource.device.dal.mapper;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceRepairDetailDO;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairDetailPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 设备维修明细 Mapper
 *
 * @author 后台管理-1
 */
@Mapper
public interface DeviceRepairDetailMapper extends BaseMapperX<DeviceRepairDetailDO> {

    default PageResult<DeviceRepairDetailDO> selectPage(DeviceRepairDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeviceRepairDetailDO>()
                .eqIfPresent(DeviceRepairDetailDO::getRepairId, reqVO.getRepairId())
                .eqIfPresent(DeviceRepairDetailDO::getFaultContent, reqVO.getFaultContent())
                .eqIfPresent(DeviceRepairDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .eqIfPresent(DeviceRepairDetailDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(DeviceRepairDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DeviceRepairDetailDO::getId));
    }

}