|
|
@@ -0,0 +1,146 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
+<!DOCTYPE mapper
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<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"/>
|
|
|
+ </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
|
|
|
+ </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>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectRipaMetricsByAutoId" parameterType="Long"
|
|
|
+ resultMap="RipaMetricsResult">
|
|
|
+ <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>
|
|
|
+
|
|
|
+ <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>
|
|
|
+ </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>
|
|
|
+ </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>
|
|
|
+ </trim>
|
|
|
+ where AUTO_ID = #{autoId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteRipaMetricsByAutoId" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from ripa_metrics where AUTO_ID = #{autoId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteRipaMetricsByAutoIds" parameterType="String">
|
|
|
+ delete from ripa_metrics where AUTO_ID in
|
|
|
+ <foreach item="autoId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{autoId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|