Commit ed858bee by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-data-cloud into developer
parents b4ddd325 e8d0f8a6
......@@ -95,5 +95,5 @@ public interface DataExplainApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.cloud.dto.IndexDTO>>
* @throws
*/
ServiceResponse<List<DataExplainDTO>> listByModule(String moduleId);
ServiceResponse<DataExplainDTO> listByModule(String moduleId);
}
......@@ -15,6 +15,7 @@ import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.response.EnterpriseServiceResponse;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -119,10 +120,14 @@ public class DataExplainApiServiceImpl implements DataExplainApiService {
}
@Override
public ServiceResponse<List<DataExplainDTO>> listByModule(String moduleId) {
public ServiceResponse<DataExplainDTO> listByModule(String moduleId) {
DataExplainQO dataExplainQO = new DataExplainQO();
dataExplainQO.setModuleId(moduleId);
List<TabDataExplain> dataExplainList = dataExplainService.listAllDataExplain(dataExplainQO);
return EnterpriseServiceResponse.success(EntityUtil.changeEntityListByJSON(DataExplainDTO.class, dataExplainList));
if (CollectionUtils.isNotEmpty(dataExplainList)) {
return EnterpriseServiceResponse.success(EntityUtil.changeEntityByJSON(DataExplainDTO.class, dataExplainList.get(0)));
} else {
return EnterpriseServiceResponse.success();
}
}
}
......@@ -234,6 +234,10 @@
<select id="getIndexDescByIndexCode" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_index_desc where status = 1 and module_id = #{moduleId} and index_code = #{indexCode} and index_group_name = #{indexGroupName} limit 1
from tab_index_desc where status = 1 and module_id = #{moduleId} and index_code = #{indexCode}
<if test="indexGroupName != null and indexGroupName != '' ">
and index_group_name = #{indexGroupName}
</if>
limit 1
</select>
</mapper>
\ No newline at end of file
......@@ -75,7 +75,7 @@ public class IndexDescController {
@RequestMapping("/get-data-explain")
public RestResponse getDataExplain(String moduleId) {
ServiceResponse<List<DataExplainDTO>> serviceResponse = dataExplainApiService.listByModule(moduleId);
ServiceResponse<DataExplainDTO> serviceResponse = dataExplainApiService.listByModule(moduleId);
return ResultControllerUtils.commonResult(serviceResponse);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment