Ver código fonte

健康度模拟分数

wukai 9 meses atrás
pai
commit
ab5ac1a1c3

+ 34 - 107
jjt-biz/src/main/java/com/jjt/hl/domain/HlClassScore.java

@@ -1,13 +1,14 @@
 package com.jjt.hl.domain;
 
-import java.math.BigDecimal;
 import com.baomidou.mybatisplus.annotation.TableId;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
 import com.jjt.common.annotation.Excel;
 import com.jjt.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
 
 /**
  * 模型健康度分类得分对象 hl_class_score
@@ -16,139 +17,65 @@ import com.jjt.common.core.domain.BaseEntity;
  * @date 2024-09-05
  */
 @ApiModel(value = "HlClassScore", description = "模型健康度分类得分")
-public class HlClassScore extends BaseEntity
-{
+@Data
+public class HlClassScore extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 健康度分类ID */
+    /**
+     * 健康度分类ID
+     */
     @ApiModelProperty("健康度分类ID")
     @TableId
     private Long scoreClassId;
 
-    /** 健康度分数记录ID */
+    /**
+     * 健康度分数记录ID
+     */
     @ApiModelProperty("健康度分数记录ID")
     @Excel(name = "健康度分数记录ID")
     private Long hlScoreId;
 
-    /** 模型ID */
+    /**
+     * 模型ID
+     */
     @ApiModelProperty("模型ID")
     @Excel(name = "模型ID")
     private Long modelId;
 
-    /** 业务类型 */
+    /**
+     * 业务类型
+     */
     @ApiModelProperty("业务类型")
     @Excel(name = "业务类型")
     private String objType;
 
-    /** 细项分 */
+    /**
+     * 细项分
+     */
     @ApiModelProperty("细项分")
     @Excel(name = "细项分")
     private String scoreType;
 
-    /** 健康度分值 */
+    /**
+     * 健康度分值
+     */
     @ApiModelProperty("健康度分值")
     @Excel(name = "健康度分值")
     private BigDecimal hlScore;
 
-    /** 扣分 */
+    /**
+     * 扣分
+     */
     @ApiModelProperty("扣分")
     @Excel(name = "扣分")
     private BigDecimal loseScore;
 
-    /** 得分 */
+    /**
+     * 得分
+     */
     @ApiModelProperty("得分")
     @Excel(name = "得分")
     private BigDecimal score;
-
-    public void setScoreClassId(Long scoreClassId)
-    {
-        this.scoreClassId = scoreClassId;
-    }
-
-    public Long getScoreClassId()
-    {
-        return scoreClassId;
-    }
-    public void setHlScoreId(Long hlScoreId)
-    {
-        this.hlScoreId = hlScoreId;
-    }
-
-    public Long getHlScoreId()
-    {
-        return hlScoreId;
-    }
-    public void setModelId(Long modelId)
-    {
-        this.modelId = modelId;
-    }
-
-    public Long getModelId()
-    {
-        return modelId;
-    }
-    public void setObjType(String objType)
-    {
-        this.objType = objType;
-    }
-
-    public String getObjType()
-    {
-        return objType;
-    }
-    public void setScoreType(String scoreType)
-    {
-        this.scoreType = scoreType;
-    }
-
-    public String getScoreType()
-    {
-        return scoreType;
-    }
-    public void setHlScore(BigDecimal hlScore)
-    {
-        this.hlScore = hlScore;
-    }
-
-    public BigDecimal getHlScore()
-    {
-        return hlScore;
-    }
-    public void setLoseScore(BigDecimal loseScore)
-    {
-        this.loseScore = loseScore;
-    }
-
-    public BigDecimal getLoseScore()
-    {
-        return loseScore;
-    }
-    public void setScore(BigDecimal score)
-    {
-        this.score = score;
-    }
-
-    public BigDecimal getScore()
-    {
-        return score;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("scoreClassId", getScoreClassId())
-            .append("hlScoreId", getHlScoreId())
-            .append("modelId", getModelId())
-            .append("objType", getObjType())
-            .append("scoreType", getScoreType())
-            .append("hlScore", getHlScore())
-            .append("loseScore", getLoseScore())
-            .append("score", getScore())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("remark", getRemark())
-            .toString();
-    }
+    @ApiModelProperty("对象列表")
+    private List<HlObj> hlObjList;
 }

+ 4 - 0
jjt-biz/src/main/java/com/jjt/hl/domain/HlMetricsScore.java

