package com.gkhy.safePlatform.doublePrevention.service.baseService.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.gkhy.safePlatform.commons.enums.E; import com.gkhy.safePlatform.commons.enums.ResultCodes; import com.gkhy.safePlatform.commons.exception.AusinessException; import com.gkhy.safePlatform.commons.exception.BusinessException; import com.gkhy.safePlatform.doublePrevention.entity.PreventRiskMap; import com.gkhy.safePlatform.doublePrevention.entity.dto.req.PreventRiskMapUpdateReqDTO; import com.gkhy.safePlatform.doublePrevention.repository.PreventRiskMapRepository; import com.gkhy.safePlatform.doublePrevention.repository.param.PreventRiskMapUpdateParams; import com.gkhy.safePlatform.doublePrevention.service.baseService.PreventRiskMapService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service("PreventRiskMapService") public class PreventRiskMapServiceImpl extends ServiceImpl implements PreventRiskMapService{ @Autowired private PreventRiskMapRepository preventRiskMapRepository; /** * 风险分布图-分页查询详细信息 */ @Override public IPage getMapPage(Page mapPage) { return preventRiskMapRepository.getMapPage(mapPage); } /** * 风险分布图-新增 */ @Override public int saveRiskMap(PreventRiskMap riskMap) { int result = preventRiskMapRepository.insert(riskMap); if (result == 0){ throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); } return result; } /** * 风险分布图-删除 */ @Override public int deleteRiskMap(Long id) { int result = preventRiskMapRepository.deleteRiskMap(id); if (result == 0){ throw new BusinessException(ResultCodes.SERVER_DEL_ERROR); } return result; } /** * 风险分布图-修改 */ @Override public int updateRiskMap(PreventRiskMapUpdateParams params) { int result = preventRiskMapRepository.updateRiskMap(params); if (result == 0){ throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); } return result; } }