YhBtLogMapper.xml 3.1 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.YhBtLogMapper">
  4. <!--获取用户最大ID -->
  5. <select id="selectMaxId" resultType="int">
  6. select nvl(max(to_number(bh)), 0) bh
  7. from yh_bt_log
  8. </select>
  9. <select id="selectDaCustomerBtPage" resultType="com.tofly.feesapi.yhgl.entity.vo.YhBtLogSelect">
  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 yh_bt_log a
  16. left join bm_cbpq cbpq on a.sscbpq=cbpq.cbpqbm
  17. left join bm_cbb cbb on a.sscbb=cbb.cbbbm
  18. where 1=1
  19. <!--模糊查询 -->
  20. <if test="filter.searchText != null and filter.searchText != ''">
  21. and ( a.yhbh like '%${filter.searchText}%' or
  22. a.yhxm like '%${filter.searchText}%' or
  23. a.yhdz like '%${filter.searchText}%' or
  24. a.btdh like '%${filter.searchText}%' )
  25. </if>
  26. <!--公司 -->
  27. <if test="filter.ssgs !=null and filter.ssgs!='' and filter.ssgs!='all'">
  28. and a.ssgs=#{filter.ssgs}
  29. </if>
  30. <!--片区 -->
  31. <if test="filter.sscbpq !=null and filter.sscbpq!='' and filter.sscbpq!='all' ">
  32. and a.sscbpq=#{filter.sscbpq}
  33. </if>
  34. <!--抄表本 -->
  35. <if test="filter.sscbb !=null and filter.sscbb!='' and filter.sscbb!='all'">
  36. and a.sscbb=#{filter.sscbb}
  37. </if>
  38. <if test="filter.qyfzr!=null">
  39. and a.sscbb in(select cbbbm from bm_cbb where qyfzr=#{filter.qyfzr})
  40. </if>
  41. <!--报停时间-->
  42. <if test="filter.ksrq!=null and filter.ksrq!='' and filter.jsrq!=null and filter.jsrq!='' ">
  43. and a.btsj between to_date(#{filter.ksrq},'yyyy-mm-dd hh24:mi:ss') and
  44. to_date(#{filter.jsrq},'yyyy-mm-dd hh24:mi:ss')
  45. </if>
  46. <if test="filter.czry!=null and filter.czry!=''">
  47. and a.czrybm=#{filter.czry}
  48. </if>
  49. )
  50. </select>
  51. <resultMap id="yhBtLogMap" type="com.tofly.feesapi.yhgl.entity.YhBtLog">
  52. <id property="bh" column="BH"/>
  53. <result property="ssgs" column="SSGS"/>
  54. <result property="sscbpq" column="SSCBPQ"/>
  55. <result property="sscbb" column="SSCBB"/>
  56. <result property="czrq" column="CZRQ"/>
  57. <result property="yhbh" column="YHBH"/>
  58. <result property="yhdz" column="YHDZ"/>
  59. <result property="yhxm" column="YHXM"/>
  60. <result property="btsqr" column="BTSQR"/>
  61. <result property="btdh" column="BTDH"/>
  62. <result property="btsj" column="BTSJ"/>
  63. <result property="bz" column="BZ"/>
  64. <result property="czrybm" column="CZRYBM"/>
  65. <result property="czryxm" column="CZRYXM"/>
  66. <result property="hfysbz" column="HFYSBZ"/>
  67. <result property="hfbtsj" column="HFBTSJ"/>
  68. </resultMap>
  69. </mapper>