PerformanceBenchmarkInfoMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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.ims.eval.dao.PerformanceBenchmarkInfoMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.ims.eval.entity.PerformanceBenchmarkInfo">
  6. <id column="id" property="id"/>
  7. <result column="check_cycle" property="checkCycle"/>
  8. <result column="degree_year" property="degreeYear"/>
  9. <result column="quarterly_month" property="quarterlyMonth"/>
  10. <result column="manage_category" property="manageCategory"/>
  11. <result column="company_id" property="companyId"/>
  12. <result column="company_name" property="companyName"/>
  13. <result column="company_short" property="companyShort"/>
  14. <result column="install_capacity" property="installCapacity"/>
  15. <result column="index_name" property="indexName"/>
  16. <result column="planned_value" property="plannedValue"/>
  17. <result column="complete_value" property="completeValue"/>
  18. <result column="recommended_value" property="recommendedValue"/>
  19. <result column="scaling_value" property="scalingValue"/>
  20. <result column="is_bg" property="isBg"/>
  21. <result column="bg_val" property="bgVal"/>
  22. <result column="is_db" property="isDb"/>
  23. <result column="db_val" property="dbVal"/>
  24. <result column="is_cb" property="isCb"/>
  25. <result column="cb_val" property="cbVal"/>
  26. </resultMap>
  27. <!-- 通用查询结果列 -->
  28. <sql id="selectPerformanceBenchmarkInfoVo">
  29. select id,
  30. check_cycle,
  31. degree_year,
  32. quarterly_month,
  33. manage_category,
  34. company_id,
  35. company_name,
  36. company_short,
  37. install_capacity,
  38. index_name,
  39. planned_value,
  40. complete_value,
  41. recommended_value,
  42. scaling_value,
  43. is_bg,
  44. bg_val,
  45. is_db,
  46. db_val,
  47. is_cb,
  48. cb_val
  49. from performance_benchmark_info
  50. </sql>
  51. <select id="selectListPage" resultType="com.ims.eval.entity.PerformanceBenchmarkInfo">
  52. select * from performance_benchmark_info
  53. <where>
  54. <if test="manageCategory != null and manageCategory != ''">
  55. AND manage_category = #{manageCategory}
  56. </if>
  57. <if test="checkCycle != null and checkCycle != ''">
  58. AND check_cycle = #{checkCycle}
  59. </if>
  60. <if test="degreeYear != null and degreeYear != ''">
  61. AND degree_year = #{degreeYear}
  62. </if>
  63. <if test="quarterlyMonth != null and quarterlyMonth != ''">
  64. AND quarterly_month = #{quarterlyMonth}
  65. </if>
  66. <if test="isBg == 1">
  67. AND is_bg = 1 order by bg_val desc
  68. </if>
  69. <if test="isDb == 2">
  70. AND is_db = 1 AND is_cb = 1 order by cb_val, db_val desc
  71. </if>
  72. <if test="isCb == 3">
  73. AND is_cb = 1 order by cb_val desc
  74. </if>
  75. </where>
  76. </select>
  77. <select id="selectList" resultType="com.ims.eval.entity.PerformanceBenchmarkInfo">
  78. select * from performance_benchmark_info
  79. <where>
  80. <if test="manageCategory != null and manageCategory != ''">
  81. AND manage_category = #{manageCategory}
  82. </if>
  83. <if test="checkCycle != null and checkCycle != ''">
  84. AND check_cycle = #{checkCycle}
  85. </if>
  86. <if test="degreeYear != null and degreeYear != ''">
  87. AND degree_year = #{degreeYear}
  88. </if>
  89. <if test="quarterlyMonth != null and quarterlyMonth != ''">
  90. AND quarterly_month = #{quarterlyMonth}
  91. </if>
  92. </where>
  93. </select>
  94. <select id="selectListByIndexName" resultType="com.ims.eval.entity.PerformanceBenchmarkInfo">
  95. select * from performance_benchmark_info
  96. <where>
  97. <if test="manageCategory != null and manageCategory != ''">
  98. AND manage_category = #{manageCategory}
  99. </if>
  100. <if test="checkCycle != null and checkCycle != ''">
  101. AND check_cycle = #{checkCycle}
  102. </if>
  103. <if test="degreeYear != null and degreeYear != ''">
  104. AND degree_year = #{degreeYear}
  105. </if>
  106. <if test="quarterlyMonth != null and quarterlyMonth != ''">
  107. AND quarterly_month = #{quarterlyMonth}
  108. </if>
  109. <if test="indexName != null and indexName != ''">
  110. AND index_name = #{indexName}
  111. </if>
  112. </where>
  113. </select>
  114. <select id="getExportExcelData" resultType="com.ims.eval.entity.PerformanceBenchmarkInfo">
  115. select * from performance_benchmark_info
  116. <where>
  117. <if test="manageCategory != null and manageCategory != ''">
  118. AND manage_category = #{manageCategory}
  119. </if>
  120. <if test="checkCycle != null and checkCycle != ''">
  121. AND check_cycle = #{checkCycle}
  122. </if>
  123. <if test="degreeYear != null and degreeYear != ''">
  124. AND degree_year = #{degreeYear}
  125. </if>
  126. <if test="quarterlyMonth != null and quarterlyMonth != ''">
  127. AND quarterly_month = #{quarterlyMonth}
  128. </if>
  129. <if test="isBg == 1">
  130. AND is_bg = 1 order by bg_val desc
  131. </if>
  132. <if test="isDb == 2">
  133. AND is_db = 1 AND is_cb = 1 order by cb_val, db_val desc
  134. </if>
  135. <if test="isCb == 3">
  136. AND is_cb = 1 order by cb_val desc
  137. </if>
  138. </where>
  139. </select>
  140. </mapper>