MonitorTemplateMapper.xml 4.73 KB
<?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.ruoyi.web.controller.business.mapper.MonitorTemplateMapper">
    
    <resultMap type="MonitorTemplate" id="MonitorTemplateResult">
        <result property="parentType"    column="parentType"    />
        <result property="type"    column="type"    />
        <result property="monitorDimension"    column="monitorDimension"    />
        <result property="subdivisionDimension"    column="subdivisionDimension"    />
        <result property="monitorStatus"    column="monitorStatus"    />
        <result property="warningLevel"    column="warningLevel"    />
        <result property="isSF"    column="isSF"    />
    </resultMap>
	
	<sql id="selectMonitorTemplateVo">
        select parentType, type, monitorDimension, subdivisionDimension, monitorStatus, warningLevel, isSF from monitor_template
    </sql>
	
    <select id="selectMonitorTemplateList" parameterType="MonitorTemplate" resultMap="MonitorTemplateResult">
        <include refid="selectMonitorTemplateVo"/>
        <where>  
            <if test="parentType != null  and parentType != '' "> and parentType = #{parentType}</if>
            <if test="type != null  and type != '' "> and type = #{type}</if>
            <if test="monitorDimension != null  and monitorDimension != '' "> and monitorDimension = #{monitorDimension}</if>
            <if test="subdivisionDimension != null  and subdivisionDimension != '' "> and subdivisionDimension = #{subdivisionDimension}</if>
            <if test="monitorStatus != null  and monitorStatus != '' "> and monitorStatus = #{monitorStatus}</if>
            <if test="warningLevel != null  and warningLevel != '' "> and warningLevel = #{warningLevel}</if>
            <if test="isSF != null  and isSF != '' "> and isSF = #{isSF}</if>
        </where>
    </select>
    
    <select id="selectMonitorTemplateById" parameterType="String" resultMap="MonitorTemplateResult">
        <include refid="selectMonitorTemplateVo"/>
        where parentType = #{parentType}
    </select>
        
    <insert id="insertMonitorTemplate" parameterType="MonitorTemplate">
        insert into monitor_template
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="parentType != null  and parentType != ''  ">parentType,</if>
			<if test="type != null  and type != ''  ">type,</if>
			<if test="monitorDimension != null  and monitorDimension != ''  ">monitorDimension,</if>
			<if test="subdivisionDimension != null  and subdivisionDimension != ''  ">subdivisionDimension,</if>
			<if test="monitorStatus != null  and monitorStatus != ''  ">monitorStatus,</if>
			<if test="warningLevel != null  and warningLevel != ''  ">warningLevel,</if>
			<if test="isSF != null  and isSF != ''  ">isSF,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="parentType != null  and parentType != ''  ">#{parentType},</if>
			<if test="type != null  and type != ''  ">#{type},</if>
			<if test="monitorDimension != null  and monitorDimension != ''  ">#{monitorDimension},</if>
			<if test="subdivisionDimension != null  and subdivisionDimension != ''  ">#{subdivisionDimension},</if>
			<if test="monitorStatus != null  and monitorStatus != ''  ">#{monitorStatus},</if>
			<if test="warningLevel != null  and warningLevel != ''  ">#{warningLevel},</if>
			<if test="isSF != null  and isSF != ''  ">#{isSF},</if>
         </trim>
    </insert>
	 
    <update id="updateMonitorTemplate" parameterType="MonitorTemplate">
        update monitor_template
        <trim prefix="SET" suffixOverrides=",">
            <if test="type != null  and type != ''  ">type = #{type},</if>
            <if test="monitorDimension != null  and monitorDimension != ''  ">monitorDimension = #{monitorDimension},</if>
            <if test="subdivisionDimension != null  and subdivisionDimension != ''  ">subdivisionDimension = #{subdivisionDimension},</if>
            <if test="monitorStatus != null  and monitorStatus != ''  ">monitorStatus = #{monitorStatus},</if>
            <if test="warningLevel != null  and warningLevel != ''  ">warningLevel = #{warningLevel},</if>
            <if test="isSF != null  and isSF != ''  ">isSF = #{isSF},</if>
        </trim>
        where parentType = #{parentType}
    </update>

	<delete id="deleteMonitorTemplateById" parameterType="String">
        delete from monitor_template where parentType = #{parentType}
    </delete>
	
    <delete id="deleteMonitorTemplateByIds" parameterType="String">
        delete from monitor_template where parentType in 
        <foreach item="parentType" collection="array" open="(" separator="," close=")">
            #{parentType}
        </foreach>
    </delete>
    
</mapper>