@@ -40,7 +40,11 @@ public class HlMetricsScore extends BaseEntity {
     @ApiModelProperty("指标ID")
     @Excel(name = "指标ID")
     private Long metricsId;
+    @ApiModelProperty("指标名称")
+    private String metricsName;
 
+    @ApiModelProperty("指标编码")
+    private String metricsCode;
     /**
      * 健康度分值
      */

+ 3 - 1
jjt-biz/src/main/java/com/jjt/hl/service/IHlScoreService.java

@@ -2,6 +2,7 @@ package com.jjt.hl.service;
 
 import com.jjt.hl.domain.HlScore;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -66,6 +67,7 @@ public interface IHlScoreService {
 
     /**
      * 日健康度评分
+     * @param date 时间
      */
-    void yesterday();
+    void day(Date date);
 }

+ 65 - 4
jjt-biz/src/main/java/com/jjt/hl/service/impl/HlScoreServiceImpl.java

@@ -158,7 +158,7 @@ public class HlScoreServiceImpl implements IHlScoreService {
 //                    BizObjMetrics
 //                    BizObjMetricsData
                     BigDecimal ss = random(hlMetrics.getHlScore().intValue());
-                    BigDecimal lose = hlMetrics.getHlScore().multiply(ss);
+                    BigDecimal lose = hlMetrics.getHlScore().subtract(ss);
                     loseScore = loseScore.add(lose);
                     HlMetricsScore metricsScore = new HlMetricsScore();
                     BeanUtils.copyBeanProp(metricsScore, hlMetrics);
@@ -178,22 +178,83 @@ public class HlScoreServiceImpl implements IHlScoreService {
                 }
                 hlClassScore.setLoseScore(loseScore);
                 totalLose = totalLose.add(loseScore);
-                BigDecimal df = hlClassScore.getHlScore().multiply(loseScore);
+                BigDecimal df = hlClassScore.getHlScore().subtract(loseScore);
                 hlClassScore.setScore(df);
                 hlClassScoreService.updateHlClassScore(hlClassScore);
             }
 
-            score.setHlScore(BigDecimal.valueOf(100).multiply(totalLose));
+            score.setHlScore(BigDecimal.valueOf(100).subtract(totalLose));
             updateHlScore(score);
         }
     }
 
     /**
      * 日健康度评分
+     *
+     * @param date 时间
      */
     @Override
