Commit dc09ad00 authored by a001188's avatar a001188
Browse files

Sort implemented

parent 28af0f54
......@@ -67,7 +67,7 @@ router.post('/infrastructure/list', (req, res, next) => {
function getSQLSearchQuery(query_type, req){
var jtSorting = req.query['jtSorting'].trim();
var sql_select ="select ci1.id as ci_id, ci1.parent_id as ci_parent_id, f.id as f_id, ft.id as ft_id, ci1.display_name as ci_name, ci1.kst as ci_kst, ci1.description as ci_description, f.display_name as family_name, ft.display_name as family_type_name, ";
var sql_select ="select ci1.id as ci_id, ci1.parent_id as ci_parent_id, ci1.class_information, ci1.attribute_information, f.id as f_id, ft.id as ft_id, ci1.display_name as ci_name, ci1.kst as ci_kst, ci1.description as ci_description, f.display_name as family_name, ft.display_name as family_type_name, ";
sql_select+="(select count(*) from cmdb.ci ci2 inner join cmdb.family f2 on ci2.family_id = f2.id where ci2.parent_id = ci1.id and f2.display_name <> 'Access') as childs, ";//f.display_name <> 'Access') as childs, ";
sql_select+="(select count(*) from cmdb.ci ci2 where ci1.parent_id = ci2.id and ci2.id > 0) as parents, ";//f.display_name <> 'Access') as childs, ";
sql_select+="(select count(*) from cmdb.ci ci2 inner join cmdb.family f2 on ci2.family_id = f2.id where ci2.parent_id = ci1.parent_id and f2.display_name <> 'Access') as siblings ";//f.display_name <> 'Access') as childs, ";
......
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