TubularStructureDao.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. <update id="updateDetails">
  5. update water_tubular_structure
  6. set cslb = #{cslb, jdbcType=VARCHAR},
  7. gylx = #{gylx, jdbcType=VARCHAR},
  8. fzjs = #{fzjs, jdbcType=VARCHAR},
  9. fzds = #{fzds, jdbcType=VARCHAR},
  10. fgq = #{fgq, jdbcType=VARCHAR},
  11. cd_psq = #{cdPsq, jdbcType=VARCHAR},
  12. mdgj = #{mdgj, jdbcType=VARCHAR},
  13. bcgj = #{bcgj, jdbcType=VARCHAR},
  14. xjf = #{xjf, jdbcType=VARCHAR}
  15. where
  16. jh = #{jh, jdbcType=VARCHAR} and wjrq = #{wjrq, jdbcType=VARCHAR}
  17. </update>
  18. <select id="selectList" resultType="cn.com.victorysoft.business.cyyzs.entity.TubularStructureHome">
  19. select
  20. a.*, b.flag_name gymc, rownum xh
  21. from (
  22. select
  23. gylx,
  24. sum(case when zjsj <![CDATA[ < ]]> 1 then 1 else 0 end) zjsjxyyn,
  25. sum(case when zjsj >= 1 and zjsj <![CDATA[ < ]]> 2 then 1 else 0 end) zjsjyen,
  26. sum(case when zjsj >= 2 and zjsj <![CDATA[ < ]]> 3 then 1 else 0 end) zjsjesn,
  27. sum(case when zjsj >= 3 and zjsj <![CDATA[ < ]]> 4 then 1 else 0 end) zjsjssn,
  28. sum(case when zjsj >= 4 and zjsj <![CDATA[ < ]]> 5 then 1 else 0 end) zjsjswn,
  29. sum(case when zjsj >= 5 then 1 else 0 end) zjsjwnys
  30. from
  31. water_tubular_structure
  32. where
  33. 1 = 1
  34. <if test="yclx != null and yclx != ''"> </if>
  35. <if test="dydm != null and dydm != ''"> and dydm = #{dydm}</if>
  36. <if test="cslb != null and cslb != ''"> and cslb = #{cslb}</if>
  37. <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>
  38. group by gylx
  39. ) a
  40. left join sys_flag b on a.gylx = b.flag_code
  41. </select>
  42. <select id="selectDetails" resultType="cn.com.victorysoft.business.cyyzs.entity.TubularStructure">
  43. select
  44. a.*,
  45. (select unitname from sys_unitinfo where unitcode = a.dwdm) dwmc,
  46. (select blockname from sys_blockinfo where blockcode = a.dydm) dymc,
  47. (select flag_name from sys_flag where flag_code = a.gylx) gylx_name,
  48. (select flag_name from sys_flag where flag_code = a.cslb) cslb_name, rownum xh
  49. from
  50. water_tubular_structure a
  51. where
  52. 1 = 1
  53. <if test="yclx != null and yclx != ''"> </if>
  54. <if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
  55. <if test="jh != null and jh != ''"> and a.jh = #{jh}</if>
  56. <if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
  57. <if test="fgq != null and fgq != ''"> and a.fgq = #{fgq}</if>
  58. <if test="cdPsq != null and cdPsq != ''"> and a.cd_psq = #{cdPsq}</if>
  59. <if test="xjf != null and xjf != ''"> and a.xjf = #{xjf}</if>
  60. <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>
  61. </select>
  62. <select id="selectDetailsOne" resultType="cn.com.victorysoft.business.cyyzs.entity.TubularStructure">
  63. select
  64. *
  65. from
  66. water_tubular_structure
  67. where
  68. 1 = 1
  69. <if test="jh != null and jh != ''"> and jh = #{jh}</if>
  70. <if test="wjrq != null and wjrq != ''"> and to_char(wjrq, 'yyyy-mm-dd') = #{wjrq}</if>
  71. </select>
  72. <!-- <select id="getBarData" resultType="cn.com.victorysoft.business.cyyzs.entity.TubularStructureHome">-->
  73. <!-- select-->
  74. <!-- *-->
  75. <!-- from-->
  76. <!-- (-->
  77. <!-- select-->
  78. <!-- a.flag_code gylx,-->
  79. <!-- 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-->
  80. <!-- from-->
  81. <!-- (select * from sys_flag where category_code = 'GYLX') a-->
  82. <!-- left join (-->
  83. <!-- select-->
  84. <!-- gylx,-->
  85. <!-- sum(case when zjsj <![CDATA[ < ]]> 1 then 1 else 0 end) zjsjxyyn,-->
  86. <!-- sum(case when zjsj >= 1 and zjsj <![CDATA[ < ]]> 2 then 1 else 0 end) zjsjyen,-->
  87. <!-- sum(case when zjsj >= 2 and zjsj <![CDATA[ < ]]> 3 then 1 else 0 end) zjsjesn,-->
  88. <!-- sum(case when zjsj >= 3 and zjsj <![CDATA[ < ]]> 4 then 1 else 0 end) zjsjssn,-->
  89. <!-- sum(case when zjsj >= 4 and zjsj <![CDATA[ < ]]> 5 then 1 else 0 end) zjsjswn,-->
  90. <!-- sum(case when zjsj >= 5 then 1 else 0 end) zjsjwnys-->
  91. <!-- from-->
  92. <!-- water_tubular_structure-->
  93. <!-- <if test="yclx != null and yclx != ''"> </if>-->
  94. <!-- <if test="dydm != null and dydm != ''"> and dydm = #{dydm}</if>-->
  95. <!-- <if test="dwdm != null and dwdm != ''"> and dwdm = #{dwdm}</if>-->
  96. <!-- <if test="cslb != null and cslb != ''"> and cslb = #{cslb}</if>-->
  97. <!-- group by gylx-->
  98. <!-- ) b on a.flag_code = b.gylx-->
  99. <!-- ) a-->
  100. <!-- </select>-->
  101. </mapper>