SystemCustomMapper.xml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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.persagy.dmp.rwd.simple.dao.SystemCustomMapper">
  4. <!-- 确定建筑不确定楼层 buildingId is not null , floorId is null -->
  5. <select id="querySystemNotSureFloor" resultType="java.util.Map">
  6. select * from dt_object
  7. where 1=1
  8. <include refid="commonWhereSql"/>
  9. <if test="null!=param.classCode and param.classCode.length>0">
  10. AND class_code = #{classCode}
  11. </if>
  12. AND id in
  13. (select obj_from from
  14. (
  15. select obj_from from dt_relation where rel_code='Sy2Bd' AND graph_code='MechInArch' AND obj_to=#{param.buildingId} AND obj_from not in
  16. (select obj_from from dt_relation where rel_code='Sy2Fl' AND graph_code='MechInArch' ) order by id asc
  17. <include refid="com.persagy.dmp.rwd.digital.dao.ObjectDigitalMapper.pageSet">
  18. <property name="param" value="#{param}"/>
  19. </include>
  20. ) temp
  21. )
  22. </select>
  23. <!-- 不确定建筑 buildingId is null-->
  24. <select id="querySystemNotSureBuilding" resultType="java.util.Map">
  25. SELECT * FROM `dt_object`
  26. where 1=1
  27. <include refid="commonWhereSql"/>
  28. <if test="null!=param.classCode and param.classCode.length>0">
  29. AND class_code = #{classCode}
  30. </if>
  31. AND id not in (select obj_from from dt_relation where rel_code='Sy2Bd' AND graph_code='MechInArch' order by id asc) ORDER BY id asc
  32. <include refid="com.persagy.dmp.rwd.digital.dao.ObjectDigitalMapper.pageSet">
  33. <property name="param" value="#{param}"/>
  34. </include>
  35. </select>
  36. <sql id="commonWhereSql">
  37. <if test="null!=param.objType and param.objType.length>0">
  38. AND obj_type=#{param.objType}
  39. </if>
  40. <if test="null!=param.projectId and param.projectId.length>0">
  41. AND project_id=#{param.projectId}
  42. </if>
  43. <if test="null!=param.groupCode and param.groupCode.length>0">
  44. AND group_code=#{param.groupCode}
  45. </if>
  46. </sql>
  47. </mapper>