IntegratedQueryCQuery.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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="com.ghsc.partybuild.mapper.IntegratedQueryCQuery">
  4. <!--查询党组织分布情况-->
  5. <select id="departmentAdvanceList" resultType="java.util.HashMap">
  6. select row_number() over (order by dep.DZZDM) as ROWNUMBER,dep.DZZDM,
  7. dep.DZZMC,depinfo.ZZLB,deptype.HZMC as ZZLBMC,depinfo.JCZZFL,
  8. depcate.HZMC as JCZZFLMC,
  9. depinfo.ZGRS,dep.JLDZZRQ,ses.GJJMRQ,dep.ZZQKXXBS,
  10. depinfo.DYZS as MEMBERCOUNT
  11. from ZZ_ZZQKXX dep
  12. inner join ZZ_ZZQKXXFB depinfo on dep.DZZDM=depinfo.DZZDM
  13. inner join ZZZD_ZZLBDMNEW deptype on depinfo.ZZLB=deptype.BM
  14. inner join ZZZD_JCZZFL depcate on depinfo.JCZZFL=depcate.BM
  15. left join ZZ_BZJCXX ses on dep.DZZDM=ses.DZZDM and depinfo.LDJTJC=ses.LDJTJC
  16. where 1=1
  17. <if test="dzzmc != null and dzzmc != ''">
  18. and dep.DZZMC like concat('%',#{dzzdm},'%')
  19. </if>
  20. <if test="dzzdm != null and dzzdm != ''">
  21. and dep.DZZDM like concat('%',#{dzzdm},'%')
  22. </if>
  23. <if test="zzlb != null and zzlb.length > 0">
  24. and depinfo.ZZLB in
  25. <foreach close=")" collection="zzlb" item="listItem" open="(" separator=",">
  26. #{listItem}
  27. </foreach>
  28. </if>
  29. <if test="jczzfl != null and jczzfl.length > 0">
  30. and depinfo.JCZZFL in
  31. <foreach close=")" collection="jczzfl" item="listItem" open="(" separator=",">
  32. #{listItem}
  33. </foreach>
  34. </if>
  35. <if test="jldzzrqStart != null and jldzzrqStart != ''">
  36. and dep.JLDZZRQ <![CDATA[>=]]> #{jldzzrqStart}
  37. </if>
  38. <if test="jldzzrqEnd != null and jldzzrqEnd != ''">
  39. and dep.JLDZZRQ <![CDATA[<=]]> #{jldzzrqEnd}
  40. </if>
  41. <if test="gjjmrqStart != null and gjjmrqStart != ''">
  42. and ses.GJJMRQ <![CDATA[>=]]> #{gjjmrqStart}
  43. </if>
  44. <if test="gjjmrqEnd != null and gjjmrqEnd != ''">
  45. and ses.GJJMRQ <![CDATA[<=]]> #{gjjmrqEnd}
  46. </if>
  47. <if test="memberCountStart != null">
  48. and depinfo.DYZS <![CDATA[>=]]> #{memberCountStart}
  49. </if>
  50. <if test="memberCountEnd != null">
  51. and depinfo.DYZS <![CDATA[<=]]> #{memberCountEnd}
  52. </if>
  53. <if test="djkpxxYear != null and djkpxxYear_dzb == null">
  54. and exists (select 1
  55. from DJ_DJKPXX eva
  56. where eva.YEAR=#{djkpxxYear} and eva.DZZDM=dep.DZZDM
  57. <if test="judgeLevel != null">
  58. and eva.JUDGELEVEL in
  59. <foreach close=")" collection="judgeLevel" item="listItem" open="(" separator=",">
  60. #{listItem}
  61. </foreach>
  62. </if>
  63. )
  64. </if>
  65. <if test="djkpxxYear_dzb != null and djkpxxYear == null">
  66. and exists (select 1
  67. from DJ_DJKPXX eva
  68. where eva.YEAR=#{djkpxxYear_dzb} and eva.DZZDM=dep.DZZDM
  69. <if test="judgeLevel_dzb != null">
  70. and eva.JUDGELEVEL in
  71. <foreach close=")" collection="judgeLevel_dzb" item="listItem" open="(" separator=",">
  72. #{listItem}
  73. </foreach>
  74. </if>
  75. )
  76. </if>
  77. <if test="djkpxxYear != null and djkpxxYear_dzb != null">
  78. and (
  79. exists (select 1
  80. from DJ_DJKPXX eva
  81. where eva.YEAR=#{djkpxxYear} and eva.DZZDM=dep.DZZDM
  82. <if test="judgeLevel != null">
  83. and eva.JUDGELEVEL in
  84. <foreach close=")" collection="judgeLevel" item="listItem" open="(" separator=",">
  85. #{listItem}
  86. </foreach>
  87. </if>
  88. )
  89. or
  90. exists (select 1
  91. from DJ_DJKPXX eva
  92. where eva.YEAR=#{djkpxxYear_dzb} and eva.DZZDM=dep.DZZDM
  93. <if test="judgeLevel_dzb != null">
  94. and eva.JUDGELEVEL in
  95. <foreach close=")" collection="judgeLevel_dzb" item="listItem" open="(" separator=",">
  96. #{listItem}
  97. </foreach>
  98. </if>
  99. )
  100. )
  101. </if>
  102. <if test="honourYear != null and honourlevel != null">
  103. and exists (select 1
  104. from DJ_DNPXXX honour
  105. where honour.PXLX=2
  106. and honour.DZZDM=dep.DZZDM
  107. and extract(year from honour.HONOURTIME)=#{honourYear}
  108. and honour.HONOURLEVEL=#{honourlevel}
  109. <if test="honourType != null">
  110. and honour.HONOURTYPE in
  111. <foreach close=")" collection="honourType" item="listItem" open="(" separator=",">
  112. #{listItem}
  113. </foreach>
  114. </if>
  115. )
  116. </if>
  117. order by dep.DZZDM
  118. </select>
  119. </mapper>