BmSjMapper.xml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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.bmgl.mapper.BmSjMapper">
  4. <select id="selectMaxId" resultType="int">
  5. SELECT NVL(MAX(to_number(CODE + 0)), 0)
  6. FROM BM_SJ
  7. </select>
  8. <sql id="querySql">
  9. SELECT a.ssgs, a.code, a.name, b.name AS yslxmc,
  10. a.jtbz, a.sj, a.jt1_zs, a.jt1_sj, a.jt2_zs, a.jt2_sj, a.jt3_zs, a.jt3_sj,
  11. a.jt4_zs, a.jt4_sj, a.wsfdj, a.ljfdj,a.szyfdj,a.jtrksl,a.jtrkjs , a.czsj, a.isdisabled
  12. FROM BM_SJ a
  13. LEFT JOIN bm_yslx b on a.yslx=b.code
  14. WHERE 1=1
  15. <!--模糊查询 -->
  16. <if test="filter.searchText!=null">
  17. AND (a.code like '%${filter.searchText}%'
  18. OR a.name like '%${filter.searchText}%')
  19. </if>
  20. <!--所属公司-->
  21. <if test="filter.ssgs!=null">
  22. AND a.ssgs=#{filter.ssgs}
  23. </if>
  24. <!--用水类型-->
  25. <if test="filter.yslx!=null">
  26. AND a.yslx=#{filter.yslx}
  27. </if>
  28. <if test="filter.isdisabled!=null">
  29. AND a.isdisabled = #{filter.isdisabled}
  30. </if>
  31. AND a.isshow='1'
  32. ORDER BY to_number(a.CODE) ASC
  33. </sql>
  34. <select id="getPage" resultType="com.tofly.feesapi.bmgl.entity.dto.BmSjSelectDto">
  35. <include refid="querySql"/>
  36. </select>
  37. <select id="getList" resultType="com.tofly.feesapi.bmgl.entity.dto.BmSjSelectDto">
  38. <include refid="querySql"></include>
  39. </select>
  40. </mapper>