|
@@ -5,144 +5,163 @@
|
|
|
<mapper namespace="com.jjt.hl.mapper.HlMetricsMapper">
|
|
|
|
|
|
<resultMap type="HlMetrics" id="HlMetricsResult">
|
|
|
- <result property="hlMetricsId" column="HL_METRICS_ID"/>
|
|
|
- <result property="hlClassId" column="HL_CLASS_ID"/>
|
|
|
- <result property="metricsId" column="METRICS_ID"/>
|
|
|
- <result property="hlScore" column="HL_SCORE"/>
|
|
|
- <result property="hlStand" column="HL_STAND"/>
|
|
|
- <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="hlMetricsId" column="HL_METRICS_ID"/>
|
|
|
+ <result property="hlClassId" column="HL_CLASS_ID"/>
|
|
|
+ <result property="metricsId" column="METRICS_ID"/>
|
|
|
+ <result property="hlScore" column="HL_SCORE"/>
|
|
|
+ <result property="hlStand" column="HL_STAND"/>
|
|
|
+ <result property="metricsName" column="METRICS_NAME"/>
|
|
|
+ <result property="metricsCode" column="METRICS_CODE"/>
|
|
|
+ <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="selectHlMetricsVo">
|
|
|
- select HL_METRICS_ID, HL_CLASS_ID, METRICS_ID, HL_SCORE, HL_STAND, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK
|
|
|
- from hl_metrics
|
|
|
+ select *
|
|
|
+ from (select a.*, b.METRICS_NAME, b.METRICS_CODE
|
|
|
+ from hl_metrics a,
|
|
|
+ metrics_def b
|
|
|
+ where a.METRICS_ID = b.METRICS_ID) t
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectHlMetricsList" parameterType="HlMetrics" resultMap="HlMetricsResult">
|
|
|
<include refid="selectHlMetricsVo"/>
|
|
|
<where>
|
|
|
- <if test="hlClassId != null ">
|
|
|
- and HL_CLASS_ID = #{hlClassId}
|
|
|
- </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="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="hlClassId != null ">
|
|
|
+ and HL_CLASS_ID = #{hlClassId}
|
|
|
+ </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="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="selectHlMetricsByHlMetricsId" parameterType="Long"
|
|
|
resultMap="HlMetricsResult">
|
|
|
- <include refid="selectHlMetricsVo"/>
|
|
|
- where HL_METRICS_ID = #{hlMetricsId}
|
|
|
+ <include refid="selectHlMetricsVo"/>
|
|
|
+ where HL_METRICS_ID = #{hlMetricsId}
|
|
|
+ </select>
|
|
|
+ <select id="selectHlMetricsList4ModelId" resultType="com.jjt.hl.domain.HlMetrics">
|
|
|
+ SELECT metrics_id, metrics_name, metrics_code
|
|
|
+ FROM metrics_def
|
|
|
+ WHERE metrics_id IN (SELECT metrics_id
|
|
|
+ from biz_obj_metrics
|
|
|
+ WHERE obj_id in (SELECT a.obj_id
|
|
|
+ FROM biz_model_detail a,
|
|
|
+ biz_obj b
|
|
|
+ WHERE a.obj_id = b.obj_id
|
|
|
+ AND b.obj_type = #{objType}
|
|
|
+ AND a.MODEL_ID = #{modelId})
|
|
|
+ group BY metrics_id)
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertHlMetrics" parameterType="HlMetrics" useGeneratedKeys="true"
|
|
|
keyProperty="hlMetricsId">
|
|
|
insert into hl_metrics
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="hlClassId != null">HL_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="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="hlClassId != null">HL_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="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="hlClassId != null">#{hlClassId},
|
|
|
- </if>
|
|
|
- <if test="metricsId != null">#{metricsId},
|
|
|
- </if>
|
|
|
- <if test="hlScore != null">#{hlScore},
|
|
|
- </if>
|
|
|
- <if test="hlStand != null">#{hlStand},
|
|
|
- </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="hlClassId != null">#{hlClassId},
|
|
|
+ </if>
|
|
|
+ <if test="metricsId != null">#{metricsId},
|
|
|
+ </if>
|
|
|
+ <if test="hlScore != null">#{hlScore},
|
|
|
+ </if>
|
|
|
+ <if test="hlStand != null">#{hlStand},
|
|
|
+ </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="updateHlMetrics" parameterType="HlMetrics">
|
|
|
update hl_metrics
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="hlClassId != null">HL_CLASS_ID =
|
|
|
- #{hlClassId},
|
|
|
- </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="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="hlClassId != null">HL_CLASS_ID =
|
|
|
+ #{hlClassId},
|
|
|
+ </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="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 HL_METRICS_ID = #{hlMetricsId}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteHlMetricsByHlMetricsId" parameterType="Long">
|
|
|
delete
|
|
|
- from hl_metrics where HL_METRICS_ID = #{hlMetricsId}
|
|
|
+ from hl_metrics
|
|
|
+ where HL_METRICS_ID = #{hlMetricsId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteHlMetricsByHlMetricsIds" parameterType="String">
|