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

/**
 * 故障处理明细 Mapper
 *
 * @author 后台管理-1
 */
@Mapper
public interface DeviceRepairResultDetailMapper extends BaseMapperX<DeviceRepairResultDetailDO> {

    default PageResult<DeviceRepairResultDetailDO> selectPage(DeviceRepairResultDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeviceRepairResultDetailDO>()
                .eqIfPresent(DeviceRepairResultDetailDO::getSolutionContent, reqVO.getSolutionContent())
                .eqIfPresent(DeviceRepairResultDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .eqIfPresent(DeviceRepairResultDetailDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(DeviceRepairResultDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DeviceRepairResultDetailDO::getId));
    }

}