ReportSectionMapper.xml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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.dayou.mapper.ReportSectionMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.dayou.entity.ReportSection">
  6. <result column="id" property="id" />
  7. <result column="deleted" property="deleted" />
  8. <result column="created" property="created" />
  9. <result column="modified" property="modified" />
  10. <result column="report_id" property="reportId" />
  11. <result column="headline_id" property="headlineId" />
  12. <result column="section" property="section" />
  13. <result column="user_id" property="userId" />
  14. </resultMap>
  15. <!-- 通用查询结果列 -->
  16. <sql id="Base_Column_List">
  17. id,
  18. deleted,
  19. created,
  20. modified,
  21. report_id, headline_id, section, user_id
  22. </sql>
  23. <select id="getReportSectionTree" parameterType="java.lang.Long" resultType="com.dayou.vo.ReportSectionTreeVO">
  24. SELECT
  25. rh.id,
  26. rs.id as sectionId,
  27. rs.headline_name AS headline,
  28. rh.parent_id,
  29. rh.order_num,
  30. rh.root_id,
  31. rs.section,
  32. rs.report_id,
  33. u.NAME AS preUserName,
  34. rs.modified,
  35. rh.action
  36. FROM
  37. report_section rs
  38. LEFT JOIN report_main rm ON rm.id = rs.report_id
  39. AND rm.id = #{reportId}
  40. LEFT JOIN report_headline rh ON rs.headline_id = rh.id
  41. LEFT JOIN user u ON u.id = rs.user_id
  42. WHERE
  43. rh.deleted = 0
  44. AND rs.deleted = 0
  45. AND rm.deleted = 0
  46. </select>
  47. </mapper>