package com.gkhy.safePlatform.specialWork.service.baseService.impl; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.gkhy.safePlatform.commons.enums.ResultCodes; import com.gkhy.safePlatform.commons.exception.BusinessException; import com.gkhy.safePlatform.specialWork.entity.WorkProcessWarningInfo; import com.gkhy.safePlatform.specialWork.model.query.db.WorkProcessWarningPageDBQuery; import com.gkhy.safePlatform.specialWork.repository.WorkProcessWarningInfoRepository; import com.gkhy.safePlatform.specialWork.service.baseService.WorkProcessWarningInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service("workProcessWarningInfoService") public class WorkProcessWarningInfoServiceImpl extends ServiceImpl implements WorkProcessWarningInfoService { @Autowired private WorkProcessWarningInfoRepository workProcessWarningInfoRepository; @Override public List listWorkProcessWarningInfoByPage(Page page, WorkProcessWarningPageDBQuery dbQuery) { if (page == null || dbQuery == null) { throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); } return workProcessWarningInfoRepository.listWorkProcessWarningInfoByPage(page,dbQuery); } @Override public void saveWorkProcessWarningInfo(WorkProcessWarningInfo warningInfo) { if (warningInfo == null) { throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); } int i = workProcessWarningInfoRepository.insertWorkProcessWarningInfo(warningInfo); if (i != 1) { throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); } } }