ReportMainMapper.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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.ReportMainMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.dayou.entity.ReportMain">
  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="headline_root_id" property="headlineRootId"/>
  11. <result column="report_type" property="reportType" />
  12. <result column="report_params" property="reportParams" />
  13. <result column="report_key" property="reportKey" />
  14. <result column="title" property="title" />
  15. <result column="url" property="url" />
  16. <result column="user_id" property="userId" />
  17. <result column="checker_id" property="checkerId" />
  18. <result column="status" property="status" />
  19. </resultMap>
  20. <!-- 通用查询结果列 -->
  21. <sql id="Base_Column_List">
  22. id,
  23. deleted,
  24. created,
  25. modified,
  26. headline_root_id,
  27. report_type,
  28. report_params, report_key, title, url, user_id, checker_id, status
  29. </sql>
  30. <select id="getPage" parameterType="com.dayou.vo.ReportMainVO" resultType="com.dayou.vo.ReportMainVO">
  31. SELECT
  32. rm.id,
  33. rm.created,
  34. rm.report_type,
  35. rm.report_key,
  36. rm.title,
  37. rm.url,
  38. u.name AS creator,
  39. u1.name as checker,
  40. status
  41. FROM
  42. report_main rm
  43. LEFT JOIN user u ON u.id = rm.user_id
  44. LEFT JOIN user u1 ON u1.id = rm.checker_id
  45. where rm.deleted = 0
  46. <if test="report!=null and report.reportType!=null">
  47. and rm.report_type = #{report.reportType}
  48. </if>
  49. <if test="report!=null and report.title and report.title!=''">
  50. and rm.title like concat('%',#{report.title},'%')
  51. </if>
  52. <if test="report!=null and report.creator!=null and report.creator!= '' ">
  53. and u.name like concat('%',#{report.creator},'%')
  54. </if>
  55. <if test="report!=null and report.checker!=null and report.checker!='' ">
  56. and u1.name like concat('%',#{report.checker},'%')
  57. </if>
  58. <if test="report!=null and report.status!=null and report.status!=''">
  59. and rm.status = #{report.status}
  60. </if>
  61. <if test="report!=null and report.url!=null and report.url!=''">
  62. and rm.url is not null
  63. </if>
  64. order by rm.id DESC
  65. </select>
  66. <select id="getReportMainSection" parameterType="java.lang.Long" resultType="com.dayou.dto.SectionTitleDTO">
  67. SELECT
  68. ifnull(rs.section,'') as section,
  69. rh.placeholder AS title
  70. FROM
  71. report_section rs
  72. LEFT JOIN report_headline rh ON rs.headline_id = rh.id
  73. WHERE
  74. rs.report_id =#{reportId} and rs.deleted = 0 and rh.deleted = 0
  75. </select>
  76. <select id="getReportMainVO" parameterType="java.lang.Long" resultType="com.dayou.vo.ReportMainVO">
  77. SELECT
  78. rm.id,
  79. rh.placeholder,
  80. rm.created,
  81. rh.headline AS type,
  82. rm.report_key,
  83. rm.title,
  84. rm.url,
  85. u.name AS creator,
  86. u1.name as checker,
  87. rm.status,
  88. rm.report_params
  89. FROM
  90. report_main rm
  91. LEFT JOIN report_headline rh ON rm.headline_root_id = rh.id
  92. LEFT JOIN user u ON u.id = rm.user_id
  93. LEFT JOIN user u1 ON u1.id = rm.checker_id
  94. where rm.deleted = 0 and rm.id = #{id}
  95. </select>
  96. <select id="getFtlConfig" parameterType="java.lang.String" resultType="com.dayou.bo.RichObject">
  97. SELECT
  98. ( SELECT `value` FROM global_config WHERE `key` = #{type} AND field = 'DOC_SRC_PARENT' ) AS 'docSrcParent',
  99. ( SELECT `value` FROM global_config WHERE `key` = #{type} AND field = 'DOC_SRC_LOCATION_PRE' ) AS 'docSrcLocationPrex',
  100. ( SELECT `value` FROM global_config WHERE `key` = #{type} AND field = 'NEXT_PART_ID' ) AS 'nextPartId',
  101. ( SELECT `value` FROM global_config WHERE `key` = #{type} AND field = 'SHAPE_ID_PREX' ) AS 'shapeidPrex',
  102. ( SELECT `value` FROM global_config WHERE `key` = #{type} AND field = 'SP_ID_PREX' ) AS 'spidPrex',
  103. ( SELECT `value` FROM global_config WHERE `key` = #{type} AND field = 'TYPE_ID' ) AS 'typeid',
  104. ( SELECT `value` FROM global_config WHERE `key` = #{type} AND field = 'FTL_PATH' ) AS 'ftlPath',
  105. ( SELECT `value` FROM global_config WHERE `key` = #{type} AND field = 'FTL_NAME' ) AS 'ftlName'
  106. </select>
  107. </mapper>