123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- <?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.BizObjMcMapper">
- <resultMap type="BizObjMc" id="BizObjMcResult">
- <result property="mcId" column="MC_ID"/>
- <result property="objId" column="OBJ_ID"/>
- <result property="metricsId" column="METRICS_ID"/>
- <result property="metricsName" column="METRICS_NAME"/>
- <result property="metricsCode" column="METRICS_CODE"/>
- <result property="alarmLow" column="ALARM_LOW"/>
- <result property="alarmMid" column="ALARM_MID"/>
- <result property="alarmHigh" column="ALARM_HIGH"/>
- <result property="event" column="EVENT"/>
- <result property="dataExp" column="DATA_EXP"/>
- <result property="findKey" column="FIND_KEY"/>
- <result property="findRule" column="FIND_RULE"/>
- <result property="findFlag" column="FIND_FLAG"/>
- <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"/>
- <association property="metricsDef" javaType="MetricsDef">
- <result property="metricsId" column="METRICS_ID_b"/>
- <result property="metricsName" column="METRICS_NAME_b"/>
- <result property="metricsCode" column="METRICS_CODE_b"/>
- <result property="metricsType" column="METRICS_TYPE"/>
- </association>
- </resultMap>
- <sql id="selectBizObjMcVo">
- select *
- from (select a.MC_ID,
- a.OBJ_ID,
- a.METRICS_ID,
- a.METRICS_NAME,
- a.METRICS_CODE,
- a.ALARM_LOW,
- a.ALARM_MID,
- a.ALARM_HIGH,
- a.EVENT,
- a.DATA_EXP,
- a.FIND_KEY,
- a.FIND_RULE,
- a.FIND_FLAG,
- a.CREATE_BY,
- a.CREATE_TIME,
- a.UPDATE_BY,
- a.UPDATE_TIME,
- a.REMARK,
- b.METRICS_ID as METRICS_ID_b,
- b.METRICS_CODE as METRICS_CODE_b,
- b.METRICS_NAME as METRICS_NAME_b,
- b.METRICS_TYPE
- from biz_obj_mc a,
- metrics_def b
- where a.METRICS_ID = b.METRICS_ID) t
- </sql>
- <select id="selectBizObjMcList" parameterType="BizObjMc" resultMap="BizObjMcResult">
- <include refid="selectBizObjMcVo"/>
- <where>
- <if test="objId != null ">
- and OBJ_ID = #{objId}
- </if>
- <if test="metricsId != null ">
- and METRICS_ID = #{metricsId}
- </if>
- <if test="metricsCode != null and metricsCode != ''">
- and METRICS_CODE = #{metricsCode}
- </if>
- <if test="alarmLow != null and alarmLow != ''">
- and ALARM_LOW = #{alarmLow}
- </if>
- <if test="alarmMid != null and alarmMid != ''">
- and ALARM_MID = #{alarmMid}
- </if>
- <if test="alarmHigh != null and alarmHigh != ''">
- and ALARM_HIGH = #{alarmHigh}
- </if>
- <if test="event != null and event != ''">
- and EVENT = #{event}
- </if>
- <if test="dataExp != null and dataExp != ''">
- and DATA_EXP = #{dataExp}
- </if>
- <if test="findKey != null and findKey != ''">
- and FIND_KEY = #{findKey}
- </if>
- <if test="findRule != null and findRule != ''">
- and FIND_RULE = #{findRule}
- </if>
- <if test="findFlag != null and findFlag != ''">
- and FIND_FLAG = #{findFlag}
- </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="selectBizObjMcByMcId" parameterType="Long"
- resultMap="BizObjMcResult">
- <include refid="selectBizObjMcVo"/>
- where MC_ID = #{mcId}
- </select>
- <insert id="insertBizObjMc" parameterType="BizObjMc" useGeneratedKeys="true"
- keyProperty="mcId">
- insert into biz_obj_mc
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="objId != null">OBJ_ID,
- </if>
- <if test="metricsId != null">METRICS_ID,
- </if>
- <if test="metricsCode != null">METRICS_CODE,
- </if>
- <if test="alarmLow != null">ALARM_LOW,
- </if>
- <if test="alarmMid != null">ALARM_MID,
- </if>
- <if test="alarmHigh != null">ALARM_HIGH,
- </if>
- <if test="event != null">EVENT,
- </if>
- <if test="dataExp != null">DATA_EXP,
- </if>
- <if test="findKey != null">FIND_KEY,
- </if>
- <if test="findRule != null">FIND_RULE,
- </if>
- <if test="findFlag != null">FIND_FLAG,
- </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="objId != null">#{objId},
- </if>
- <if test="metricsId != null">#{metricsId},
- </if>
- <if test="metricsCode != null">#{metricsCode},
- </if>
- <if test="alarmLow != null">#{alarmLow},
- </if>
- <if test="alarmMid != null">#{alarmMid},
- </if>
- <if test="alarmHigh != null">#{alarmHigh},
- </if>
- <if test="event != null">#{event},
- </if>
- <if test="dataExp != null">#{dataExp},
- </if>
- <if test="findKey != null">#{findKey},
- </if>
- <if test="findRule != null">#{findRule},
- </if>
- <if test="findFlag != null">#{findFlag},
- </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="updateBizObjMc" parameterType="BizObjMc">
- update biz_obj_mc
- <trim prefix="SET" suffixOverrides=",">
- <if test="objId != null">OBJ_ID =
- #{objId},
- </if>
- <if test="metricsId != null">METRICS_ID =
- #{metricsId},
- </if>
- <if test="metricsCode != null">METRICS_CODE =
- #{metricsCode},
- </if>
- <if test="alarmLow != null">ALARM_LOW =
- #{alarmLow},
- </if>
- <if test="alarmMid != null">ALARM_MID =
- #{alarmMid},
- </if>
- <if test="alarmHigh != null">ALARM_HIGH =
- #{alarmHigh},
- </if>
- <if test="event != null">EVENT =
- #{event},
- </if>
- <if test="dataExp != null">DATA_EXP =
- #{dataExp},
- </if>
- <if test="findKey != null">FIND_KEY =
- #{findKey},
- </if>
- <if test="findRule != null">FIND_RULE =
- #{findRule},
- </if>
- <if test="findFlag != null">FIND_FLAG =
- #{findFlag},
- </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 MC_ID = #{mcId}
- </update>
- <delete id="deleteBizObjMcByMcId" parameterType="Long">
- delete
- from biz_obj_mc
- where MC_ID = #{mcId}
- </delete>
- <delete id="deleteBizObjMcByMcIds" parameterType="String">
- delete from biz_obj_mc where MC_ID in
- <foreach item="mcId" collection="array" open="(" separator="," close=")">
- #{mcId}
- </foreach>
- </delete>
- </mapper>
|