首页 > 代码库 > forTest

forTest

[sourcecode language=‘java‘ ]select 
    	NODE_ID,
    	NODE_NAME,
    	NODE_DESCRIPTION,
    	NODE_HOST,NODE_PORT,
    	LAST_REQUEST_TIME,
    	LAST_REQUEST_COUNT,
    	LAST_REQUEST_RESPONSE,
    	LAST_REQUEST_RESPONSEMAX,
    	LAST_REQUEST_ERROR,
    	STATUS,CREATION_DATE,
    	CREATED_BY,
    	LAST_UPDATE_DATE,
    	LAST_UPDATED_BY,
    	APP_ID,
    	CONSUMER_SIDE,
    	ZK_STATUS,
    	PROVIDER_SIDE,
    	(SELECT DECODE(SUM(acd.LAST_REQUEST_COUNT),NULL,0,SUM(acd.LAST_REQUEST_COUNT)) FROM HSP_APP_COLLECT_DETAIL acd WHERE acd.NODE_ID = n.NODE_ID AND acd.APP_ID=#{appId,jdbcType=DECIMAL}) AS HISTORY_INVOKE_AMOUNT,
		(SELECT DECODE(SUM(acd.Last_Request_Count),0,0,CEIL(SUM(acd.Last_Request_Response*acd.Last_Request_Count)/SUM(acd.Last_Request_Count))) FROM HSP_APP_COLLECT_DETAIL acd WHERE acd.NODE_ID = n.NODE_ID AND acd.APP_ID=#{appId,jdbcType=DECIMAL}) AS HISTORY_AVG_RESPONSE_TIME,
		(SELECT DECODE(SUM(acd.LAST_REQUEST_ERROR),NULL,0,SUM(acd.LAST_REQUEST_ERROR)) FROM HSP_APP_COLLECT_DETAIL acd WHERE acd.NODE_ID = n.NODE_ID AND acd.APP_ID=#{appId,jdbcType=DECIMAL}) AS HISTORY_ERR_AMOUNT,
 		(SELECT APP_NAME FROM HSP_APP a WHERE a.app_id=n.app_id) AS APP_NAME
    from Hsp_NODE n
    WHERE NODE_ID IN(
       SELECT NODE_ID FROM HSP_APP_REF WHERE APP_ID=#{appId,jdbcType=DECIMAL}
       GROUP BY NODE_ID
	)
    order by n.STATUS DESC,N.ZK_STATUS DESC,n.LAST_REQUEST_TIME DESC,n.NODE_NAME

[/sourcecode]

forTest