解决惠安惠达Bug:待命车数量明细不对
来源:互联网 发布:算法导论第三版pdf 编辑:程序博客网 时间:2024/05/17 03:15
描述:待命车数量为168-7=161,而明细中加起来是168,数量不对
以前我写的SQL:
select m.item_name hostVehType, count(m.item_name) hostVehTypeCount from(select cc.hostid,cc.HOST_VEH_TYPE,cc.owner_appsysid,cc.owner_appdeptid,a.item_namefrom (select ext.hostid,ext.HOST_VEH_TYPE,ext.owner_appsysid,ext.owner_appdeptid from position_host_info p left join position_host_info_extend ext on p.hostid = ext.hostid where ext.verify_status = 1and (ext.process_status <3)) cc,DICTIONARY_ITEM awhere a.dic_type = 'HOST_VEH_TYPE' and cc.HOST_VEH_TYPE = a.item_valueand ((cc.owner_appsysid, cc.owner_appdeptid) in (select appsysid, appdeptid from table(get_subdept(-1, 2000, 0)))) )m group by m.item_name
加起来的数量为168,是总的数量,并不是待命车的数量啊
修改SQL如下:测试待命车的数量为161,正确!
select m.item_name hostVehType, count(m.item_name) hostVehTypeCount from(select cc.hostid, cc.HOST_VEH_TYPE, cc.owner_appsysid, cc.owner_appdeptid,a.item_namefrom (select ext.hostid,ext.HOST_VEH_TYPE,ext.owner_appsysid,ext.owner_appdeptid from position_host_info p left join position_host_info_extend ext on p.hostid = ext.hostid where ext.verify_status = 1 --审核状态:0-未审核,1-已审核 and (ext.process_status <3)) cc,--车辆处理状态:1-正常;2-处置中;3-报废中;4-已处置;5-已报废 DICTIONARY_ITEM awhere a.dic_type = 'HOST_VEH_TYPE' and cc.HOST_VEH_TYPE = a.item_valueand cc.hostid not in--过滤任务车数量(select tt.host_id from (SELECT t.host_id FROM vd_veh_assign_list t LEFT JOIN position_host_info_extend ext ON t.host_id = ext.hostid WHERE t.execute_status = 1--派车单执行状态:0未执行;1执行中;2执行完成 and ext.PROCESS_STATUS < 3 AND ((ext.owner_appsysid, ext.owner_appdeptid) in (select appsysid, appdeptid from table(get_myviewdeptlist(1, 2000, 0))))) tt) and ((cc.owner_appsysid, cc.owner_appdeptid) in (select appsysid, appdeptid from table(get_subdept(-1, 2000, 0)))) )m group by m.item_name
因为我们发现任务车的SQL是这样的,有了灵感,在总的数量中通过hostid把任务车过滤掉,想到了这一点,其实很简单
阅读全文
0 0
- 解决惠安惠达Bug:待命车数量明细不对
- 惠安惠达sql优化:已出车后,待命车数量明细中该车最好显示为0,用户体验较好
- 惠安惠达项目新需求:首页增加待命车明细
- 解决GAT项目Bug:车装车饰费用管理中的装饰费统计(车辆)统计数据不对
- 待命名
- 各个阶段Bug数量估计
- 查询资金明细、历史委托、历史成交、交割中,查询按钮文字颜色不对
- 查询资金明细、历史委托、历史成交、交割中,查询按钮文字颜色不对
- 工商银行卡账户历史明细清单上的BUG
- 解决bug
- 批处理中等待命令
- J2EE使用session监听实现在线用户明细及数量统计
- 解决Gentoo系统时间不对情况
- 解决linux环境机器 系统时间不对
- 模拟器尺寸不对如何解决-启动图片
- 解决Ubuntu16.04时间不对的问题
- 如何估算剩余的bug数量
- PHP,APACHE连接数量解决
- C#字符串格式化总结
- JZ2440内存管理单元MMU
- Matlab中的color 画线的多种颜色
- java笔记 java中的字符串
- 云客Drupal8源码分析之配置系统Configuration(三):配置schema与类型化
- 解决惠安惠达Bug:待命车数量明细不对
- 如何使用 paramiko 模块来实现远程执行OS命令和文件上传下载?
- 支付宝接口申请流程-傲付宝
- 生产者消费者模式
- hot-reloading
- java中BeanUtils的概述
- Android APP架构设计
- JDK版本错误:Unsupported major.minor version 51.0
- React Native 组件介绍