Browse Source

指标保存查询改造

wangchangsheng 2 years ago
parent
commit
fb0dd72378

+ 1 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/controller/IndicatorController.java

@@ -112,7 +112,7 @@ public class IndicatorController {
 
 
 	/**
-	 * g根据指标idh获取主子指标
+	 * 根据指标id获取主子指标
 	 *
 	 * @param id 指标id
 	 * @return

+ 4 - 3
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/IndicatorServiceImpl.java

@@ -230,9 +230,10 @@ public class IndicatorServiceImpl extends ServiceImpl<IndicatorMapper, Indicator
 		//获取指标
 		IndicatorDTO indicatorDTO = baseMapper.selectById(id);
 		//根据指标获取明细组
-		List<IndicatorDictionaryDTO> dtoList = indicatorDictionaryService.list(indicatorDTO.getId(),"","");
-		indicatorDTO.setDtoList(dtoList);
-
+		if(null != indicatorDTO) {
+			List<IndicatorDictionaryDTO> dtoList = indicatorDictionaryService.list(indicatorDTO.getId(), "", "");
+			indicatorDTO.setDtoList(dtoList);
+		}
 		return indicatorDTO;
 	}
 

+ 9 - 3
ims-service/ims-eval/src/main/resources/mappers/IndicatorMapper.xml

@@ -107,10 +107,16 @@
 
     <select id="selectById" resultType="com.ims.eval.entity.dto.request.IndicatorDTO">
         SELECT
-            *
+        i.*,t.type_name indicatorTypeName,
+        b.stage_name binStageName,
+        bs.section_name binSectionName
         FROM
-            indicator
-        where id = #{id}
+        indicator i
+        LEFT JOIN indicator_type t  ON i.indicator_type_id = t.id
+        LEFT JOIN bin_stage b  ON i.bin_stage = b.id
+        LEFT JOIN bin_section bs  ON i.bin_section = bs.id
+
+        where i.id = #{id}
     </select>
 
 </mapper>