YhhLogMapper.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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.YhhLogMapper">
  4. <!--获取用户最大ID -->
  5. <select id="selectMaxId" resultType="int">
  6. select nvl(max(to_number(bh)), 0) bh
  7. from yh_xh_log
  8. </select>
  9. <select id="SelectDaxhPage" resultType="com.tofly.feesapi.yhgl.entity.vo.YhhLogSelect">
  10. select * from (
  11. select a.*,
  12. cbpq.cbpqmc as sscbpqname,
  13. cbb.cbbmc as sscbbname,
  14. (select LISTAGG(File_NEW_FN,',') WITHIN GROUP (ORDER BY TABLE_BH) from sys_upfiles files where files.table_bh=a.bh ) as fileurl
  15. from
  16. yh_xh_log a
  17. left join bm_cbpq cbpq on a.sscbpq=cbpq.cbpqbm
  18. left join bm_cbb cbb on a.sscbb=cbb.cbbbm
  19. where 1=1
  20. <!--模糊查询 -->
  21. <if test="filter.searchText != null and filter.searchText != ''">
  22. and ( a.yhbh like '%${filter.searchText}%' or
  23. a.yhxm like '%${filter.searchText}%' or
  24. a.yhdz like '%${filter.searchText}%' or
  25. a.xhdh like '%${filter.searchText}%' )
  26. </if>
  27. <!--公司 -->
  28. <if test="filter.ssgs !=null and filter.ssgs!='' and filter.ssgs!='all'">
  29. and a.ssgs=#{filter.ssgs}
  30. </if>
  31. <!--片区 -->
  32. <if test="filter.sscbpq !=null and filter.sscbpq!='' and filter.sscbpq!='all' ">
  33. and a.sscbpq=#{filter.sscbpq}
  34. </if>
  35. <!--抄表本 -->
  36. <if test="filter.sscbb !=null and filter.sscbb!='' and filter.sscbb!='all'">
  37. and sscbb=#{filter.sscbb}
  38. </if>
  39. <if test="filter.qyfzr!=null">
  40. and a.sscbb in(select cbbbm from bm_cbb where qyfzr=#{filter.qyfzr})
  41. </if>
  42. <!--销户时间-->
  43. <if test="filter.ksrq!=null and filter.ksrq!='' and filter.jsrq!=null and filter.jsrq!='' ">
  44. and a.xhsj between to_date(#{filter.ksrq},'yyyy-mm-dd hh24:mi:ss')
  45. and to_date(#{filter.jsrq},'yyyy-mm-dd hh24:mi:ss')
  46. </if>
  47. <if test="filter.czry!=null and filter.czry!=''">
  48. and a.czrybm=#{filter.czry}
  49. </if>
  50. )
  51. </select>
  52. <resultMap id="yhhLogMap" type="com.tofly.feesapi.yhgl.entity.YhhLog">
  53. <id property="bh" column="BH"/>
  54. <result property="czrq" column="CZRQ"/>
  55. <result property="ssgs" column="SSGS"/>
  56. <result property="yhbh" column="YHBH"/>
  57. <result property="yhdz" column="YHDZ"/>
  58. <result property="yhxm" column="YHXM"/>
  59. <result property="xhsqr" column="XHSQR"/>
  60. <result property="xhdh" column="XHDH"/>
  61. <result property="xhsj" column="XHSJ"/>
  62. <result property="bz" column="BZ"/>
  63. <result property="czrybm" column="CZRYBM"/>
  64. <result property="czryxm" column="CZRYXM"/>
  65. <result property="sbzd" column="SBZD"/>
  66. <result property="sscbpq" column="SSCBPQ"/>
  67. <result property="sscbb" column="SSCBB"/>
  68. </resultMap>
  69. </mapper>