SysBlockinfoDao.xml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  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="cn.com.victorysoft.business.sys.dao.SysBlockinfoDao">
  4. <select id="selectByUnitField" resultType="SysBlockinfo" fetchSize="200">
  5. select distinct sb.BLOCKCODE, sb.BLOCKNAME
  6. from SYS_BLOCKINFO sb, water_well_basic wb
  7. where sb.BLOCKCODE = wb.BLOCKCODE
  8. and wb.unitcode in
  9. (select unitcode
  10. from SYS_UNITINFO
  11. start with UNITCODE = #{unitcode}
  12. connect by prior UNITCODE = P_UNITCODE)
  13. <if test="fieldcode != null and fieldcode != ''">
  14. and wb.fieldcode = #{fieldcode}
  15. </if>
  16. order by sb.BLOCKCODE
  17. </select>
  18. <select id="selectByUnitBlock" resultType="SysBlockinfo" fetchSize="20">
  19. select distinct sb.BLOCKCODE, sb.BLOCKNAME
  20. from SYS_BLOCKINFO sb, water_well_basic wb
  21. where sb.BLOCKCODE = wb.QKDM
  22. and wb.DWDM in
  23. (select unitcode
  24. from SYS_UNITINFO
  25. start with UNITCODE = #{unitcode}
  26. connect by prior UNITCODE = P_UNITCODE)
  27. <if test="blockname != null and blockname != ''">
  28. and sb.BLOCKNAME like '%' || #{blockname} || '%'
  29. </if>
  30. order by (case when sb.BLOCKCODE = sb.BLOCKNAME then 1 else 0 end),
  31. sb.BLOCKNAME
  32. </select>
  33. </mapper>