hlf hace 11 meses
padre
commit
191ad7b5a8

+ 16 - 5
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluateRuleServiceImpl.java

@@ -204,11 +204,22 @@ public class EvaluateRuleServiceImpl extends ServiceImpl<EvaluateRuleMapper, Eva
 
 	@Override
 	public EvaluateRule getEvaluateRuleListByYear(String year, String checkCycle, String manageCategory) {
-		if ("海外".equals(manageCategory)) {
-			manageCategory = "国际业务";
-		}
-		if ("综合".equals(manageCategory)) {
-			manageCategory = "综合支持";
+		if ("火电".equals(manageCategory)) {
+			manageCategory = "HD";
+		} else if ("水电".equals(manageCategory)) {
+			manageCategory = "SD";
+		} else if ("新能源".equals(manageCategory)) {
+			manageCategory = "XNYFG";
+		} else if ("风电".equals(manageCategory)) {
+			manageCategory = "FD";
+		} else if ("光伏".equals(manageCategory)) {
+			manageCategory = "GD";
+		} else if ("煤电".equals(manageCategory)) {
+			manageCategory = "MDYTH";
+		} else if ("海外".equals(manageCategory)) {
+			manageCategory = "GJYW";
+		} else if ("综合".equals(manageCategory)) {
+			manageCategory = "ZHZC";
 		}
 		return baseMapper.getEvaluateRuleListByYear(year, checkCycle, manageCategory);
 	}

+ 73 - 67
ims-service/ims-eval/src/main/resources/mappers/EvaluateRuleMapper.xml

@@ -4,74 +4,75 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.ims.eval.entity.EvaluateRule">
-        <id column="id" property="id" />
-        <result column="bin_section" property="binSection" />
-        <result column="bin_stage" property="binStage" />
-        <result column="des" property="des" />
-        <result column="create_time" property="createTime" />
-        <result column="create_by" property="createBy" />
-        <result column="update_time" property="updateTime" />
-        <result column="update_by" property="updateBy" />
-        <result column="enable" property="enable" />
-        <result column="rule_name" property="ruleName" />
+        <id column="id" property="id"/>
+        <result column="bin_section" property="binSection"/>
+        <result column="bin_stage" property="binStage"/>
+        <result column="des" property="des"/>
+        <result column="create_time" property="createTime"/>
+        <result column="create_by" property="createBy"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="update_by" property="updateBy"/>
+        <result column="enable" property="enable"/>
+        <result column="rule_name" property="ruleName"/>
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, bin_section, bin_stage, des, create_time, create_by, update_time, update_by, enable, rule_name
+        id
+        , bin_section, bin_stage, des, create_time, create_by, update_time, update_by, enable, rule_name
     </sql>
     <select id="selectListPage" resultType="com.ims.eval.entity.EvaluateRule">
-            SELECT
-            r.*,
-            b.stage_name binStageName,
-            bs.section_name binSectionName
-            FROM
-            evaluate_rule r
-            LEFT JOIN bin_stage b  ON r.bin_stage = b.id
-            LEFT JOIN bin_section bs  ON r.bin_section = bs.id
-            <where>
-
-                r.enable = true
-
-                <if test="id !=null and id !=''">
-                    AND r.id = #{id}
-                </if>
-                <if test="des !=null and des !=''">
-                    AND r.des like   CONCAT('%',#{des},'%')
-                </if>
-
-                <if test="binSection !=null and binSection !=''">
-                    AND r.bin_section = #{binSection}
-                </if>
-
-                <if test="binStage !=null and binStage !=''">
-                    AND r.bin_stage = #{binStage}
-                </if>
-                <if test="checkCycle !=null and checkCycle !=''">
-                    AND r.check_cycle = #{checkCycle}
-                </if>
-                <if test="year !=null and year !=''">
-                    AND r.year = #{year}
-                </if>
-
-                order by  r.year,r.bin_section desc
-            </where>
+        SELECT
+        r.*,
+        b.stage_name binStageName,
+        bs.section_name binSectionName
+        FROM
+        evaluate_rule r
+        LEFT JOIN bin_stage b ON r.bin_stage = b.id
+        LEFT JOIN bin_section bs ON r.bin_section = bs.id
+        <where>
+
+            r.enable = true
+
+            <if test="id !=null and id !=''">
+                AND r.id = #{id}
+            </if>
+            <if test="des !=null and des !=''">
+                AND r.des like CONCAT('%',#{des},'%')
+            </if>
+
+            <if test="binSection !=null and binSection !=''">
+                AND r.bin_section = #{binSection}
+            </if>
+
+            <if test="binStage !=null and binStage !=''">
+                AND r.bin_stage = #{binStage}
+            </if>
+            <if test="checkCycle !=null and checkCycle !=''">
+                AND r.check_cycle = #{checkCycle}
+            </if>
+            <if test="year !=null and year !=''">
+                AND r.year = #{year}
+            </if>
+
+            order by r.year,r.bin_section desc
+        </where>
 
     </select>
     <select id="selectListInIdsInfos" resultType="com.ims.eval.entity.dto.response.EvaluateRuleInfoResDTO">
-            SELECT
-            ri.*,
-            r.bin_section,
-            r.bin_stage,
-            r.rule_name,
-            r.enable,
-            b.stage_name binStageName,
-            bs.section_name binSectionName
-            FROM
-            evaluate_rule r
-			inner join evaluate_rule_info ri on r.id = ri.evaluate_rule_id
-            LEFT JOIN bin_stage b  ON r.bin_stage = b.id
-            LEFT JOIN bin_section bs  ON r.bin_section = bs.id
+        SELECT
+        ri.*,
+        r.bin_section,
+        r.bin_stage,
+        r.rule_name,
+        r.enable,
+        b.stage_name binStageName,
+        bs.section_name binSectionName
+        FROM
+        evaluate_rule r
+        inner join evaluate_rule_info ri on r.id = ri.evaluate_rule_id
+        LEFT JOIN bin_stage b ON r.bin_stage = b.id
+        LEFT JOIN bin_section bs ON r.bin_section = bs.id
         <where>
 
             <if test="ids !=null">
@@ -98,8 +99,8 @@
         bs.section_name binSectionName
         FROM
         evaluate_rule r
-        LEFT JOIN bin_stage b  ON r.bin_stage = b.id
-        LEFT JOIN bin_section bs  ON r.bin_section = bs.id
+        LEFT JOIN bin_stage b ON r.bin_stage = b.id
+        LEFT JOIN bin_section bs ON r.bin_section = bs.id
         <where>
 
             r.enable = true
@@ -117,22 +118,27 @@
                 AND r.year = #{year}
             </if>
 
-            order by  r.create_time desc
+            order by r.create_time desc
         </where>
 
     </select>
     <select id="getEvaluateRuleListByYear" resultType="com.ims.eval.entity.EvaluateRule">
-        select * from evaluate_rule
+        select
+            er.*
+        from
+            evaluate_rule er
+        LEFT JOIN bin_stage bst ON er.bin_stage = bst.id
+        LEFT JOIN bin_section bse ON er.bin_section = bse.id
         <where>
-            enable = true
+            er.enable = true
             <if test="year != null and year != ''">
-                AND year = #{year}
+                AND er.year = #{year}
             </if>
             <if test="checkCycle != null and checkCycle != ''">
-                AND check_cycle = #{checkCycle}
+                AND er.check_cycle = #{checkCycle}
             </if>
             <if test="manageCategory != null and manageCategory != ''">
-                AND des like CONCAT('%',#{manageCategory},'%') AND des not like '%基建%'
+                AND bst.stage_code = 'SCJY' AND bse.section_code = #{manageCategory}
             </if>
         </where>
     </select>