资产状态变更报表(特定时间范围内)

资产状态变更报表(特定时间范围内)

select resources.resourcename as "Asset Name", systeminfo.model, productType.componentTypename as "Product Type", longtodate(resourcestatehistory.starttime) "State changed at" ,  prevstate.statedesc as "prev state", currentstate.statedesc as "current state",resuser.first_name "User", statech.first_name as "state changed by", resourcestatehistory.comments "comments for changing state", resourceownerhistory.comments from resourcestatehistory left join resourceownerhistory on resourcestatehistory.STATEHISTORYID = ResourceOwnerHistory.STATEHISTORYID left join resources on resources.resourceid = resourcestatehistory.resourceid LEFT JOIN resourcestate fortesting on fortesting.resourcestateid = resources.resourcestateid   left join aaauser resuser on resuser.user_id = resourceownerhistory.userid left join aaauser taskdone on taskdone.user_id = resourceownerhistory.taskuserid left join aaauser resOwner on resOwner.user_id = resourceownerhistory.resourceownerid left join systeminfo on systeminfo.workstationid = resources.resourceid LEFT JOIN departmentDefinition on departmentDefinition.deptid = resourceownerhistory.deptid   left join resourcestate prevstate on prevstate.resourcestateid = resourcestatehistory.prevresourcestateid left join resourcestate currentstate on currentstate.resourcestateid = resourcestatehistory.resourcestateid left join  aaauser statech on statech.user_id = resourcestatehistory.userid LEFT JOIN ComponentDefinition product ON resources.COMPONENTID = product.COMPONENTID LEFT JOIN ComponentType productType ON product.COMPONENTTYPEID = productType.COMPONENTTYPEID where  productType.COMPONENTTYPENAME != 'Software' and systeminfo.workstationid is not null and resources.resourceid not in (select  resources.resourceid from resources left join systeminfo on systeminfo.workstationid = resources.resourceid left join (select resourcestatehistory.statehistoryid, aaa.statedesc "current state", bbb.statedesc as "previous state", resourcestatehistory.prevresourcestateid, resourcestatehistory.resourceid, (select rsh.statehistoryid from resourcestatehistory rsh where rsh.endtime = resourcestatehistory.starttime and resourcestatehistory.resourceid = rsh.resourceid) "check" from resourcestatehistory left join resourcestate aaa on aaa.resourcestateid = resourcestatehistory.resourcestateid left join resourcestate bbb on bbb.resourcestateid = resourcestatehistory.prevresourcestateid where resourcestatehistory.resourcestateid in (4,5) and resourcestatehistory.endtime is null ) "statehistory" on "statehistory".resourceid = resources.resourceid left join resourcestatehistory rss on rss.statehistoryid = "statehistory".statehistoryid left join resourceownerhistory roh on roh.statehistoryid = "statehistory"."check" left join aaauser on aaauser.user_id = roh.userid left join departmentdefinition dd on dd.deptid = roh.deptid where systeminfo.workstationid is not null and "statehistory".prevresourcestateid in (1,2,3,4,5)) and fortesting.resourcestateid =2 and resourcestatehistory.starttime>= datetolong('2022-08-31 00:00:00') and resourcestatehistory.starttime<=datetolong('2022-09-6 23:59:59') order by 1, resourcestatehistory.starttime desc, 10  asc 
    • Related Articles

    • SDP & Asset Explorer临时许可过期后导入新license

      Asset Explorer过期导入新license方法       Asset Explorer产品在临时license许可过期后不能通过界面进行直接导入,需要进入到服务器的安装路径下,管理员权限进入到cmd窗口下,找到bin目录下的run.bat脚本文件执行,此时,系统会引导你输入新的license的文件信息将其导入,此时系统会提示输入一个User Name,此user name是来源于license中的,默认为“admin”,填写其他用户名会出现报错。 ...
    • Asset API search_field 状态的不同条件

      Asset--Get All Assets 添加搜索条件Search_field用资产状态做搜索时,不通过缺省资产状态需要使用不同的搜索方式: 注: "row_count": 5 限定了最大返回记录数。 1. Disposed状态的资产搜索方式 { "list_info": { "row_count": 5, "start_index": 0, "sort_field": "id", "sort_order": "asc", "get_total_count": true, ...
    • ADSSP-GINA访问界面报错(HTTP Status 400-Bad Request)?

      如下图,在客户端GINA界面,不能正常访问,出现400错误: 如果出现上述报错,考虑客户端主机名是否包含中文字符(如公司中员工电脑以员工名字命名): 原因以及解决办法(手动在单个客户端解决该问题): 【GINA调用的浏览器是IE,这是IE浏览器默认URL编码的问题。】 【客户端IE需要以System account身份使用,且以该身份启用IE高级选项-“发送非Intranet URL的UTF-8查询字符串”。】 ...
    • 【APM】添加计划报表页面选择业务组 子组无法显示报HTTP Status 400

      报错截图: 解决方法: 备份以下路径的Server.xml文件,再用附件Server.xml文件替换--重启apm--清除浏览器缓存 AppManager_Home\working\apache\tomcat\conf\backup AppManager_Home\working\apache\tomcat\conf
    • 【OPM】如何取消对接口状态的监控

      应用场景: 当只想监控接口性能(流量利用率、丢包率、错包率等),而不想监控接口可用性(管理状态、操作状态)时。 例如接口连接设备会在非工作时间关机,操作状态变为 down,不想要相关接口 down 告警的情况下。 操作方法: 1.进入设备概览界面->点击右上部分绿底三条白色横线图标: 2.点击配置接口: 3.在状态轮询对应的位置,取消接口对应的勾选,并划到最下方保存: