YhGhLogMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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.yhgl.mapper.YhGhLogMapper">
  4. <select id="selectDaCustomerGhPage" resultType="com.tofly.feesapi.yhgl.entity.vo.YhGhLogSelect">
  5. SELECT
  6. *
  7. FROM (
  8. SELECT
  9. a.*,
  10. cbpq.cbpqmc as sscbpqname,
  11. cbb.cbbmc as sscbbname,
  12. (
  13. select
  14. LISTAGG(File_NEW_FN, ',') WITHIN GROUP (ORDER BY TABLE_BH)
  15. FROM
  16. sys_upfiles files
  17. WHERE
  18. files.table_bh = a.bh
  19. ) AS fileurl
  20. FROM
  21. yh_gh_log a
  22. LEFT JOIN
  23. bm_cbpq cbpq on a.sscbpq=cbpq.cbpqbm
  24. LEFT JOIN
  25. bm_cbb cbb on a.sscbb=cbb.cbbbm
  26. WHERE
  27. 1=1
  28. <!--模糊查询 -->
  29. <if test="filter.searchText != null and filter.searchText != ''">
  30. and ( a.yhbh like '%${filter.searchText}%' or
  31. a.old_yhxm like '%${filter.searchText}%' or
  32. a.old_yhdz like '%${filter.searchText}%' or
  33. old_lxdh like '%${filter.searchText}%' )
  34. </if>
  35. <!--公司 -->
  36. <if test="filter.ssgs!=null and filter.ssgs!='' and filter.ssgs!='all'">
  37. and a.ssgs=#{filter.ssgs}
  38. </if>
  39. <!--片区 -->
  40. <if test="filter.sscbpq !=null and filter.sscbpq!='' and filter.sscbpq!='all' ">
  41. and a.sscbpq=#{filter.sscbpq}
  42. </if>
  43. <!--抄表本 -->
  44. <if test="filter.sscbb !=null and filter.sscbb!='' and filter.sscbb!='all'">
  45. and a.sscbb=#{filter.sscbb}
  46. </if>
  47. <if test="filter.qyfzr!=null">
  48. and a.sscbb in(select cbbbm from bm_cbb where qyfzr=#{filter.qyfzr})
  49. </if>
  50. <!--建档日期-->
  51. <if test="filter.ksrq!=null and filter.ksrq!='' and filter.jsrq!=null and filter.jsrq!='' ">
  52. and a.ghsj between to_date(#{filter.ksrq},'yyyy-mm-dd hh24:mi:ss') and
  53. to_date(#{filter.jsrq},'yyyy-mm-dd hh24:mi:ss')
  54. </if>
  55. <if test="filter.czry!=null and filter.czry!=''">
  56. and a.czrybm=#{filter.czry}
  57. </if>
  58. )
  59. </select>
  60. <resultMap id="yhGhLogMap" type="com.tofly.feesapi.yhgl.entity.YhGhLog">
  61. <id property="bh" column="BH"/>
  62. <result property="ssgs" column="SSGS"/>
  63. <result property="yhbh" column="YHBH"/>
  64. <result property="oldYhdz" column="OLD_YHDZ"/>
  65. <result property="oldYhxm" column="OLD_YHXM"/>
  66. <result property="oldLxdh" column="OLD_LXDH"/>
  67. <result property="oldZjlb" column="OLD_ZJLB"/>
  68. <result property="oldZjhm" column="OLD_ZJHM"/>
  69. <result property="newYhxm" column="NEW_YHXM"/>
  70. <result property="newLxdh" column="NEW_LXDH"/>
  71. <result property="newZjlb" column="NEW_ZJLB"/>
  72. <result property="newZjhm" column="NEW_ZJHM"/>
  73. <result property="ghsj" column="GHSJ"/>
  74. <result property="czrybm" column="CZRYBM"/>
  75. <result property="czryxm" column="CZRYXM"/>
  76. <result property="bz" column="BZ"/>
  77. <result property="type" column="TYPE"/>
  78. <result property="oldFpNsrsbh" column="OLD_FP_NSRSBH"/>
  79. <result property="oldFpDz" column="OLD_FP_DZ"/>
  80. <result property="oldFpName" column="OLD_FP_NAME"/>
  81. <result property="oldFpLxdh" column="OLD_FP_LXDH"/>
  82. <result property="oldFpBankname" column="OLD_FP_BANKNAME"/>
  83. <result property="oldFpBz" column="OLD_FP_BZ"/>
  84. <result property="oldFpBankcode" column="OLD_FP_BANKCODE"/>
  85. <result property="newFpNsrsbh" column="NEW_FP_NSRSBH"/>
  86. <result property="newFpDz" column="NEW_FP_DZ"/>
  87. <result property="newFpName" column="NEW_FP_NAME"/>
  88. <result property="newFpLxdh" column="NEW_FP_LXDH"/>
  89. <result property="newFpBankname" column="NEW_FP_BANKNAME"/>
  90. <result property="newFpBz" column="NEW_FP_BZ"/>
  91. <result property="newFpBankcode" column="NEW_FP_BANKCODE"/>
  92. <result property="newYhdz" column="NEW_YHDZ"/>
  93. <result property="sscbpq" column="SSCBPQ"/>
  94. <result property="sscbb" column="SSCBB"/>
  95. <result property="newFplx" column="NEW_FPLX"/>
  96. </resultMap>
  97. </mapper>