ZnbZlLogMapper.xml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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.cbgl.mapper.ZnbZlLogMapper">
  4. <sql id="querySql">
  5. SELECT a.*, d.yhxm, d.yhdz, g.cbpqmc AS sscbpqmc, f.cbbmc AS sscbbbm, e.name AS sccjmc
  6. FROM znb_zl_log a
  7. LEFT JOIN yh_khjbxx d on a.yhbh = d.yhbh
  8. LEFT JOIN bm_sbsccj e on a.sccj = e.code
  9. LEFT JOIN bm_cbb f on d.sscbb = f.cbbbm
  10. LEFT JOIN bm_cbpq g on d.sscbpq = g.cbpqbm
  11. WHERE 1=1
  12. <!--模糊查询 -->
  13. <if test="filter.searchText!=null">
  14. AND (a.yhbh like '%${filter.searchText}%'
  15. OR d.yhxm like '%${filter.searchText}%'
  16. OR d.yhdz like '%${filter.searchText}%')
  17. </if>
  18. <!--所属公司-->
  19. <if test="filter.ssgs!=null">
  20. AND d.ssgs=#{filter.ssgs}
  21. </if>
  22. <!--所属片区-->
  23. <if test="filter.sscbpq!=null">
  24. AND d.sscbpq=#{filter.sscbpq}
  25. </if>
  26. <!--所属抄表本-->
  27. <if test="filter.sscbb!=null">
  28. <choose>
  29. <when test="filter.sscbb.indexOf(',')!=-1">
  30. AND d.sscbb in
  31. <foreach item="item" index="index" collection="filter.sscbb.split(',')" open="(" separator=","
  32. close=")">
  33. #{item}
  34. </foreach>
  35. </when>
  36. <otherwise>
  37. AND d.sscbb=#{filter.sscbb}
  38. </otherwise>
  39. </choose>
  40. </if>
  41. <!--生产厂家-->
  42. <if test="filter.sscj!=null">
  43. AND a.sscj=#{filter.sscj}
  44. </if>
  45. <!-- 操作时间-->
  46. <if test="filter.czsjStart!=null and filter.czsjEnd!=null">
  47. AND a.czsj BETWEEN #{filter.czsjStart} AND
  48. #{filter.czsjEnd}
  49. </if>
  50. <!--处理结果-->
  51. <if test="filter.clCljg!=null">
  52. AND a.cl_cljg=#{filter.clCljg}
  53. </if>
  54. <!--锁定标志-->
  55. <if test="filter.clLock!=null">
  56. AND a.cl_lock=#{filter.clLock}
  57. </if>
  58. <!--指令类型编码-->
  59. <if test="filter.zltype!=null">
  60. AND a.zltype=#{filter.zlType}
  61. </if>
  62. </sql>
  63. <select id="getPage" resultType="com.tofly.feesapi.cbgl.entity.vo.ZnbZlLogSelect">
  64. <include refid="querySql"></include>
  65. </select>
  66. <select id="getList" resultType="com.tofly.feesapi.cbgl.entity.vo.ZnbZlLogSelect">
  67. <include refid="querySql"></include>
  68. </select>
  69. </mapper>