TubularStructureDao.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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.victorysoft.business.cyyzs.dao.TubularStructureDao">
  4. <select id="selectList" resultType="cn.com.victorysoft.business.cyyzs.entity.TubularStructureHome">
  5. select
  6. a.*, b.flag_name gymc, rownum xh
  7. from (
  8. select
  9. gylx,
  10. sum(case when zjsj <![CDATA[ < ]]> 1 then 1 else 0 end) zjsjxyyn,
  11. sum(case when zjsj >= 1 and zjsj <![CDATA[ < ]]> 2 then 1 else 0 end) zjsjyen,
  12. sum(case when zjsj >= 2 and zjsj <![CDATA[ < ]]> 3 then 1 else 0 end) zjsjesn,
  13. sum(case when zjsj >= 3 and zjsj <![CDATA[ < ]]> 4 then 1 else 0 end) zjsjssn,
  14. sum(case when zjsj >= 4 and zjsj <![CDATA[ < ]]> 5 then 1 else 0 end) zjsjswn,
  15. sum(case when zjsj >= 5 then 1 else 0 end) zjsjwnys
  16. from
  17. water_tubular_structure
  18. where
  19. 1 = 1
  20. <if test="yclx != null and yclx != ''"> </if>
  21. <if test="dydm != null and dydm != ''"> and dydm = #{dydm}</if>
  22. <if test="cslb != null and cslb != ''"> and cslb = #{cslb}</if>
  23. <if test="dwdm != null and dwdm != ''"> and dwdm in (select unitcode from sys_unitinfo start with unitcode = #{dwdm} connect by p_unitcode = prior unitcode) </if>
  24. group by gylx
  25. ) a
  26. left join sys_flag b on a.gylx = b.flag_code
  27. </select>
  28. <select id="selectDetails" resultType="cn.com.victorysoft.business.cyyzs.entity.TubularStructure">
  29. select
  30. a.*,
  31. (select unitname from sys_unitinfo where unitcode = a.dwdm) dwmc,
  32. (select blockname from sys_blockinfo where blockcode = a.dydm) dymc,
  33. (select flag_name from sys_flag where flag_code = a.gylx) gylx_name,
  34. (select flag_name from sys_flag where flag_code = a.cslb) cslb_name, rownum xh
  35. from
  36. water_tubular_structure a
  37. where
  38. 1 = 1
  39. <if test="yclx != null and yclx != ''"> </if>
  40. <if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
  41. <if test="jh != null and jh != ''"> and a.jh = #{jh}</if>
  42. <if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
  43. <if test="fgq != null and fgq != ''"> and a.fgq = #{fgq}</if>
  44. <if test="cdPsq != null and cdPsq != ''"> and a.cd_psq = #{cdPsq}</if>
  45. <if test="xjf != null and xjf != ''"> and a.xjf = #{xjf}</if>
  46. <if test="dwdm != null and dwdm != ''"> and a.dwdm in (select unitcode from sys_unitinfo start with unitcode = #{dwdm} connect by p_unitcode = prior unitcode) </if>
  47. </select>
  48. <!-- <select id="getBarData" resultType="cn.com.victorysoft.business.cyyzs.entity.TubularStructureHome">-->
  49. <!-- select-->
  50. <!-- *-->
  51. <!-- from-->
  52. <!-- (-->
  53. <!-- select-->
  54. <!-- a.flag_code gylx,-->
  55. <!-- nvl(b.zjsjxyyn, 0) zjsjxyyn, nvl(b.zjsjyen, 0) zjsjyen, nvl(b.zjsjesn, 0) zjsjesn, nvl(b.zjsjssn, 0) zjsjssn, nvl(b.zjsjswn, 0) zjsjswn, nvl(b.zjsjwnys, 0) zjsjwnys-->
  56. <!-- from-->
  57. <!-- (select * from sys_flag where category_code = 'GYLX') a-->
  58. <!-- left join (-->
  59. <!-- select-->
  60. <!-- gylx,-->
  61. <!-- sum(case when zjsj <![CDATA[ < ]]> 1 then 1 else 0 end) zjsjxyyn,-->
  62. <!-- sum(case when zjsj >= 1 and zjsj <![CDATA[ < ]]> 2 then 1 else 0 end) zjsjyen,-->
  63. <!-- sum(case when zjsj >= 2 and zjsj <![CDATA[ < ]]> 3 then 1 else 0 end) zjsjesn,-->
  64. <!-- sum(case when zjsj >= 3 and zjsj <![CDATA[ < ]]> 4 then 1 else 0 end) zjsjssn,-->
  65. <!-- sum(case when zjsj >= 4 and zjsj <![CDATA[ < ]]> 5 then 1 else 0 end) zjsjswn,-->
  66. <!-- sum(case when zjsj >= 5 then 1 else 0 end) zjsjwnys-->
  67. <!-- from-->
  68. <!-- water_tubular_structure-->
  69. <!-- <if test="yclx != null and yclx != ''"> </if>-->
  70. <!-- <if test="dydm != null and dydm != ''"> and dydm = #{dydm}</if>-->
  71. <!-- <if test="dwdm != null and dwdm != ''"> and dwdm = #{dwdm}</if>-->
  72. <!-- <if test="cslb != null and cslb != ''"> and cslb = #{cslb}</if>-->
  73. <!-- group by gylx-->
  74. <!-- ) b on a.flag_code = b.gylx-->
  75. <!-- ) a-->
  76. <!-- </select>-->
  77. </mapper>