/**
 * Copyright 2019 DH
 * All right reserved.
 * 项目名称: 大恒泰山系统
 * 创建日期:2022/8/23
 */
package org.springblade.modules.business.equipment.inspection.plan.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.modules.business.equipment.inspection.plan.dto.EquipmentInspectionRtuDTO;
import org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionPlanEntity;
import org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionRtuEntity;
import org.springblade.modules.business.equipment.inspection.plan.mapper.EquipmentInspectionPlanMapper;
import org.springblade.modules.business.equipment.inspection.plan.mapper.EquipmentInspectionPlanRtuMapper;
import org.springblade.modules.business.equipment.inspection.plan.service.IEquipmentInspectionPlanRtuService;
import org.springblade.modules.business.equipment.inspection.plan.service.IEquipmentInspectionPlanService;
import org.springblade.modules.business.equipment.inspection.plan.vo.EquipmentInspectionRtuVO;
import org.springframework.stereotype.Service;

/***
 * Date:2022/8/23
 * Title:文件所属模块（必须填写）
 * Description：对本文件的详细描述，原则上不能少于30字
 * @author dylan
 * @version 1.0
 * Remark：认为有必要的其他信息
 */
@Service
public class EquipmentInspectionPlanRtuServiceImpl extends BaseServiceImpl<EquipmentInspectionPlanRtuMapper, EquipmentInspectionRtuEntity> implements IEquipmentInspectionPlanRtuService {


	@Override
	public IPage<EquipmentInspectionRtuVO> selectPage(IPage<EquipmentInspectionRtuVO> page, EquipmentInspectionRtuDTO rtuDTO) {
		return page.setRecords(baseMapper.selectPage(page, rtuDTO));
	}

	@Override
	public Long yearPlanEquipmentInspectionCount(Long orgId) {
		LambdaQueryWrapper<EquipmentInspectionRtuEntity> wrapper = Wrappers.<EquipmentInspectionRtuEntity>query().lambda();
		if (null != orgId) {
			wrapper.eq(EquipmentInspectionRtuEntity::getOrgId, orgId);
		}
		wrapper.eq(EquipmentInspectionRtuEntity::getIsDeleted, 0);
		return baseMapper.selectCount(wrapper);
	}

	@Override
	public IPage<EquipmentInspectionRtuVO> myPage(IPage<EquipmentInspectionRtuVO> page, EquipmentInspectionRtuDTO rtuDTO) {
		return page.setRecords(baseMapper.myPage(page, rtuDTO));
	}
}
