DcPageOfficeFjStstnReportDao.xml 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="cn.com.goldenwater.dcproj.dao.DcPageOfficeFjStstnReportDao">
  4. <!--福建省 “党建+标准化”示范工地评选成果 报告 -->
  5. <!-- 根据 工地 Id(RGSTR_ID)获取到评分状态 -->
  6. <select id="selectScoreItemNum" resultType="java.util.HashMap">
  7. select count(sc.ID) NUM
  8. from BIS_INSP_STSTN_SCORE sc
  9. left join BIS_INSP_STSTN_SCENE sce on sc.CASE_ID = sce.ID and sce.RGSTR_ID = #{rgstrId}
  10. left join BIS_INSP_STSTN_TMPR t on sc.CASE_ID = t.ID and t.RGSTR_ID = #{rgstrId}
  11. left join BIS_INSP_STSTN_SAF sa on sc.CASE_ID = sa.ID and sa.RGSTR_ID = #{rgstrId}
  12. left join BIS_INSP_STSTN_PB p on sc.CASE_ID = p.ID and p.RGSTR_ID = #{rgstrId}
  13. where sce.RGSTR_ID is not null or t.RGSTR_ID is not null or sa.RGSTR_ID is not null or p.RGSTR_ID is not null
  14. </select>
  15. <!-- 根据 工地 Id(RGSTR_ID)获取到评分 -->
  16. <select id="selectScore" resultType="java.util.HashMap">
  17. select a.NM,
  18. nvl(a.STANDARD_SCORE, a. ACTUAL_SCORE) STANDARD_SCORE ,
  19. a.total as STANDARD_TOTAL,
  20. case when a.total = null or a.total = 0 then 0 else nvl(a.STANDARD_SCORE, 0) * 100 /a.total end as STANDARD_RATIO ,
  21. a.PB_SCORE
  22. from BIS_INSP_STSTN a
  23. where a.id = #{rgstrId}
  24. </select>
  25. <!-- 查询 标准化建设检测项 总数-->
  26. <select id="selectCheckNum" resultType="java.util.HashMap">
  27. select sum(rs.num) NUM
  28. from (
  29. select count(sc.ID) num , sce.RGSTR_ID as RGSTR_ID
  30. from BIS_INSP_STSTN_SCORE sc
  31. join BIS_INSP_STSTN_SCENE sce on sc.CASE_ID = sce.ID and sce.RGSTR_ID = #{rgstrId}
  32. group by sce.RGSTR_ID
  33. UNION ALL
  34. select count(sc.ID) num, t.RGSTR_ID as RGSTR_ID
  35. from BIS_INSP_STSTN_SCORE sc
  36. join BIS_INSP_STSTN_TMPR t on sc.CASE_ID = t.ID and t.RGSTR_ID = #{rgstrId}
  37. group by t.RGSTR_ID
  38. UNION ALL
  39. select count(sc.ID) num, sa.RGSTR_ID as RGSTR_ID
  40. from BIS_INSP_STSTN_SCORE sc
  41. join BIS_INSP_STSTN_SAF sa on sc.CASE_ID = sa.ID and sa.RGSTR_ID = #{rgstrId}
  42. group by sa.RGSTR_ID
  43. ) rs
  44. group by rs.RGSTR_ID
  45. </select>
  46. <!-- 查询 “党建进工地” 部分 评分 描述和图片-->
  47. <select id="selectPartyScoreInfo" resultType="java.util.HashMap">
  48. select p.RGSTR_ID ,sc.ID, sc.EXPLAIN ,sc.SCORE_NAME,gcf.FILE_PATH ,gcf.SN
  49. from BIS_INSP_STSTN_PB p
  50. left join BIS_INSP_STSTN_SCORE sc on sc.CASE_ID = p.ID
  51. left join gw_com_file gcf on gcf.biz_id = sc.id
  52. where p.RGSTR_ID = #{rgstrId}
  53. order by gcf.biz_id , gcf.sn
  54. </select>
  55. <!-- 查询 标准化建设-施工现场布置 评分 描述和图片-->
  56. <select id="selectStandardSceneScoreInfo" resultType="java.util.HashMap">
  57. select sce.RGSTR_ID ,sc.ID, sc.EXPLAIN ,sc.SCORE_NAME,gcf.FILE_PATH ,gcf.SN
  58. from BIS_INSP_STSTN_SCENE sce
  59. left join BIS_INSP_STSTN_SCORE sc on sc.CASE_ID = sce.ID
  60. left join gw_com_file gcf on gcf.biz_id = sc.id
  61. where sce.RGSTR_ID = #{rgstrId}
  62. order by gcf.biz_id , gcf.sn
  63. </select>
  64. <!-- 查询 标准化建设-临时工程 评分 描述和图片-->
  65. <select id="selectStandardTmprScoreInfo" resultType="java.util.HashMap">
  66. select t.RGSTR_ID ,sc.ID, sc.EXPLAIN ,sc.SCORE_NAME,gcf.FILE_PATH ,gcf.SN
  67. from BIS_INSP_STSTN_TMPR t
  68. left join BIS_INSP_STSTN_SCORE sc on sc.CASE_ID = t.ID
  69. left join gw_com_file gcf on gcf.biz_id = sc.id
  70. where t.RGSTR_ID = #{rgstrId}
  71. order by gcf.biz_id ,gcf.sn
  72. </select>
  73. <!-- 查询 标准化建设-安全文明施工(包含数字化建设和加分项) 评分 描述和图片-->
  74. <select id="selectStandardSafScoreInfo" resultType="java.util.HashMap">
  75. select sa.RGSTR_ID ,sc.ID, sc.EXPLAIN ,sc.SCORE_NAME,gcf.FILE_PATH ,gcf.SN
  76. from BIS_INSP_STSTN_SAF sa
  77. left join BIS_INSP_STSTN_SCORE sc on sc.CASE_ID = sa.ID
  78. left join gw_com_file gcf on gcf.biz_id = sc.id
  79. where sa.RGSTR_ID = #{rgstrId}
  80. order by gcf.biz_id ,gcf.sn
  81. </select>
  82. </mapper>