ResponsibilityIndicatorInfoMapper.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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.ResponsibilityIndicatorInfoMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.ims.eval.entity.ResponsibilityIndicatorInfo">
  6. <id column="id" property="id"/>
  7. <result column="dept_responsibility_id" property="deptResponsibilityId"/>
  8. <result column="indicator_id" property="indicatorId"/>
  9. <result column="indicator_dictionary_id" property="indicatorDictionaryId"/>
  10. <result column="option_code" property="optionCode"/>
  11. <result column="is_quantified" property="isQuantified"/>
  12. <result column="quantified_value" property="quantifiedValue"/>
  13. <result column="non_quantified_value" property="nonQuantifiedValue"/>
  14. <result column="create_time" property="createTime"/>
  15. <result column="create_by" property="createBy"/>
  16. <result column="update_time" property="updateTime"/>
  17. <result column="update_by" property="updateBy"/>
  18. <result column="remark" property="remark"/>
  19. <result column="data_state" property="dataState"/>
  20. </resultMap>
  21. <!-- 通用查询结果列 -->
  22. <sql id="Base_Column_List">
  23. id
  24. , dept_responsibility_id, indicator_id, indicator_dictionary_id, option_code, is_quantified, quantified_value, non_quantified_value, create_time, create_by, update_time, update_by, remark, data_state
  25. </sql>
  26. <select id="listByresponsibilityId" resultType="com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO">
  27. select
  28. ri.id,
  29. ri.dept_responsibility_id,
  30. ri.indicator_id,
  31. ri.is_quantified,
  32. be.stage_name,
  33. be.id binStage,
  34. bn.id binSection,
  35. bn.section_name,
  36. oer.id organizationEvaluationRuleId,
  37. oer.organization_name,
  38. oer.organization_short_name,
  39. dd.key_name deptName,
  40. it.type_name,
  41. i.indicator_name,
  42. ri.quantified_value,
  43. ri.non_quantified_value,
  44. i.unit,
  45. ri.state
  46. from
  47. responsibility_indicator_info ri
  48. inner join dept_responsibility dr on dr.id = ri.dept_responsibility_id
  49. inner join organization_evaluation_rule oer on oer.id = ri.organization_evaluation_rule_id
  50. left join indicator i on ri.indicator_id = i.id
  51. left join bin_stage be on i.bin_stage = be.id
  52. left join bin_section bn on i.bin_section = bn.id
  53. left join indicator_type it on i.indicator_type_id = it.id
  54. inner join data_dictionary dd on dd.data_key = i.dept_id
  55. <where>
  56. ri.dept_responsibility_id in
  57. <foreach item="item" collection="deptResponsibilityIds" separator="," open="(" close=")" index="">
  58. '${item}'
  59. </foreach>
  60. <if test="optionCode !=null and optionCode !=''">
  61. and ri.option_code = #{optionCode}
  62. </if>
  63. <if test="dept !=null and dept !=''">
  64. and dd.key_name = #{dept}
  65. </if>
  66. <if test="organizationId !=null and organizationId !=''">
  67. and oer.organization_id = #{organizationId}
  68. </if>
  69. </where>
  70. order by oer.organization_id,dd.data_key,i.id desc
  71. </select>
  72. <select id="selectResponsibilityIndicatorInfoList" resultType="com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO">
  73. select
  74. ri.id,
  75. ri.dept_responsibility_id,
  76. ri.indicator_id,
  77. ri.is_quantified,
  78. ri.data_state,
  79. be.stage_name,
  80. be.id binStage,
  81. bn.id binSection,
  82. bn.section_name,
  83. oer.id organizationEvaluationRuleId,
  84. oer.organization_name,
  85. dd.key_name deptName,
  86. it.type_name,
  87. i.indicator_name,
  88. ri.quantified_value,
  89. ri.non_quantified_value,
  90. i.unit,
  91. ri.state
  92. from
  93. responsibility_indicator_info ri
  94. inner join dept_responsibility dr on dr.id = ri.dept_responsibility_id
  95. inner join organization_evaluation_rule oer on oer.id = ri.organization_evaluation_rule_id
  96. left join indicator i on ri.indicator_id = i.id
  97. left join bin_stage be on i.bin_stage = be.id
  98. left join bin_section bn on i.bin_section = bn.id
  99. left join indicator_type it on i.indicator_type_id = it.id
  100. inner join data_dictionary dd on dd.data_key = i.dept_id
  101. <where>
  102. <if test="deptResponsibilityId != null and deptResponsibilityId != ''">
  103. and ri.dept_responsibility_id = #{deptResponsibilityId}
  104. </if>
  105. <if test="isQuantified != null and isQuantified != ''">
  106. and ri.is_quantified = #{isQuantified}
  107. </if>
  108. <if test="dataState != null and dataState != ''">
  109. and ri.data_state = #{dataState}
  110. </if>
  111. </where>
  112. </select>
  113. <select id="selectResponsibilityIndicatorList" resultType="java.util.Map">
  114. select distinct
  115. i.id,
  116. i.indicator_name
  117. from
  118. responsibility_indicator_info ri
  119. inner join "indicator" i on i.id = ri.indicator_id
  120. <where>
  121. <if test="responsibilityId !=null and responsibilityId !=''">
  122. and ri.dept_responsibility_id = #{responsibilityId}
  123. </if>
  124. <if test="binSection !=null and binSection !=''">
  125. and i.bin_section = #{binSection}
  126. </if>
  127. <if test="binStage !=null and binStage !=''">
  128. and i.bin_stage = #{binStage}
  129. </if>
  130. </where>
  131. </select>
  132. <select id="getResponsibilityInfoList"
  133. resultType="com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO">
  134. select
  135. ri.id,
  136. ri.dept_responsibility_id,
  137. ri.option_code,
  138. d.option_name,
  139. ri.indicator_id,
  140. ri.is_quantified,
  141. ri.child_code,
  142. d.child_name,
  143. be.stage_name,
  144. be.id binStage,
  145. bn.id binSection,
  146. bn.section_name,
  147. oer.id organizationEvaluationRuleId,
  148. oer.organization_name,
  149. oer.organization_short_name,
  150. oer.organization_id,
  151. dd.key_name deptName,
  152. it.type_name,
  153. i.indicator_name,
  154. ri.quantified_value,
  155. ri.non_quantified_value,
  156. i.unit,
  157. ri.state
  158. from
  159. responsibility_indicator_info ri
  160. inner join dept_responsibility dr on dr.id = ri.dept_responsibility_id
  161. inner join organization_evaluation_rule oer on oer.id = ri.organization_evaluation_rule_id
  162. left join indicator i on ri.indicator_id = i.id
  163. left join indicator_dictionary d on ri.indicator_dictionary_id = d.id
  164. left join bin_stage be on i.bin_stage = be.id
  165. left join bin_section bn on i.bin_section = bn.id
  166. left join indicator_type it on i.indicator_type_id = it.id
  167. inner join data_dictionary dd on dd.data_key = i.dept_id
  168. <where>
  169. <if test="responsibilityId !=null and responsibilityId !=''">
  170. ri.dept_responsibility_id = #{responsibilityId}
  171. </if>
  172. <if test="organizationShortName !=null and organizationShortName !=''">
  173. and oer.organization_short_name like CONCAT('%',#{organizationShortName},'%')
  174. </if>
  175. <if test="binSection !=null and binSection !=''">
  176. and bn.id = #{binSection}
  177. </if>
  178. <if test="binStage !=null and binStage !=''">
  179. and be.id = #{binStage}
  180. </if>
  181. and ri.data_state = '有效'
  182. </where>
  183. order by ri.child_code desc
  184. </select>
  185. </mapper>