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

/**
 * 设备-保养分项 Mapper
 *
 * @author 后台管理-1
 */
@Mapper
public interface DeviceMaintainItemMapper extends BaseMapperX<DeviceMaintainItemDO> {

    default PageResult<DeviceMaintainItemDO> selectPage(DeviceMaintainItemPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeviceMaintainItemDO>()
                .eqIfPresent(DeviceMaintainItemDO::getParentId, reqVO.getParentId())
                .eqIfPresent(DeviceMaintainItemDO::getCheckItemId, reqVO.getCheckItemId())
                .eqIfPresent(DeviceMaintainItemDO::getCheckResult, reqVO.getCheckResult())
                .eqIfPresent(DeviceMaintainItemDO::getConclusion, reqVO.getConclusion())
                .eqIfPresent(DeviceMaintainItemDO::getCheckRemark, reqVO.getCheckRemark())
                .betweenIfPresent(DeviceMaintainItemDO::getCheckDate, reqVO.getCheckDate())
                .likeIfPresent(DeviceMaintainItemDO::getCheckUserName, reqVO.getCheckUserName())
                .eqIfPresent(DeviceMaintainItemDO::getCheckUserId, reqVO.getCheckUserId())
                .eqIfPresent(DeviceMaintainItemDO::getItemKey, reqVO.getItemKey())
                .likeIfPresent(DeviceMaintainItemDO::getItemName, reqVO.getItemName())
                .eqIfPresent(DeviceMaintainItemDO::getFrequencyType, reqVO.getFrequencyType())
                .eqIfPresent(DeviceMaintainItemDO::getFrequency, reqVO.getFrequency())
                .eqIfPresent(DeviceMaintainItemDO::getFrequencyTimeStart, reqVO.getFrequencyTimeStart())
                .eqIfPresent(DeviceMaintainItemDO::getFrequencyTimeEnd, reqVO.getFrequencyTimeEnd())
                .eqIfPresent(DeviceMaintainItemDO::getStandard, reqVO.getStandard())
                .eqIfPresent(DeviceMaintainItemDO::getItemMethod, reqVO.getItemMethod())
                .eqIfPresent(DeviceMaintainItemDO::getFrequencyRemark, reqVO.getFrequencyRemark())
                .eqIfPresent(DeviceMaintainItemDO::getDutyRemark, reqVO.getDutyRemark())
                .eqIfPresent(DeviceMaintainItemDO::getSortNo, reqVO.getSortNo())
                .eqIfPresent(DeviceMaintainItemDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .eqIfPresent(DeviceMaintainItemDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(DeviceMaintainItemDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DeviceMaintainItemDO::getId));
    }

}