OrganizationEvaluationInfoMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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.OrganizationEvaluationInfoMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.ims.eval.entity.OrganizationEvaluationInfo">
  6. <id column="id" property="id" />
  7. <result column="organization_evaluation_id" property="organizationEvaluationId" />
  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. </resultMap>
  20. <!-- 通用查询结果列 -->
  21. <sql id="Base_Column_List">
  22. id, organization_evaluation_id, indicator_id, indicator_dictionary_id, option_code, is_quantified, quantified_value, non_quantified_value, create_time, create_by, update_time, update_by, remark
  23. </sql>
  24. <!-- <update id="updateEvaluationInfo">-->
  25. <!-- <foreach collection="evaluationInfos" item="item" index="index" separator=";">-->
  26. <!-- <trim suffixOverrides=",">-->
  27. <!-- UPDATE organization_evaluation_info-->
  28. <!-- SET quantified_Value = ${item.quantifiedValue},-->
  29. <!-- non_Quantified_Value = '${item.nonQuantifiedValue}'-->
  30. <!-- WHERE id = '${item.id}'-->
  31. <!-- </trim>-->
  32. <!-- </foreach>-->
  33. <!-- </update>-->
  34. <select id="selectListEvaluationInfoId"
  35. resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO">
  36. select
  37. ei.id,
  38. oe.id organizationEvaluationId,
  39. ei.indicator_id,
  40. ei.is_quantified,
  41. be.stage_name,
  42. be.id binStage,
  43. bn.id binSection,
  44. bn.section_name,
  45. oer.id organizationEvaluationRuleId,
  46. oer.organization_name,
  47. oer.organization_short_name,
  48. dd.key_name deptName,
  49. it.type_name,
  50. i.indicator_name,
  51. id.child_name,
  52. id.option_name,
  53. id.option_code,
  54. ei.quantified_value,
  55. ei.non_quantified_value,
  56. i.unit,
  57. ei.state
  58. from
  59. organization_evaluation_info ei
  60. inner join organization_evaluation_rule oer on oer.id = ei.organization_evaluation_rule_id
  61. inner join organization_evaluation oe on oe.id = ei.organization_evaluation_id
  62. left join indicator i on ei.indicator_id = i.id
  63. left join evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
  64. left join bin_stage be on i.bin_stage = be.id
  65. left join bin_section bn on i.bin_section = bn.id
  66. left join indicator_type it on i.indicator_type_id = it.id
  67. left join indicator_dictionary id on ei.indicator_dictionary_id = id.id
  68. inner join data_dictionary dd on dd.data_key = i.dept_id
  69. <where>
  70. <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
  71. and ei.organization_evaluation_id = #{organizationEvaluationId}
  72. </if>
  73. <if test="optionCode !=null and optionCode !=''">
  74. and ei.option_code = #{optionCode}
  75. </if>
  76. <if test="dept !=null and dept !=''">
  77. and dd.key_name = #{dept}
  78. </if>
  79. <if test="organizationId !=null and organizationId !=''">
  80. and oer.organization_id = #{organizationId}
  81. </if>
  82. and id.option_code not in ('CZ','CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','WCLDF','LRGXKHMAX','LRGXKHMIN')
  83. </where>
  84. order by be.order_num,oer.organization_short_name,bn.order_num,ri.order_num,id.child_code,id.option_code,id.option_order asc
  85. </select>
  86. <select id="selectByEvaluationInfoId" resultType="com.ims.eval.entity.OrganizationEvaluationInfo">
  87. SELECT
  88. *
  89. FROM
  90. organization_evaluation_info a
  91. <where>
  92. 1=1
  93. <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
  94. and a.organization_evaluation_id=#{organizationEvaluationId}
  95. </if>
  96. </where>
  97. </select>
  98. <select id="selectByIndicatorDictionaryId" resultType="com.ims.eval.entity.OrganizationEvaluationInfo">
  99. SELECT
  100. *
  101. FROM
  102. organization_evaluation_info a
  103. <where>
  104. 1=1
  105. <if test="indicatorDictionaryId !=null and indicatorDictionaryId !=''">
  106. and a.indicator_dictionary_id=#{indicatorDictionaryId}
  107. </if>
  108. </where>
  109. </select>
  110. <select id="selectListEvaluationInfoId2"
  111. resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO">
  112. select
  113. ei.id,
  114. oe.id organizationEvaluationId,
  115. ei.indicator_id,
  116. ei.is_quantified,
  117. be.stage_name,
  118. be.id binStage,
  119. bn.id binSection,
  120. bn.section_name,
  121. oer.id organizationEvaluationRuleId,
  122. oer.organization_name,
  123. oer.organization_short_name,
  124. dd.key_name deptName,
  125. it.type_name,
  126. i.indicator_name,
  127. id.child_name,
  128. id.option_name,
  129. id.option_code,
  130. ei.quantified_value,
  131. ei.non_quantified_value,
  132. i.unit,
  133. ei.state
  134. from
  135. organization_evaluation_info ei
  136. inner join organization_evaluation_rule oer on oer.id = ei.organization_evaluation_rule_id
  137. inner join organization_evaluation oe on oe.id = ei.organization_evaluation_id
  138. left join indicator i on ei.indicator_id = i.id
  139. left join evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
  140. left join bin_stage be on i.bin_stage = be.id
  141. left join bin_section bn on i.bin_section = bn.id
  142. left join indicator_type it on i.indicator_type_id = it.id
  143. left join indicator_dictionary id on ei.indicator_dictionary_id = id.id
  144. inner join data_dictionary dd on dd.data_key = i.dept_id
  145. <where>
  146. <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
  147. and ei.organization_evaluation_id = #{organizationEvaluationId}
  148. </if>
  149. <if test="optionCode !=null and optionCode !=''">
  150. and ei.option_code = #{optionCode}
  151. </if>
  152. <if test="dept !=null and dept !=''">
  153. and dd.key_name like CONCAT('%',#{dept},'%')
  154. </if>
  155. <if test="organizationShortName !=null and organizationShortName !=''">
  156. and oer.organization_short_name like CONCAT('%',#{organizationShortName},'%')
  157. </if>
  158. <if test="indicatorName !=null and indicatorName !=''">
  159. and i.indicator_name like CONCAT('%',#{indicatorName},'%')
  160. </if>
  161. <if test="binSection !=null and binSection !=''">
  162. and bn.id = #{binSection}
  163. </if>
  164. <if test="isQuantified !=null and isQuantified !=''">
  165. and ei.is_quantified = #{isQuantified}
  166. </if>
  167. <if test="organizationId !=null and organizationId !=''">
  168. and oer.organization_id = #{organizationId}
  169. </if>
  170. and id.option_code not in ('DF','DF2','CZ','CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','WCLDF','LRGXKHMAX','LRGXKHMIN')
  171. and id.is_show = true
  172. </where>
  173. order by oer.organization_short_name,be.order_num,oer.organization_short_name,bn.order_num,ri.order_num,id.option_order asc
  174. </select>
  175. <select id="selectByIdAndEvaluationInfoId" resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO">
  176. select
  177. ei.id,
  178. oe.id organizationEvaluationId,
  179. ei.indicator_id,
  180. ei.is_quantified,
  181. be.stage_name,
  182. be.id binStage,
  183. bn.id binSection,
  184. bn.section_name,
  185. oer.id organizationEvaluationRuleId,
  186. oer.organization_name,
  187. oer.organization_short_name,
  188. dd.key_name deptName,
  189. it.type_name,
  190. i.indicator_name,
  191. id.child_name,
  192. id.child_code,
  193. id.option_name,
  194. id.option_code,
  195. id.formula,
  196. ei.quantified_value,
  197. ei.non_quantified_value,
  198. i.unit,
  199. ei.state,
  200. ri.standard_score
  201. from
  202. organization_evaluation_info ei
  203. inner join organization_evaluation_rule oer on oer.id = ei.organization_evaluation_rule_id
  204. inner join organization_evaluation oe on oe.id = ei.organization_evaluation_id
  205. left join indicator i on ei.indicator_id = i.id
  206. left join evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
  207. left join bin_stage be on i.bin_stage = be.id
  208. left join bin_section bn on i.bin_section = bn.id
  209. left join indicator_type it on i.indicator_type_id = it.id
  210. left join indicator_dictionary id on ei.indicator_dictionary_id = id.id
  211. inner join data_dictionary dd on dd.data_key = i.dept_id
  212. <where>
  213. <if test="id !=null and id !=''">
  214. and ei.id = #{id}
  215. </if>
  216. <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
  217. and ei.organization_evaluation_id = #{organizationEvaluationId}
  218. </if>
  219. <if test="optionCode !=null and optionCode !=''">
  220. and id.option_code = #{optionCode}
  221. </if>
  222. </where>
  223. order by be.order_num,oer.organization_short_name,bn.order_num,ri.order_num,id.option_order asc
  224. </select>
  225. <select id="selectEvaluationIndicatorList" resultType="java.util.Map">
  226. select DISTINCT i.id,i.indicator_name from organization_evaluation_info ei
  227. LEFT JOIN evaluate_rule_info ri on ei.evaluate_rule_info_id = ri.id
  228. LEFT JOIN evaluate_rule er on er.id = ri.evaluate_rule_id
  229. INNER JOIN indicator i on i.id = ri.indicator_id
  230. <where>
  231. <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
  232. and ei.organization_evaluation_id = #{organizationEvaluationId}
  233. </if>
  234. <if test="binSection !=null and binSection !=''">
  235. and er.bin_section = #{binSection}
  236. </if>
  237. <if test="binStage !=null and binStage !=''">
  238. and er.bin_stage = #{binStage}
  239. </if>
  240. </where>
  241. </select>
  242. <select id="selectEvaluationInfoList" resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO">
  243. select
  244. ei.id,
  245. oe.id organizationEvaluationId,
  246. ei.indicator_id,
  247. ei.is_quantified,
  248. id.is_quantified isQuantified2,
  249. be.stage_name,
  250. be.id binStage,
  251. bn.id binSection,
  252. bn.section_name,
  253. oer.id organizationEvaluationRuleId,
  254. oer.organization_name,
  255. oer.organization_id,
  256. oer.organization_short_name,
  257. dd.key_name deptName,
  258. it.type_name,
  259. i.indicator_name,
  260. id.child_name,
  261. id.child_code,
  262. id.option_name,
  263. id.option_code,
  264. ei.quantified_value,
  265. ei.non_quantified_value,
  266. i.unit,
  267. ei.state
  268. from
  269. organization_evaluation_info ei
  270. inner join organization_evaluation_rule oer on oer.id = ei.organization_evaluation_rule_id
  271. inner join organization_evaluation oe on oe.id = ei.organization_evaluation_id
  272. left join indicator i on ei.indicator_id = i.id
  273. left join evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
  274. left join bin_stage be on i.bin_stage = be.id
  275. left join bin_section bn on i.bin_section = bn.id
  276. left join indicator_type it on i.indicator_type_id = it.id
  277. left join indicator_dictionary id on ei.indicator_dictionary_id = id.id
  278. inner join data_dictionary dd on dd.data_key = i.dept_id
  279. <where>
  280. <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
  281. and ei.organization_evaluation_id = #{organizationEvaluationId}
  282. </if>
  283. <if test="indicatorId !=null and indicatorId !=''">
  284. and ei.indicator_id = #{indicatorId}
  285. </if>
  286. <if test="binSection !=null and binSection !=''">
  287. and bn.id = #{binSection}
  288. </if>
  289. <if test="binStage !=null and binStage !=''">
  290. and be.id = #{binStage}
  291. </if>
  292. and id.option_code not in ('CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','WCLDF','LRGXKHMAX','LRGXKHMIN')
  293. </where>
  294. order by be.order_num,oer.organization_short_name,bn.order_num,ri.order_num,id.child_code,id.option_code,id.option_order asc
  295. </select>
  296. </mapper>