09_b10.sql 734 B

1234567891011121314151617181920212223
  1. --09、百元资产修理维护费
  2. ---北10
  3. select
  4. t1.smonth as MONTH_ID,
  5. '北10' as ZB_TYPE,
  6. t1.sname as PROV_NAME,
  7. null as CITY_ID,
  8. null as CITY_NAME,
  9. null as GRID_ID,
  10. null as GRID_NAME,
  11. '9' as ZB_CODE,
  12. '百元资产修理维护费' as ZB_NAME,
  13. '否' as IS_RATIO,
  14. t1.cost_fix as QZ_FZ,
  15. t2.zichan as QZ_FM,
  16. (t1.cost_fix/t2.zichan)*100 as BY_QZ
  17. from
  18. (select smonth,stype,sname,cost_fix from sqmdb_cost.chengben_shengnei where smonth='202206' and stype='北10') t1
  19. join
  20. (select sname,sum(column7+column8)/2 as zichan from sqmdb_cost.report80054 where period_type='M'
  21. and sname in('北京','天津','河北','山西','内蒙古','辽宁','吉林','黑龙江','山东','河南')
  22. and stype='分省展现' and smonth between '202201' and '202206' group by sname) t2
  23. on t1.sname=t2.sname