|
@@ -0,0 +1,143 @@
|
|
|
+<?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.HlMetricsRelaMapper">
|
|
|
+
|
|
|
+ <resultMap type="HlMetricsRela" id="HlMetricsRelaResult">
|
|
|
+ <result property="relaId" column="RELA_ID"/>
|
|
|
+ <result property="hlCode" column="HL_CODE"/>
|
|
|
+ <result property="metricsId" column="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="selectHlMetricsRelaVo">
|
|
|
+ select RELA_ID, HL_CODE, METRICS_ID, METRICS_NAME, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK
|
|
|
+ from hl_metrics_rela
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectHlMetricsRelaList" parameterType="HlMetricsRela" resultMap="HlMetricsRelaResult">
|
|
|
+ <include refid="selectHlMetricsRelaVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="hlCode != null and hlCode != ''">
|
|
|
+ and HL_CODE = #{hlCode}
|
|
|
+ </if>
|
|
|
+ <if test="metricsId != null ">
|
|
|
+ and METRICS_ID = #{metricsId}
|
|
|
+ </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="selectHlMetricsRelaByRelaId" parameterType="Long"
|
|
|
+ resultMap="HlMetricsRelaResult">
|
|
|
+ <include refid="selectHlMetricsRelaVo"/>
|
|
|
+ where RELA_ID = #{relaId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertHlMetricsRela" parameterType="HlMetricsRela" useGeneratedKeys="true"
|
|
|
+ keyProperty="relaId">
|
|
|
+ insert into hl_metrics_rela
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="hlCode != null">HL_CODE,
|
|
|
+ </if>
|
|
|
+ <if test="metricsId != null">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="hlCode != null">#{hlCode},
|
|
|
+ </if>
|
|
|
+ <if test="metricsId != null">#{metricsId},
|
|
|
+ </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="updateHlMetricsRela" parameterType="HlMetricsRela">
|
|
|
+ update hl_metrics_rela
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="hlCode != null">HL_CODE =
|
|
|
+ #{hlCode},
|
|
|
+ </if>
|
|
|
+ <if test="metricsId != null">METRICS_ID =
|
|
|
+ #{metricsId},
|
|
|
+ </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 RELA_ID = #{relaId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteHlMetricsRelaByRelaId" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from hl_metrics_rela where RELA_ID = #{relaId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteHlMetricsRelaByRelaIds" parameterType="String">
|
|
|
+ delete from hl_metrics_rela where RELA_ID in
|
|
|
+ <foreach item="relaId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{relaId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|