ZnbYhdaMapper.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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.tofly.feesapi.znbgl.mapper.ZnbYhdaMapper">
  4. <resultMap id="znbYhdaMap" type="com.tofly.feesapi.znbgl.entity.ZnbYhda">
  5. <id property="yhbh" column="YHBH"/>
  6. <result property="bjwz" column="BJWZ"/>
  7. <result property="bjkj" column="BJKJ"/>
  8. <result property="bjlc" column="BJLC"/>
  9. <result property="cbpl" column="CBPL"/>
  10. <result property="bjqd" column="BJQD"/>
  11. <result property="bjzd" column="BJZD"/>
  12. <result property="bjbh" column="BJBH"/>
  13. <result property="jdrq" column="JDRQ"/>
  14. <result property="jdpch" column="JDPCH"/>
  15. <result property="czry" column="CZRY"/>
  16. <result property="czrq" column="CZRQ"/>
  17. <result property="yhzt" column="YHZT"/>
  18. <result property="fmzt" column="FMZT"/>
  19. <result property="bjzt" column="BJZT"/>
  20. <result property="bjmsg" column="BJMSG"/>
  21. <result property="bjye" column="BJYE"/>
  22. <result property="tbbz" column="TBBZ"/>
  23. <result property="jdlx" column="JDLX"/>
  24. <result property="yhxm" column="YHXM"/>
  25. <result property="yhdz" column="YHDZ"/>
  26. <result property="lxdh" column="LXDH"/>
  27. <result property="ssgs" column="SSGS"/>
  28. <result property="sspq" column="SSPQ"/>
  29. <result property="sscbb" column="SSCBB"/>
  30. <result property="yhlx" column="YHLX"/>
  31. <result property="jgbm" column="JGBM"/>
  32. <result property="bjcj" column="BJCJ"/>
  33. <result property="bjxh" column="BJXH"/>
  34. <result property="bjlb" column="BJLB"/>
  35. </resultMap>
  36. <!--自定义智能表档案分页查询 -->
  37. <select id="getPage" resultType="com.tofly.feesapi.znbgl.entity.vo.ZnbYhdaSelect">
  38. SELECT a.yhbh, a.yhxm, a.yhdz, a.jgbm,a.bjye,a.tbbz,a.bjbh, a.fmzt, a.lxdh,
  39. f.cbbmc AS sscbbmc,
  40. g.cbpqmc AS sscbpqmc,
  41. d.name AS sblbmc,
  42. h.name AS bjcjmc
  43. FROM znb_yhda a
  44. LEFT JOIN bm_sblb d ON a.bjlb = d.code
  45. LEFT JOIN bm_cbb f ON a.sscbb = f.cbbbm
  46. LEFT JOIN bm_cbpq g ON a.sspq = g.cbpqbm
  47. LEFT JOIN bm_sbsccj h on a.bjcj=h.code
  48. WHERE 1=1
  49. <!--模糊查询 -->
  50. <if test="filter.searchText!=null">
  51. AND (c.yhbh like '%${filter.searchText}%'
  52. OR c.yhxm like '%${filter.searchText}%'
  53. OR c.yhdz like '%${filter.searchText}%'
  54. OR c.lxdh like '%${filter.searchText}%')
  55. </if>
  56. <!--所属公司-->
  57. <if test="filter.ssgs!=null">
  58. AND c.ssgs=#{filter.ssgs}
  59. </if>
  60. <!--所属片区-->
  61. <if test="filter.sscbpq!=null">
  62. AND c.sscbpq=#{filter.sscbpq}
  63. </if>
  64. <!--所属抄表本-->
  65. <if test="filter.sscbb!=null">
  66. <choose>
  67. <when test="filter.sscbb.indexOf(',')!=-1">
  68. AND a.sscbb in
  69. <foreach item="item" index="index" collection="filter.sscbb.split(',')" open="(" separator=","
  70. close=")">
  71. #{item}
  72. </foreach>
  73. </when>
  74. <otherwise>
  75. AND a.sscbb=#{filter.sscbb}
  76. </otherwise>
  77. </choose>
  78. </if>
  79. </select>
  80. <select id="getPage2" resultType="com.tofly.feesapi.znbgl.entity.vo.ZnbYhdaSelect">
  81. SELECT a.yhbh, a.yhxm, a.yhdz, a.jgbm,a.bjye,a.tbbz,a.bjbh, a.fmzt, a.lxdh,
  82. f.cbbmc AS sscbbmc,
  83. g.cbpqmc AS sscbpqmc,
  84. d.name AS sblbmc,
  85. h.name AS bjcjmc
  86. FROM yh_khjbxx a
  87. LEFT JOIN bm_sblb d ON a.bjlb = d.code
  88. LEFT JOIN bm_cbb f ON a.sscbb = f.cbbbm
  89. LEFT JOIN bm_cbpq g ON a.sspq = g.cbpqbm
  90. LEFT JOIN bm_sbsccj h on a.bjcj=h.code
  91. WHERE 1=1
  92. <!--模糊查询 -->
  93. <if test="filter.searchText!=null">
  94. AND (c.yhbh like '%${filter.searchText}%'
  95. OR c.yhxm like '%${filter.searchText}%'
  96. OR c.yhdz like '%${filter.searchText}%'
  97. OR c.lxdh like '%${filter.searchText}%')
  98. </if>
  99. <!--所属公司-->
  100. <if test="filter.ssgs!=null">
  101. AND c.ssgs=#{filter.ssgs}
  102. </if>
  103. <!--所属片区-->
  104. <if test="filter.sscbpq!=null">
  105. AND c.sscbpq=#{filter.sscbpq}
  106. </if>
  107. <!--所属抄表本-->
  108. <if test="filter.sscbb!=null">
  109. <choose>
  110. <when test="filter.sscbb.indexOf(',')!=-1">
  111. AND c.sscbb in
  112. <foreach item="item" index="index" collection="filter.sscbb.split(',')" open="(" separator=","
  113. close=")">
  114. #{item}
  115. </foreach>
  116. </when>
  117. <otherwise>
  118. AND c.sscbb=#{filter.sscbb}
  119. </otherwise>
  120. </choose>
  121. </if>
  122. </select>
  123. </mapper>