-    public void yesterday() {
+    public void day(Date date) {
+//暂时先模拟分数
+        //1.获取所有模型
+        //2.获取模型健康度指标分类
+        //3.1.获取对象
+        //3.2.获取指标
+        //
+        List<BizModel> modelList = modelService.selectBizModelList(new BizModel());
+        for (BizModel model : modelList) {
+            HlScore score = new HlScore();
+            score.setModelId(model.getModelId());
+            score.setHlDate(date);
+            score.setHlType("2");
+            insertHlScore(score);
+            BigDecimal totalLose = BigDecimal.ZERO;
+            List<HlClass> classList = modelService.selectHlClassList4modelId(model.getModelId());
+            for (HlClass hlClass : classList) {
+                HlClassScore hlClassScore = new HlClassScore();
+                BeanUtils.copyBeanProp(hlClassScore, hlClass);
+                hlClassScore.setHlScoreId(score.getHlScoreId());
+                List<HlObj> hlObjList = hlObjService.selectHlObjListByClassId(hlClass.getHlClassId());
+                hlClassScoreService.insertHlClassScore(hlClassScore);
+                HlMetrics hm = new HlMetrics();
+                hm.setHlClassId(hlClass.getHlClassId());
+                List<HlMetrics> hlMetricsList = hlMetricsService.selectHlMetricsList(hm);
+                BigDecimal loseScore = BigDecimal.ZERO;
+                //1.均分 2.细项分
+//                hlClass.getScoreType();
+                for (HlMetrics hlMetrics : hlMetricsList) {
+                    //TODO ..这里需要从对象指标表里面去找。
+//                    BizObjMetrics
+//                    BizObjMetricsData
+                    BigDecimal ss = random(hlMetrics.getHlScore().intValue());
+                    BigDecimal lose = hlMetrics.getHlScore().subtract(ss);
+                    loseScore = loseScore.add(lose);
+                    HlMetricsScore metricsScore = new HlMetricsScore();
+                    BeanUtils.copyBeanProp(metricsScore, hlMetrics);
+                    metricsScore.setLoseScore(lose);
+                    metricsScore.setScore(ss);
+                    metricsScore.setScoreClassId(hlClassScore.getScoreClassId());
+                    hlMetricsScoreService.insertHlMetricsScore(metricsScore);
+//                    if (flag()) {
+//                        //TODO 模拟扣分判断
+//                        if ("1".equals(hlClassScore.getScoreType())) {
+//                            //均分
+////                            Random
+//                        } else {
+//                            //细项分
+//                        }
+//                    }
+                }
+                hlClassScore.setLoseScore(loseScore);
+                totalLose = totalLose.add(loseScore);
+                BigDecimal df = hlClassScore.getHlScore().subtract(loseScore);
+                hlClassScore.setScore(df);
+                hlClassScoreService.updateHlClassScore(hlClassScore);
+            }
 
+            score.setHlScore(BigDecimal.valueOf(100).subtract(totalLose));
+            updateHlScore(score);
+        }
     }
 
     /**

+ 10 - 2
jjt-biz/src/main/java/com/jjt/task/HlTask.java

@@ -5,6 +5,9 @@ import com.jjt.hl.service.IHlScoreService;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.util.Date;
 
 /**
  * 定时任务调度测试
@@ -20,8 +23,13 @@ public class HlTask {
         scoreService.score();
     }
 
-    public void yesterday() {
-        scoreService.yesterday();
+    public void day() {
+        LocalDate time = LocalDate.now().minusDays(8);
+        for (int j = 0; j < 7; j++) {
+            time = time.plusDays(1);
+            Date date = Date.from(time.atStartOfDay(ZoneId.systemDefault()).toInstant());
+            scoreService.day(date);
+        }
     }
 
     public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {

+ 167 - 138
jjt-biz/src/main/resources/mapper/hl/HlClassScoreMapper.xml

@@ -5,177 +5,206 @@
 <mapper namespace="com.jjt.hl.mapper.HlClassScoreMapper">
 
     <resultMap type="HlClassScore" id="HlClassScoreResult">
-            <result property="scoreClassId" column="SCORE_CLASS_ID"/>
-            <result property="hlScoreId" column="HL_SCORE_ID"/>
-            <result property="modelId" column="MODEL_ID"/>
-            <result property="objType" column="OBJ_TYPE"/>
-            <result property="scoreType" column="SCORE_TYPE"/>
-            <result property="hlScore" column="HL_SCORE"/>
-            <result property="loseScore" column="LOSE_SCORE"/>
-            <result property="score" column="SCORE"/>
-            <result property="createBy" column="CREATE_BY"/>
-            <result property="createTime" column="CREATE_TIME"/>
-            <result property="updateBy" column="UPDATE_BY"/>
-            <result property="updateTime" column="UPDATE_TIME"/>
-            <result property="remark" column="REMARK"/>
+        <result property="scoreClassId" column="SCORE_CLASS_ID"/>
+        <result property="hlScoreId" column="HL_SCORE_ID"/>
+        <result property="modelId" column="MODEL_ID"/>
+        <result property="objType" column="OBJ_TYPE"/>
+        <result property="scoreType" column="SCORE_TYPE"/>
+        <result property="hlScore" column="HL_SCORE"/>
+        <result property="loseScore" column="LOSE_SCORE"/>
+        <result property="score" column="SCORE"/>
+        <result property="createBy" column="CREATE_BY"/>
+        <result property="createTime" column="CREATE_TIME"/>
+        <result property="updateBy" column="UPDATE_BY"/>
+        <result property="updateTime" column="UPDATE_TIME"/>
+        <result property="remark" column="REMARK"/>
+        <collection property="hlObjList" javaType="java.util.List" resultMap="hlObjResult"/>
+    </resultMap>
+    <resultMap id="hlObjResult" type="HlObj">
+        <result property="hlObjId" column="HL_OBJ_ID"/>
+        <result property="hlClassId" column="HL_CLASS_ID"/>
+        <result property="objId" column="OBJ_ID"/>
+        <result property="objName" column="OBJ_NAME"/>
+        <result property="objType" column="OBJ_TYPE"/>
     </resultMap>
 
     <sql id="selectHlClassScoreVo">
-        select SCORE_CLASS_ID, HL_SCORE_ID, MODEL_ID, OBJ_TYPE, SCORE_TYPE, HL_SCORE, LOSE_SCORE, SCORE, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK
-        from hl_class_score
+        select *
+        from (SELECT A.SCORE_CLASS_ID,
+                     A.HL_SCORE_ID,
+                     A.MODEL_ID,
+                     A.OBJ_TYPE,
+                     A.SCORE_TYPE,
+                     A.HL_SCORE,
+                     A.LOSE_SCORE,
+                     A.SCORE,
+                     A.CREATE_BY,
+                     A.CREATE_TIME,
+                     A.UPDATE_BY,
+                     A.UPDATE_TIME,
+                     A.REMARK
+                     b.hl_obj_id,
+                     b.OBJ_ID,
+                     b.OBJ_NAME
+              from hl_class a
+                       left JOIN (SELECT a.*, b.OBJ_NAME, b.OBJ_TYPE
+                                  FROM hl_obj a,
+                                       biz_obj b
+                                  WHERE a.obj_id = b.obj_id) b ON a.hl_class_id = b.hl_class_id and a.obj_type=b.obj_type) t
     </sql>
 
     <select id="selectHlClassScoreList" parameterType="HlClassScore" resultMap="HlClassScoreResult">
         <include refid="selectHlClassScoreVo"/>
         <where>
-                        <if test="hlScoreId != null ">
-                            and HL_SCORE_ID = #{hlScoreId}
-                        </if>
-                        <if test="modelId != null ">
-                            and MODEL_ID = #{modelId}
-                        </if>
-                        <if test="objType != null  and objType != ''">
-                            and OBJ_TYPE = #{objType}
-                        </if>
-                        <if test="scoreType != null  and scoreType != ''">
-                            and SCORE_TYPE = #{scoreType}
-                        </if>
-                        <if test="hlScore != null ">
-                            and HL_SCORE = #{hlScore}
-                        </if>
-                        <if test="loseScore != null ">
-                            and LOSE_SCORE = #{loseScore}
-                        </if>
-                        <if test="score != null ">
-                            and SCORE = #{score}
-                        </if>
-                        <if test="createBy != null  and createBy != ''">
-                            and CREATE_BY = #{createBy}
-                        </if>
-                        <if test="createTime != null ">
-                            and CREATE_TIME = #{createTime}
-                        </if>
-                        <if test="updateBy != null  and updateBy != ''">
-                            and UPDATE_BY = #{updateBy}
-                        </if>
-                        <if test="updateTime != null ">
-                            and UPDATE_TIME = #{updateTime}
-                        </if>
-                        <if test="remark != null  and remark != ''">
-                            and REMARK = #{remark}
-                        </if>
+            <if test="hlScoreId != null ">
+                and HL_SCORE_ID = #{hlScoreId}
+            </if>
+            <if test="modelId != null ">
+                and MODEL_ID = #{modelId}
+            </if>
+            <if test="objType != null  and objType != ''">
+                and OBJ_TYPE = #{objType}
+            </if>
+            <if test="scoreType != null  and scoreType != ''">
+                and SCORE_TYPE = #{scoreType}
+            </if>
+            <if test="hlScore != null ">
+                and HL_SCORE = #{hlScore}
+            </if>
+            <if test="loseScore != null ">
+                and LOSE_SCORE = #{loseScore}
+            </if>
+            <if test="score != null ">
+                and SCORE = #{score}
+            </if>
+            <if test="createBy != null  and createBy != ''">
+                and CREATE_BY = #{createBy}
+            </if>
+            <if test="createTime != null ">
+                and CREATE_TIME = #{createTime}
+            </if>
+            <if test="updateBy != null  and updateBy != ''">
+                and UPDATE_BY = #{updateBy}
+            </if>
+            <if test="updateTime != null ">
+                and UPDATE_TIME = #{updateTime}
+            </if>
+            <if test="remark != null  and remark != ''">
+                and REMARK = #{remark}
+            </if>
         </where>
     </select>
 
     <select id="selectHlClassScoreByScoreClassId" parameterType="Long"
             resultMap="HlClassScoreResult">
-            <include refid="selectHlClassScoreVo"/>
-            where SCORE_CLASS_ID = #{scoreClassId}
+        <include refid="selectHlClassScoreVo"/>
+        where SCORE_CLASS_ID = #{scoreClassId}
     </select>
 
     <insert id="insertHlClassScore" parameterType="HlClassScore" useGeneratedKeys="true"
             keyProperty="scoreClassId">
         insert into hl_class_score
         <trim prefix="(" suffix=")" suffixOverrides=",">
-                    <if test="hlScoreId != null">HL_SCORE_ID,
-                    </if>
-                    <if test="modelId != null">MODEL_ID,
-                    </if>
-                    <if test="objType != null">OBJ_TYPE,
-                    </if>
-                    <if test="scoreType != null">SCORE_TYPE,
-                    </if>
-                    <if test="hlScore != null">HL_SCORE,
-                    </if>
-                    <if test="loseScore != null">LOSE_SCORE,
-                    </if>
-                    <if test="score != null">SCORE,
-                    </if>
-                    <if test="createBy != null">CREATE_BY,
-                    </if>
-                    <if test="createTime != null">CREATE_TIME,
-                    </if>
-                    <if test="updateBy != null">UPDATE_BY,
-                    </if>
-                    <if test="updateTime != null">UPDATE_TIME,
-                    </if>
-                    <if test="remark != null">REMARK,
-                    </if>
+            <if test="hlScoreId != null">HL_SCORE_ID,
+            </if>
+            <if test="modelId != null">MODEL_ID,
+            </if>
+            <if test="objType != null">OBJ_TYPE,
+            </if>
+            <if test="scoreType != null">SCORE_TYPE,
+            </if>
+            <if test="hlScore != null">HL_SCORE,
+            </if>
+            <if test="loseScore != null">LOSE_SCORE,
+            </if>
+            <if test="score != null">SCORE,
+            </if>
+            <if test="createBy != null">CREATE_BY,
+            </if>
+            <if test="createTime != null">CREATE_TIME,
+            </if>
+            <if test="updateBy != null">UPDATE_BY,
+            </if>
+            <if test="updateTime != null">UPDATE_TIME,
+            </if>
+            <if test="remark != null">REMARK,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-                    <if test="hlScoreId != null">#{hlScoreId},
-                    </if>
-                    <if test="modelId != null">#{modelId},
-                    </if>
-                    <if test="objType != null">#{objType},
-                    </if>
-                    <if test="scoreType != null">#{scoreType},
-                    </if>
-                    <if test="hlScore != null">#{hlScore},
-                    </if>
-                    <if test="loseScore != null">#{loseScore},
-                    </if>
-                    <if test="score != null">#{score},
-                    </if>
-                    <if test="createBy != null">#{createBy},
-                    </if>
-                    <if test="createTime != null">#{createTime},
-                    </if>
-                    <if test="updateBy != null">#{updateBy},
-                    </if>
-                    <if test="updateTime != null">#{updateTime},
-                    </if>
-                    <if test="remark != null">#{remark},
-                    </if>
+            <if test="hlScoreId != null">#{hlScoreId},
+            </if>
+            <if test="modelId != null">#{modelId},
+            </if>
+            <if test="objType != null">#{objType},
+            </if>
+            <if test="scoreType != null">#{scoreType},
+            </if>
+            <if test="hlScore != null">#{hlScore},
+            </if>
+            <if test="loseScore != null">#{loseScore},
+            </if>
+            <if test="score != null">#{score},
+            </if>
+            <if test="createBy != null">#{createBy},
+            </if>
+            <if test="createTime != null">#{createTime},
+            </if>
+            <if test="updateBy != null">#{updateBy},
+            </if>
+            <if test="updateTime != null">#{updateTime},
+            </if>
+            <if test="remark != null">#{remark},
+            </if>
         </trim>
     </insert>
 
     <update id="updateHlClassScore" parameterType="HlClassScore">
         update hl_class_score
         <trim prefix="SET" suffixOverrides=",">
-                    <if test="hlScoreId != null">HL_SCORE_ID =
-                        #{hlScoreId},
-                    </if>
-                    <if test="modelId != null">MODEL_ID =
-                        #{modelId},
-                    </if>
-                    <if test="objType != null">OBJ_TYPE =
-                        #{objType},
-                    </if>
-                    <if test="scoreType != null">SCORE_TYPE =
-                        #{scoreType},
-                    </if>
-                    <if test="hlScore != null">HL_SCORE =
-                        #{hlScore},
-                    </if>
-                    <if test="loseScore != null">LOSE_SCORE =
-                        #{loseScore},
-                    </if>
-                    <if test="score != null">SCORE =
-                        #{score},
-                    </if>
-                    <if test="createBy != null">CREATE_BY =
-                        #{createBy},
-                    </if>
-                    <if test="createTime != null">CREATE_TIME =
-                        #{createTime},
-                    </if>
-                    <if test="updateBy != null">UPDATE_BY =
-                        #{updateBy},
-                    </if>
-                    <if test="updateTime != null">UPDATE_TIME =
-                        #{updateTime},
-                    </if>
-                    <if test="remark != null">REMARK =
-                        #{remark},
-                    </if>
+            <if test="hlScoreId != null">HL_SCORE_ID =
+                #{hlScoreId},
+            </if>
+            <if test="modelId != null">MODEL_ID =
+                #{modelId},
+            </if>
+            <if test="objType != null">OBJ_TYPE =
+                #{objType},
+            </if>
+            <if test="scoreType != null">SCORE_TYPE =
+                #{scoreType},
+            </if>
+            <if test="hlScore != null">HL_SCORE =
+                #{hlScore},
+            </if>
+            <if test="loseScore != null">LOSE_SCORE =
+                #{loseScore},
+            </if>
+            <if test="score != null">SCORE =
+                #{score},
+            </if>
+            <if test="createBy != null">CREATE_BY =
+                #{createBy},
+            </if>
+            <if test="createTime != null">CREATE_TIME =
+                #{createTime},
+            </if>
+            <if test="updateBy != null">UPDATE_BY =
+                #{updateBy},
+            </if>
+            <if test="updateTime != null">UPDATE_TIME =
+                #{updateTime},
+            </if>
+            <if test="remark != null">REMARK =
+                #{remark},
+            </if>
         </trim>
         where SCORE_CLASS_ID = #{scoreClassId}
     </update>
 
     <delete id="deleteHlClassScoreByScoreClassId" parameterType="Long">
         delete
-        from hl_class_score where SCORE_CLASS_ID = #{scoreClassId}
+        from hl_class_score
+        where SCORE_CLASS_ID = #{scoreClassId}
     </delete>
 
     <delete id="deleteHlClassScoreByScoreClassIds" parameterType="String">

+ 133 - 127
jjt-biz/src/main/resources/mapper/hl/HlMetricsScoreMapper.xml

@@ -5,166 +5,172 @@
 <mapper namespace="com.jjt.hl.mapper.HlMetricsScoreMapper">
 
     <resultMap type="HlMetricsScore" id="HlMetricsScoreResult">
-            <result property="scoreMetricsId" column="SCORE_METRICS_ID"/>
-            <result property="scoreClassId" column="SCORE_CLASS_ID"/>
-            <result property="metricsId" column="METRICS_ID"/>
-            <result property="hlScore" column="HL_SCORE"/>
-            <result property="hlStand" column="HL_STAND"/>
-            <result property="loseScore" column="LOSE_SCORE"/>
-            <result property="score" column="SCORE"/>
-            <result property="createBy" column="CREATE_BY"/>
-            <result property="createTime" column="CREATE_TIME"/>
-            <result property="updateBy" column="UPDATE_BY"/>
-            <result property="updateTime" column="UPDATE_TIME"/>
-            <result property="remark" column="REMARK"/>
+        <result property="scoreMetricsId" column="SCORE_METRICS_ID"/>
+        <result property="scoreClassId" column="SCORE_CLASS_ID"/>
+        <result property="metricsId" column="METRICS_ID"/>
+        <result property="metricsName" column="METRICS_NAME"/>
+        <result property="metricsCode" column="METRICS_CODE"/>
+        <result property="hlScore" column="HL_SCORE"/>
+        <result property="hlStand" column="HL_STAND"/>
+        <result property="loseScore" column="LOSE_SCORE"/>
+        <result property="score" column="SCORE"/>
+        <result property="createBy" column="CREATE_BY"/>
+        <result property="createTime" column="CREATE_TIME"/>
+        <result property="updateBy" column="UPDATE_BY"/>
+        <result property="updateTime" column="UPDATE_TIME"/>
+        <result property="remark" column="REMARK"/>
     </resultMap>
 
     <sql id="selectHlMetricsScoreVo">
-        select SCORE_METRICS_ID, SCORE_CLASS_ID, METRICS_ID, HL_SCORE, HL_STAND, LOSE_SCORE, SCORE, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK
-        from hl_metrics_score
+        select *
+        from (select a.*, b.METRICS_NAME, b.METRICS_CODE
+              from hl_metrics_score a,
+                   metrics_def b
+              where a.METRICS_ID = b.METRICS_ID) t
     </sql>
 
     <select id="selectHlMetricsScoreList" parameterType="HlMetricsScore" resultMap="HlMetricsScoreResult">
         <include refid="selectHlMetricsScoreVo"/>
         <where>
-                        <if test="scoreClassId != null ">
-                            and SCORE_CLASS_ID = #{scoreClassId}
-                        </if>
-                        <if test="metricsId != null ">
-                            and METRICS_ID = #{metricsId}
-                        </if>
-                        <if test="hlScore != null  and hlScore != ''">
-                            and HL_SCORE = #{hlScore}
-                        </if>
-                        <if test="hlStand != null  and hlStand != ''">
-                            and HL_STAND = #{hlStand}
-                        </if>
-                        <if test="loseScore != null ">
-                            and LOSE_SCORE = #{loseScore}
-                        </if>
-                        <if test="score != null ">
-                            and SCORE = #{score}
-                        </if>
-                        <if test="createBy != null  and createBy != ''">
-                            and CREATE_BY = #{createBy}
-                        </if>
-                        <if test="createTime != null ">
-                            and CREATE_TIME = #{createTime}
-                        </if>
-                        <if test="updateBy != null  and updateBy != ''">
-                            and UPDATE_BY = #{updateBy}
-                        </if>
-                        <if test="updateTime != null ">
-                            and UPDATE_TIME = #{updateTime}
-                        </if>
-                        <if test="remark != null  and remark != ''">
-                            and REMARK = #{remark}
-                        </if>
+            <if test="scoreClassId != null ">
+                and SCORE_CLASS_ID = #{scoreClassId}
+            </if>
+            <if test="metricsId != null ">
+                and METRICS_ID = #{metricsId}
+            </if>
+            <if test="hlScore != null  and hlScore != ''">
+                and HL_SCORE = #{hlScore}
+            </if>
+            <if test="hlStand != null  and hlStand != ''">
+                and HL_STAND = #{hlStand}
+            </if>
+            <if test="loseScore != null ">
+                and LOSE_SCORE = #{loseScore}
+            </if>
+            <if test="score != null ">
+                and SCORE = #{score}
+            </if>
+            <if test="createBy != null  and createBy != ''">
+                and CREATE_BY = #{createBy}
+            </if>
+            <if test="createTime != null ">
+                and CREATE_TIME = #{createTime}
+            </if>
+            <if test="updateBy != null  and updateBy != ''">
+                and UPDATE_BY = #{updateBy}
+            </if>
+            <if test="updateTime != null ">
+                and UPDATE_TIME = #{updateTime}
+            </if>
+            <if test="remark != null  and remark != ''">
+                and REMARK = #{remark}
+            </if>
         </where>
     </select>
 
     <select id="selectHlMetricsScoreByScoreMetricsId" parameterType="Long"
             resultMap="HlMetricsScoreResult">
-            <include refid="selectHlMetricsScoreVo"/>
-            where SCORE_METRICS_ID = #{scoreMetricsId}
+        <include refid="selectHlMetricsScoreVo"/>
+        where SCORE_METRICS_ID = #{scoreMetricsId}
     </select>
 
     <insert id="insertHlMetricsScore" parameterType="HlMetricsScore" useGeneratedKeys="true"
             keyProperty="scoreMetricsId">
         insert into hl_metrics_score
         <trim prefix="(" suffix=")" suffixOverrides=",">
-                    <if test="scoreClassId != null">SCORE_CLASS_ID,
-                    </if>
-                    <if test="metricsId != null">METRICS_ID,
-                    </if>
-                    <if test="hlScore != null">HL_SCORE,
-                    </if>
-                    <if test="hlStand != null">HL_STAND,
-                    </if>
-                    <if test="loseScore != null">LOSE_SCORE,
-                    </if>
-                    <if test="score != null">SCORE,
-                    </if>
-                    <if test="createBy != null">CREATE_BY,
-                    </if>
-                    <if test="createTime != null">CREATE_TIME,
-                    </if>
-                    <if test="updateBy != null">UPDATE_BY,
-                    </if>
-                    <if test="updateTime != null">UPDATE_TIME,
-                    </if>
-                    <if test="remark != null">REMARK,
-                    </if>
+            <if test="scoreClassId != null">SCORE_CLASS_ID,
+            </if>
+            <if test="metricsId != null">METRICS_ID,
+            </if>
+            <if test="hlScore != null">HL_SCORE,
+            </if>
+            <if test="hlStand != null">HL_STAND,
+            </if>
+            <if test="loseScore != null">LOSE_SCORE,
+            </if>
+            <if test="score != null">SCORE,
+            </if>
+            <if test="createBy != null">CREATE_BY,
+            </if>
+            <if test="createTime != null">CREATE_TIME,
+            </if>
+            <if test="updateBy != null">UPDATE_BY,
+            </if>
+            <if test="updateTime != null">UPDATE_TIME,
+            </if>
+            <if test="remark != null">REMARK,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-                    <if test="scoreClassId != null">#{scoreClassId},
-                    </if>
-                    <if test="metricsId != null">#{metricsId},
-                    </if>
-                    <if test="hlScore != null">#{hlScore},
-                    </if>
-                    <if test="hlStand != null">#{hlStand},
-                    </if>
-                    <if test="loseScore != null">#{loseScore},
-                    </if>
-                    <if test="score != null">#{score},
-                    </if>
-                    <if test="createBy != null">#{createBy},
-                    </if>
-                    <if test="createTime != null">#{createTime},
-                    </if>
-                    <if test="updateBy != null">#{updateBy},
-                    </if>
-                    <if test="updateTime != null">#{updateTime},
-                    </if>
-                    <if test="remark != null">#{remark},
-                    </if>
+            <if test="scoreClassId != null">#{scoreClassId},
+            </if>
+            <if test="metricsId != null">#{metricsId},
+            </if>
+            <if test="hlScore != null">#{hlScore},
+            </if>
+            <if test="hlStand != null">#{hlStand},
+            </if>
+            <if test="loseScore != null">#{loseScore},
+            </if>
+            <if test="score != null">#{score},
+            </if>
+            <if test="createBy != null">#{createBy},
+            </if>
+            <if test="createTime != null">#{createTime},
+            </if>
+            <if test="updateBy != null">#{updateBy},
+            </if>
+            <if test="updateTime != null">#{updateTime},
+            </if>
+            <if test="remark != null">#{remark},
+            </if>
         </trim>
     </insert>
 
     <update id="updateHlMetricsScore" parameterType="HlMetricsScore">
         update hl_metrics_score
         <trim prefix="SET" suffixOverrides=",">
-                    <if test="scoreClassId != null">SCORE_CLASS_ID =
-                        #{scoreClassId},
-                    </if>
-                    <if test="metricsId != null">METRICS_ID =
-                        #{metricsId},
-                    </if>
-                    <if test="hlScore != null">HL_SCORE =
-                        #{hlScore},
-                    </if>
-                    <if test="hlStand != null">HL_STAND =
-                        #{hlStand},
-                    </if>
-                    <if test="loseScore != null">LOSE_SCORE =
-                        #{loseScore},
-                    </if>
-                    <if test="score != null">SCORE =
-                        #{score},
-                    </if>
-                    <if test="createBy != null">CREATE_BY =
-                        #{createBy},
-                    </if>
-                    <if test="createTime != null">CREATE_TIME =
-                        #{createTime},
-                    </if>
-                    <if test="updateBy != null">UPDATE_BY =
-                        #{updateBy},
-                    </if>
-                    <if test="updateTime != null">UPDATE_TIME =
-                        #{updateTime},
-                    </if>
-                    <if test="remark != null">REMARK =
-                        #{remark},
-                    </if>
+            <if test="scoreClassId != null">SCORE_CLASS_ID =
+                #{scoreClassId},
+            </if>
+            <if test="metricsId != null">METRICS_ID =
+                #{metricsId},
+            </if>
+            <if test="hlScore != null">HL_SCORE =
+                #{hlScore},
+            </if>
+            <if test="hlStand != null">HL_STAND =
+                #{hlStand},
+            </if>
+            <if test="loseScore != null">LOSE_SCORE =
+                #{loseScore},
+            </if>
+            <if test="score != null">SCORE =
+                #{score},
+            </if>
+            <if test="createBy != null">CREATE_BY =
+                #{createBy},
+            </if>
+            <if test="createTime != null">CREATE_TIME =
+                #{createTime},
+            </if>
+            <if test="updateBy != null">UPDATE_BY =
+                #{updateBy},
+            </if>
+            <if test="updateTime != null">UPDATE_TIME =
+                #{updateTime},
+            </if>
+            <if test="remark != null">REMARK =
+                #{remark},
+            </if>
         </trim>
         where SCORE_METRICS_ID = #{scoreMetricsId}
     </update>
 
     <delete id="deleteHlMetricsScoreByScoreMetricsId" parameterType="Long">
         delete
-        from hl_metrics_score where SCORE_METRICS_ID = #{scoreMetricsId}
+        from hl_metrics_score
+        where SCORE_METRICS_ID = #{scoreMetricsId}
     </delete>
 
     <delete id="deleteHlMetricsScoreByScoreMetricsIds" parameterType="String">