|
|
@@ -5,136 +5,223 @@
|
|
|
<mapper namespace="com.jjt.biz.mapper.RipaMetricsMapper">
|
|
|
|
|
|
<resultMap type="RipaMetrics" id="RipaMetricsResult">
|
|
|
- <result property="autoId" column="AUTO_ID"/>
|
|
|
- <result property="modelId" column="MODEL_ID"/>
|
|
|
- <result property="objMetricsId" column="OBJ_METRICS_ID"/>
|
|
|
- <result property="metricsName" column="METRICS_NAME"/>
|
|
|
- <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="autoId" column="AUTO_ID"/>
|
|
|
+ <result property="modelId" column="MODEL_ID"/>
|
|
|
+ <result property="modelName" column="MODEL_NAME"/>
|
|
|
+ <result property="objMetricsId" column="OBJ_METRICS_ID"/>
|
|
|
+ <result property="metricsName" column="METRICS_NAME"/>
|
|
|
+ <result property="objType" column="OBJ_TYPE"/>
|
|
|
+ <result property="objName" column="OBJ_NAME"/>
|
|
|
+ <result property="algoType" column="ALGO_TYPE"/>
|
|
|
+ <result property="ntr" column="NTR"/>
|
|
|
+ <result property="hov" column="HOV"/>
|
|
|
+ <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>
|
|
|
+
|
|
|
+ <resultMap type="com.jjt.biz.vo.ObjMetrics" id="ObjMetricsResult">
|
|
|
+ <result property="objType" column="OBJ_TYPE"/>
|
|
|
+ <result property="objName" column="OBJ_NAME"/>
|
|
|
+ <result property="metricsName" column="METRICS_NAME"/>
|
|
|
+ <result property="objMetricsId" column="OBJ_METRICS_ID"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectRipaMetricsVo">
|
|
|
- select AUTO_ID, MODEL_ID, OBJ_METRICS_ID, METRICS_NAME, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK
|
|
|
- from ripa_metrics
|
|
|
+ select *
|
|
|
+ from (select a.AUTO_ID,
|
|
|
+ a.MODEL_ID,
|
|
|
+ b.MODEL_NAME,
|
|
|
+ a.OBJ_METRICS_ID,
|
|
|
+ a.METRICS_NAME,
|
|
|
+ A.OBJ_TYPE,
|
|
|
+ A.OBJ_NAME,
|
|
|
+ A.ALGO_TYPE,
|
|
|
+ A.NTR,
|
|
|
+ A.HOV,
|
|
|
+ a.CREATE_BY,
|
|
|
+ a.CREATE_TIME,
|
|
|
+ a.UPDATE_BY,
|
|
|
+ a.UPDATE_TIME,
|
|
|
+ a.REMARK
|
|
|
+ from ripa_metrics a,
|
|
|
+ ripa_model b
|
|
|
+ where a.model_id = b.model_id) t
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectRipaMetricsList" parameterType="RipaMetrics" resultMap="RipaMetricsResult">
|
|
|
<include refid="selectRipaMetricsVo"/>
|
|
|
<where>
|
|
|
- <if test="modelId != null ">
|
|
|
- and MODEL_ID = #{modelId}
|
|
|
- </if>
|
|
|
- <if test="objMetricsId != null ">
|
|
|
- and OBJ_METRICS_ID = #{objMetricsId}
|
|
|
- </if>
|
|
|
- <if test="metricsName != null and metricsName != ''">
|
|
|
- and METRICS_NAME like concat('%', #{metricsName}, '%')
|
|
|
- </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="modelId != null ">
|
|
|
+ and (MODEL_ID=#{modelId} or MODEL_ID in(
|
|
|
+ select MODEL_ID from ripa_model where find_in_set(#{modelId}, remark)))
|
|
|
+ </if>
|
|
|
+ <if test="objMetricsId != null ">
|
|
|
+ and OBJ_METRICS_ID = #{objMetricsId}
|
|
|
+ </if>
|
|
|
+ <if test="metricsName != null and metricsName != ''">
|
|
|
+ and METRICS_NAME like concat('%', #{metricsName}, '%')
|
|
|
+ </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="selectRipaMetricsByAutoId" parameterType="Long"
|
|
|
resultMap="RipaMetricsResult">
|
|
|
- <include refid="selectRipaMetricsVo"/>
|
|
|
- where AUTO_ID = #{autoId}
|
|
|
+ <include refid="selectRipaMetricsVo"/>
|
|
|
+ where AUTO_ID = #{autoId}
|
|
|
</select>
|
|
|
- <select id="selectRiskMetricsList" resultType="java.util.Map">
|
|
|
- SELECT a.obj_type,a.obj_name,b.obj_metrics_id,metrics_name FROM biz_obj a,biz_obj_metrics b WHERE a.OBJ_ID=b.OBJ_ID
|
|
|
+ <select id="selectRiskMetricsList" parameterType="com.jjt.biz.vo.ObjMetrics" resultMap="ObjMetricsResult">
|
|
|
+ SELECT a.OBJ_TYPE, a.OBJ_NAME, b.METRICS_NAME, b.OBJ_METRICS_ID
|
|
|
+ FROM (SELECT B.DICT_LABEL OBJ_TYPE, A.OBJ_ID, A.OBJ_NAME
|
|
|
+ FROM biz_obj a,
|
|
|
+ (SELECT dict_value, dict_label FROM sys_dict_data WHERE dict_type = 'biz_type') b
|
|
|
+ WHERE a.OBJ_TYPE = b.dict_value) a,
|
|
|
+ biz_obj_metrics b
|
|
|
+ <where>
|
|
|
+ a.OBJ_ID = b.OBJ_ID
|
|
|
+ <if test="objMetricsId != null ">
|
|
|
+ and OBJ_METRICS_ID = #{objMetricsId}
|
|
|
+ </if>
|
|
|
+ <if test="metricsName != null and metricsName != ''">
|
|
|
+ and METRICS_NAME like concat('%', #{metricsName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
+ and OBJ_NAME like concat('%', #{objName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="objType != null and objType != ''">
|
|
|
+ and OBJ_TYPE like concat('%', #{objType}, '%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertRipaMetrics" parameterType="RipaMetrics" useGeneratedKeys="true"
|
|
|
keyProperty="autoId">
|
|
|
insert into ripa_metrics
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="modelId != null">MODEL_ID,
|
|
|
- </if>
|
|
|
- <if test="objMetricsId != null">OBJ_METRICS_ID,
|
|
|
- </if>
|
|
|
- <if test="metricsName != null">METRICS_NAME,
|
|
|
- </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="modelId != null">MODEL_ID,
|
|
|
+ </if>
|
|
|
+ <if test="objMetricsId != null">OBJ_METRICS_ID,
|
|
|
+ </if>
|
|
|
+ <if test="metricsName != null">METRICS_NAME,
|
|
|
+ </if>
|
|
|
+ <if test="objType != null">OBJ_TYPE,
|
|
|
+ </if>
|
|
|
+ <if test="objName != null">OBJ_NAME,
|
|
|
+ </if>
|
|
|
+ <if test="algoType != null">ALGO_TYPE,
|
|
|
+ </if>
|
|
|
+ <if test="ntr != null">NTR,
|
|
|
+ </if>
|
|
|
+ <if test="hov != null">HOV,
|
|
|
+ </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="modelId != null">#{modelId},
|
|
|
- </if>
|
|
|
- <if test="objMetricsId != null">#{objMetricsId},
|
|
|
- </if>
|
|
|
- <if test="metricsName != null">#{metricsName},
|
|
|
- </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="modelId != null">#{modelId},
|
|
|
+ </if>
|
|
|
+ <if test="objMetricsId != null">#{objMetricsId},
|
|
|
+ </if>
|
|
|
+ <if test="metricsName != null">#{metricsName},
|
|
|
+ </if>
|
|
|
+ <if test="objType != null">#{objType},
|
|
|
+ </if>
|
|
|
+ <if test="objName != null">#{objName},
|
|
|
+ </if>
|
|
|
+ <if test="algoType != null">#{algoType},
|
|
|
+ </if>
|
|
|
+ <if test="ntr != null">#{ntr},
|
|
|
+ </if>
|
|
|
+ <if test="hov != null">#{hov},
|
|
|
+ </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="updateRipaMetrics" parameterType="RipaMetrics">
|
|
|
update ripa_metrics
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="modelId != null">MODEL_ID =
|
|
|
- #{modelId},
|
|
|
- </if>
|
|
|
- <if test="objMetricsId != null">OBJ_METRICS_ID =
|
|
|
- #{objMetricsId},
|
|
|
- </if>
|
|
|
- <if test="metricsName != null">METRICS_NAME =
|
|
|
- #{metricsName},
|
|
|
- </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="modelId != null">MODEL_ID =
|
|
|
+ #{modelId},
|
|
|
+ </if>
|
|
|
+ <if test="objMetricsId != null">OBJ_METRICS_ID =
|
|
|
+ #{objMetricsId},
|
|
|
+ </if>
|
|
|
+ <if test="metricsName != null">METRICS_NAME =
|
|
|
+ #{metricsName},
|
|
|
+ </if>
|
|
|
+ <if test="objType != null">OBJ_TYPE =
|
|
|
+ #{objType},
|
|
|
+ </if>
|
|
|
+ <if test="objName != null">OBJ_NAME =
|
|
|
+ #{objName},
|
|
|
+ </if>
|
|
|
+ <if test="algoType != null">ALGO_TYPE =
|
|
|
+ #{algoType},
|
|
|
+ </if>
|
|
|
+ <if test="ntr != null">NTR =
|
|
|
+ #{ntr},
|
|
|
+ </if>
|
|
|
+ <if test="hov != null">HOV =
|
|
|
+ #{hov},
|
|
|
+ </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 AUTO_ID = #{autoId}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteRipaMetricsByAutoId" parameterType="Long">
|
|
|
delete
|
|
|
- from ripa_metrics where AUTO_ID = #{autoId}
|
|
|
+ from ripa_metrics
|
|
|
+ where AUTO_ID = #{autoId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteRipaMetricsByAutoIds" parameterType="String">
|