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.DeviceRepairAtDO;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairAtPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 故障与处理关系 Mapper
 *
 * @author 后台管理-1
 */
@Mapper
public interface DeviceRepairAtMapper extends BaseMapperX<DeviceRepairAtDO> {

    default PageResult<DeviceRepairAtDO> selectPage(DeviceRepairAtPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeviceRepairAtDO>()
                .eqIfPresent(DeviceRepairAtDO::getRepairDetailId, reqVO.getRepairDetailId())
                .eqIfPresent(DeviceRepairAtDO::getResultDetailId, reqVO.getResultDetailId())
                .eqIfPresent(DeviceRepairAtDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .eqIfPresent(DeviceRepairAtDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(DeviceRepairAtDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DeviceRepairAtDO::getId));
    }

}