OrganizationEvaluationRuleMapper.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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.OrganizationEvaluationRuleMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.ims.eval.entity.OrganizationEvaluationRule">
  6. <id column="id" property="id" />
  7. <result column="organization_name" property="organizationName" />
  8. <result column="organization_id" property="organizationId" />
  9. <result column="organization_type" property="organizationType" />
  10. <result column="bin_section" property="binSection" />
  11. <result column="bin_stage" property="binStage" />
  12. <result column="evaluation_cycle" property="evaluationCycle" />
  13. <result column="evaluate_rule_id" property="evaluateRuleId" />
  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="del_flag" property="delFlag" />
  19. <result column="is_check" property="isCheck" />
  20. <result column="order_num" property="orderNum" />
  21. </resultMap>
  22. <!-- 通用查询结果列 -->
  23. <sql id="Base_Column_List">
  24. id, organization_name, organization_id, organization_type, bin_section, bin_stage, evaluation_cycle, evaluate_rule_id, create_time, create_by, update_time, update_by, del_flag, is_check, order_num, year, month
  25. </sql>
  26. <select id="list" resultType="com.ims.eval.entity.OrganizationEvaluationRule">
  27. SELECT
  28. r.*,
  29. i.rule_name,
  30. bs.section_name binSectionName
  31. FROM
  32. organization_evaluation_rule r
  33. LEFT JOIN evaluate_rule i ON r.evaluate_rule_id = i.ID
  34. LEFT JOIN bin_section bs ON r.bin_section = bs.id
  35. <where>
  36. and r.del_flag = false
  37. <if test="id !=null and id !=''">
  38. AND r.id = #{id}
  39. </if>
  40. <if test="organizationName !=null and organizationName !=''">
  41. AND r.organization_name like CONCAT('%',#{organizationName},'%')
  42. </if>
  43. <if test="organizationId !=null and organizationId !=''">
  44. AND r.organization_id = #{organizationId}
  45. </if>
  46. <if test="organizationType !=null and organizationType !=''">
  47. AND r.organization_type = #{organizationType}
  48. </if>
  49. <if test="binSection !=null and binSection !=''">
  50. AND r.bin_section = #{binSection}
  51. </if>
  52. <if test="binStage !=null and binStage !=''">
  53. AND r.bin_stage = #{binStage}
  54. </if>
  55. <if test="evaluationCycle !=null and evaluationCycle !=''">
  56. AND r.evaluation_cycle = #{evaluationCycle}
  57. </if>
  58. order by order_num asc
  59. </where>
  60. </select>
  61. <select id="selectListAll" resultType="com.ims.eval.entity.OrganizationEvaluationRule">
  62. SELECT
  63. r.*,i.rule_name
  64. FROM
  65. organization_evaluation_rule r
  66. LEFT JOIN evaluate_rule i ON r.evaluate_rule_id = i.ID
  67. <where>
  68. and r.del_flag = false
  69. <if test="id !=null and id !=''">
  70. AND r.id = #{id}
  71. </if>
  72. <if test="organizationName !=null and organizationName !=''">
  73. AND r.organization_name like CONCAT('%',#{organizationName},'%')
  74. </if>
  75. <if test="organizationId !=null and organizationId !=''">
  76. AND r.organization_id = #{organizationId}
  77. </if>
  78. <if test="organizationType !=null and organizationType !=''">
  79. AND r.organization_type = #{organizationType}
  80. </if>
  81. <if test="binSection !=null and binSection !=''">
  82. AND r.bin_section = #{binSection}
  83. </if>
  84. <if test="binStage !=null and binStage !=''">
  85. AND r.bin_stage = #{binStage}
  86. </if>
  87. <if test="evaluationCycle !=null and evaluationCycle !=''">
  88. AND r.evaluation_cycle = #{evaluationCycle}
  89. </if>
  90. order by order_num asc
  91. </where>
  92. </select>
  93. <select id="selectOrganizationRuleId" resultType="com.ims.eval.entity.OrganizationEvaluationRule">
  94. SELECT
  95. r.*,
  96. i.rule_name,
  97. bs.section_name binSectionName,
  98. be.stage_name binStageName
  99. FROM
  100. organization_evaluation_rule r
  101. LEFT JOIN evaluate_rule i ON r.evaluate_rule_id = i.ID
  102. LEFT JOIN bin_section bs ON r.bin_section = bs.id
  103. LEFT JOIN bin_stage be on be.id = r.bin_stage
  104. <where>
  105. <if test="ids !=null">
  106. AND r.id in
  107. <foreach item="item" collection="ids" separator="," open="(" close=")" index="">'${item}'</foreach>
  108. </if>
  109. order by order_num asc
  110. </where>
  111. </select>
  112. </mapper>