<?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.foreverwin.mesnac.meapi.mapper.MessageTypeMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.MessageType">
        <result column="HANDLE" property="handle" />
        <result column="SITE" property="site" />
        <result column="MESSAGE_TYPE" property="messageType" />
        <result column="DESCRIPTION" property="description" />
        <result column="SEVERITY" property="severity" />
        <result column="PROCESS_WORKFLOW_BO" property="processWorkflowBo" />
        <result column="ENABLED" property="enabled" />
        <result column="SUBJECT" property="subject" />
        <result column="BODY" property="body" />
        <result column="AUTO_CLOSE" property="autoClose" />
        <result column="AUTO_CLOSE_INTERVAL" property="autoCloseInterval" />
        <result column="AUTO_CLOSE_INTERVAL_UNIT" property="autoCloseIntervalUnit" />
        <result column="AUTO_CLOSED_BY_WF" property="autoClosedByWf" />
        <result column="SIGNAL_FLAG" property="signalFlag" />
        <result column="CREATED_DATE_TIME" property="createdDateTime" />
        <result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        HANDLE, SITE, MESSAGE_TYPE, DESCRIPTION, SEVERITY, PROCESS_WORKFLOW_BO, ENABLED, SUBJECT, BODY, AUTO_CLOSE, AUTO_CLOSE_INTERVAL, AUTO_CLOSE_INTERVAL_UNIT, AUTO_CLOSED_BY_WF, SIGNAL_FLAG, CREATED_DATE_TIME, MODIFIED_DATE_TIME
    </sql>

    <!-- BaseMapper标准查询/修改/删除 -->

    <select id="selectByMap" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List"></include>
        FROM MESSAGE_TYPE
        <if test="cm!=null and !cm.isEmpty">
            <where>
                <foreach collection="cm.keys" item="k" separator="AND">
                    <if test="cm[k] != null">
                        ${k} = #{cm[${k}]}
                    </if>
                </foreach>
            </where>
        </if>
    </select>


    <select id="selectOne" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List"></include> FROM MESSAGE_TYPE
        <where>
            <if test="ew.entity.handle!=null">
              HANDLE=#{ew.handle}
            </if>
            <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
            <if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
            <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
            <if test="ew.entity.severity!=null"> AND SEVERITY=#{ew.entity.severity}</if>
            <if test="ew.entity.processWorkflowBo!=null"> AND PROCESS_WORKFLOW_BO=#{ew.entity.processWorkflowBo}</if>
            <if test="ew.entity.enabled!=null"> AND ENABLED=#{ew.entity.enabled}</if>
            <if test="ew.entity.subject!=null"> AND SUBJECT=#{ew.entity.subject}</if>
            <if test="ew.entity.body!=null"> AND BODY=#{ew.entity.body}</if>
            <if test="ew.entity.autoClose!=null"> AND AUTO_CLOSE=#{ew.entity.autoClose}</if>
            <if test="ew.entity.autoCloseInterval!=null"> AND AUTO_CLOSE_INTERVAL=#{ew.entity.autoCloseInterval}</if>
            <if test="ew.entity.autoCloseIntervalUnit!=null"> AND AUTO_CLOSE_INTERVAL_UNIT=#{ew.entity.autoCloseIntervalUnit}</if>
            <if test="ew.entity.autoClosedByWf!=null"> AND AUTO_CLOSED_BY_WF=#{ew.entity.autoClosedByWf}</if>
            <if test="ew.entity.signalFlag!=null"> AND SIGNAL_FLAG=#{ew.entity.signalFlag}</if>
            <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
            <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
        </where>
    </select>

    <select id="selectCount" resultType="Integer">
        SELECT COUNT(1) FROM MESSAGE_TYPE
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                <if test="ew.entity.handle!=null">
                    HANDLE=#{ew.entity.handle}
                </if>
                <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                <if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
                <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                <if test="ew.entity.severity!=null"> AND SEVERITY=#{ew.entity.severity}</if>
                <if test="ew.entity.processWorkflowBo!=null"> AND PROCESS_WORKFLOW_BO=#{ew.entity.processWorkflowBo}</if>
                <if test="ew.entity.enabled!=null"> AND ENABLED=#{ew.entity.enabled}</if>
                <if test="ew.entity.subject!=null"> AND SUBJECT=#{ew.entity.subject}</if>
                <if test="ew.entity.body!=null"> AND BODY=#{ew.entity.body}</if>
                <if test="ew.entity.autoClose!=null"> AND AUTO_CLOSE=#{ew.entity.autoClose}</if>
                <if test="ew.entity.autoCloseInterval!=null"> AND AUTO_CLOSE_INTERVAL=#{ew.entity.autoCloseInterval}</if>
                <if test="ew.entity.autoCloseIntervalUnit!=null"> AND AUTO_CLOSE_INTERVAL_UNIT=#{ew.entity.autoCloseIntervalUnit}</if>
                <if test="ew.entity.autoClosedByWf!=null"> AND AUTO_CLOSED_BY_WF=#{ew.entity.autoClosedByWf}</if>
                <if test="ew.entity.signalFlag!=null"> AND SIGNAL_FLAG=#{ew.entity.signalFlag}</if>
                <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <select id="selectList" resultMap="BaseResultMap">
        SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM MESSAGE_TYPE
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.severity!=null"> AND SEVERITY=#{ew.entity.severity}</if>
                    <if test="ew.entity.processWorkflowBo!=null"> AND PROCESS_WORKFLOW_BO=#{ew.entity.processWorkflowBo}</if>
                    <if test="ew.entity.enabled!=null"> AND ENABLED=#{ew.entity.enabled}</if>
                    <if test="ew.entity.subject!=null"> AND SUBJECT=#{ew.entity.subject}</if>
                    <if test="ew.entity.body!=null"> AND BODY=#{ew.entity.body}</if>
                    <if test="ew.entity.autoClose!=null"> AND AUTO_CLOSE=#{ew.entity.autoClose}</if>
                    <if test="ew.entity.autoCloseInterval!=null"> AND AUTO_CLOSE_INTERVAL=#{ew.entity.autoCloseInterval}</if>
                    <if test="ew.entity.autoCloseIntervalUnit!=null"> AND AUTO_CLOSE_INTERVAL_UNIT=#{ew.entity.autoCloseIntervalUnit}</if>
                    <if test="ew.entity.autoClosedByWf!=null"> AND AUTO_CLOSED_BY_WF=#{ew.entity.autoClosedByWf}</if>
                    <if test="ew.entity.signalFlag!=null"> AND SIGNAL_FLAG=#{ew.entity.signalFlag}</if>
                    <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                    <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <select id="selectMaps" resultType="HashMap">
        SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM MESSAGE_TYPE
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.severity!=null"> AND SEVERITY=#{ew.entity.severity}</if>
                    <if test="ew.entity.processWorkflowBo!=null"> AND PROCESS_WORKFLOW_BO=#{ew.entity.processWorkflowBo}</if>
                    <if test="ew.entity.enabled!=null"> AND ENABLED=#{ew.entity.enabled}</if>
                    <if test="ew.entity.subject!=null"> AND SUBJECT=#{ew.entity.subject}</if>
                    <if test="ew.entity.body!=null"> AND BODY=#{ew.entity.body}</if>
                    <if test="ew.entity.autoClose!=null"> AND AUTO_CLOSE=#{ew.entity.autoClose}</if>
                    <if test="ew.entity.autoCloseInterval!=null"> AND AUTO_CLOSE_INTERVAL=#{ew.entity.autoCloseInterval}</if>
                    <if test="ew.entity.autoCloseIntervalUnit!=null"> AND AUTO_CLOSE_INTERVAL_UNIT=#{ew.entity.autoCloseIntervalUnit}</if>
                    <if test="ew.entity.autoClosedByWf!=null"> AND AUTO_CLOSED_BY_WF=#{ew.entity.autoClosedByWf}</if>
                    <if test="ew.entity.signalFlag!=null"> AND SIGNAL_FLAG=#{ew.entity.signalFlag}</if>
                    <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                    <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <select id="selectObjs" resultType="Object">
        SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM MESSAGE_TYPE
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.severity!=null"> AND SEVERITY=#{ew.entity.severity}</if>
                    <if test="ew.entity.processWorkflowBo!=null"> AND PROCESS_WORKFLOW_BO=#{ew.entity.processWorkflowBo}</if>
                    <if test="ew.entity.enabled!=null"> AND ENABLED=#{ew.entity.enabled}</if>
                    <if test="ew.entity.subject!=null"> AND SUBJECT=#{ew.entity.subject}</if>
                    <if test="ew.entity.body!=null"> AND BODY=#{ew.entity.body}</if>
                    <if test="ew.entity.autoClose!=null"> AND AUTO_CLOSE=#{ew.entity.autoClose}</if>
                    <if test="ew.entity.autoCloseInterval!=null"> AND AUTO_CLOSE_INTERVAL=#{ew.entity.autoCloseInterval}</if>
                    <if test="ew.entity.autoCloseIntervalUnit!=null"> AND AUTO_CLOSE_INTERVAL_UNIT=#{ew.entity.autoCloseIntervalUnit}</if>
                    <if test="ew.entity.autoClosedByWf!=null"> AND AUTO_CLOSED_BY_WF=#{ew.entity.autoClosedByWf}</if>
                    <if test="ew.entity.signalFlag!=null"> AND SIGNAL_FLAG=#{ew.entity.signalFlag}</if>
                    <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                    <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <select id="selectPage" resultMap="BaseResultMap">
        SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM MESSAGE_TYPE
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.severity!=null"> AND SEVERITY=#{ew.entity.severity}</if>
                    <if test="ew.entity.processWorkflowBo!=null"> AND PROCESS_WORKFLOW_BO=#{ew.entity.processWorkflowBo}</if>
                    <if test="ew.entity.enabled!=null"> AND ENABLED=#{ew.entity.enabled}</if>
                    <if test="ew.entity.subject!=null"> AND SUBJECT=#{ew.entity.subject}</if>
                    <if test="ew.entity.body!=null"> AND BODY=#{ew.entity.body}</if>
                    <if test="ew.entity.autoClose!=null"> AND AUTO_CLOSE=#{ew.entity.autoClose}</if>
                    <if test="ew.entity.autoCloseInterval!=null"> AND AUTO_CLOSE_INTERVAL=#{ew.entity.autoCloseInterval}</if>
                    <if test="ew.entity.autoCloseIntervalUnit!=null"> AND AUTO_CLOSE_INTERVAL_UNIT=#{ew.entity.autoCloseIntervalUnit}</if>
                    <if test="ew.entity.autoClosedByWf!=null"> AND AUTO_CLOSED_BY_WF=#{ew.entity.autoClosedByWf}</if>
                    <if test="ew.entity.signalFlag!=null"> AND SIGNAL_FLAG=#{ew.entity.signalFlag}</if>
                    <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                    <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <select id="selectMapsPage" resultType="HashMap">
        SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM MESSAGE_TYPE
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.severity!=null"> AND SEVERITY=#{ew.entity.severity}</if>
                    <if test="ew.entity.processWorkflowBo!=null"> AND PROCESS_WORKFLOW_BO=#{ew.entity.processWorkflowBo}</if>
                    <if test="ew.entity.enabled!=null"> AND ENABLED=#{ew.entity.enabled}</if>
                    <if test="ew.entity.subject!=null"> AND SUBJECT=#{ew.entity.subject}</if>
                    <if test="ew.entity.body!=null"> AND BODY=#{ew.entity.body}</if>
                    <if test="ew.entity.autoClose!=null"> AND AUTO_CLOSE=#{ew.entity.autoClose}</if>
                    <if test="ew.entity.autoCloseInterval!=null"> AND AUTO_CLOSE_INTERVAL=#{ew.entity.autoCloseInterval}</if>
                    <if test="ew.entity.autoCloseIntervalUnit!=null"> AND AUTO_CLOSE_INTERVAL_UNIT=#{ew.entity.autoCloseIntervalUnit}</if>
                    <if test="ew.entity.autoClosedByWf!=null"> AND AUTO_CLOSED_BY_WF=#{ew.entity.autoClosedByWf}</if>
                    <if test="ew.entity.signalFlag!=null"> AND SIGNAL_FLAG=#{ew.entity.signalFlag}</if>
                    <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                    <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <insert id="insert" parameterType="com.foreverwin.mesnac.meapi.model.MessageType">
        INSERT INTO MESSAGE_TYPE
        <trim prefix="(" suffix=")" suffixOverrides=",">
            HANDLE,
            <if test="site!=null">SITE,</if>
            <if test="messageType!=null">MESSAGE_TYPE,</if>
            <if test="description!=null">DESCRIPTION,</if>
            <if test="severity!=null">SEVERITY,</if>
            <if test="processWorkflowBo!=null">PROCESS_WORKFLOW_BO,</if>
            <if test="enabled!=null">ENABLED,</if>
            <if test="subject!=null">SUBJECT,</if>
            <if test="body!=null">BODY,</if>
            <if test="autoClose!=null">AUTO_CLOSE,</if>
            <if test="autoCloseInterval!=null">AUTO_CLOSE_INTERVAL,</if>
            <if test="autoCloseIntervalUnit!=null">AUTO_CLOSE_INTERVAL_UNIT,</if>
            <if test="autoClosedByWf!=null">AUTO_CLOSED_BY_WF,</if>
            <if test="signalFlag!=null">SIGNAL_FLAG,</if>
            <if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
            <if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
        </trim> VALUES
        <trim prefix="(" suffix=")" suffixOverrides=",">
            #{handle},
            <if test="site!=null">#{site},</if>
            <if test="messageType!=null">#{messageType},</if>
            <if test="description!=null">#{description},</if>
            <if test="severity!=null">#{severity},</if>
            <if test="processWorkflowBo!=null">#{processWorkflowBo},</if>
            <if test="enabled!=null">#{enabled},</if>
            <if test="subject!=null">#{subject},</if>
            <if test="body!=null">#{body},</if>
            <if test="autoClose!=null">#{autoClose},</if>
            <if test="autoCloseInterval!=null">#{autoCloseInterval},</if>
            <if test="autoCloseIntervalUnit!=null">#{autoCloseIntervalUnit},</if>
            <if test="autoClosedByWf!=null">#{autoClosedByWf},</if>
            <if test="signalFlag!=null">#{signalFlag},</if>
            <if test="createdDateTime!=null">#{createdDateTime},</if>
            <if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
        </trim>
    </insert>

    <insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.meapi.model.MessageType">
        INSERT INTO MESSAGE_TYPE
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <include refid="Base_Column_List"></include>
        </trim> VALUES
        <trim prefix="(" suffix=")" suffixOverrides=",">
            #{handle},
            #{site},
            #{messageType},
            #{description},
            #{severity},
            #{processWorkflowBo},
            #{enabled},
            #{subject},
            #{body},
            #{autoClose},
            #{autoCloseInterval},
            #{autoCloseIntervalUnit},
            #{autoClosedByWf},
            #{signalFlag},
            #{createdDateTime},
            #{modifiedDateTime},
        </trim>
    </insert>






    <update id="update">
        UPDATE MESSAGE_TYPE <trim prefix="SET" suffixOverrides=",">
        <if test="et.handle!=null">HANDLE=#{et.handle},</if>
        <if test="et.site!=null">SITE=#{et.site},</if>
        <if test="et.messageType!=null">MESSAGE_TYPE=#{et.messageType},</if>
        <if test="et.description!=null">DESCRIPTION=#{et.description},</if>
        <if test="et.severity!=null">SEVERITY=#{et.severity},</if>
        <if test="et.processWorkflowBo!=null">PROCESS_WORKFLOW_BO=#{et.processWorkflowBo},</if>
        <if test="et.enabled!=null">ENABLED=#{et.enabled},</if>
        <if test="et.subject!=null">SUBJECT=#{et.subject},</if>
        <if test="et.body!=null">BODY=#{et.body},</if>
        <if test="et.autoClose!=null">AUTO_CLOSE=#{et.autoClose},</if>
        <if test="et.autoCloseInterval!=null">AUTO_CLOSE_INTERVAL=#{et.autoCloseInterval},</if>
        <if test="et.autoCloseIntervalUnit!=null">AUTO_CLOSE_INTERVAL_UNIT=#{et.autoCloseIntervalUnit},</if>
        <if test="et.autoClosedByWf!=null">AUTO_CLOSED_BY_WF=#{et.autoClosedByWf},</if>
        <if test="et.signalFlag!=null">SIGNAL_FLAG=#{et.signalFlag},</if>
        <if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
        <if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
    </trim>
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    HANDLE=#{ew.entity.handle}
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.severity!=null"> AND SEVERITY=#{ew.entity.severity}</if>
                    <if test="ew.entity.processWorkflowBo!=null"> AND PROCESS_WORKFLOW_BO=#{ew.entity.processWorkflowBo}</if>
                    <if test="ew.entity.enabled!=null"> AND ENABLED=#{ew.entity.enabled}</if>
                    <if test="ew.entity.subject!=null"> AND SUBJECT=#{ew.entity.subject}</if>
                    <if test="ew.entity.body!=null"> AND BODY=#{ew.entity.body}</if>
                    <if test="ew.entity.autoClose!=null"> AND AUTO_CLOSE=#{ew.entity.autoClose}</if>
                    <if test="ew.entity.autoCloseInterval!=null"> AND AUTO_CLOSE_INTERVAL=#{ew.entity.autoCloseInterval}</if>
                    <if test="ew.entity.autoCloseIntervalUnit!=null"> AND AUTO_CLOSE_INTERVAL_UNIT=#{ew.entity.autoCloseIntervalUnit}</if>
                    <if test="ew.entity.autoClosedByWf!=null"> AND AUTO_CLOSED_BY_WF=#{ew.entity.autoClosedByWf}</if>
                    <if test="ew.entity.signalFlag!=null"> AND SIGNAL_FLAG=#{ew.entity.signalFlag}</if>
                    <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                    <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </update>


    <delete id="deleteByMap">
        DELETE FROM MESSAGE_TYPE
        <if test="cm!=null and !cm.isEmpty">
            <where>
                <foreach collection="cm.keys" item="k" separator="AND">
                    <if test="cm[k] != null">
                        ${k} = #{cm[${k}]}
                    </if>
                </foreach>
            </where>
        </if>
    </delete>

    <delete id="delete">
        DELETE FROM MESSAGE_TYPE
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.severity!=null"> AND SEVERITY=#{ew.entity.severity}</if>
                    <if test="ew.entity.processWorkflowBo!=null"> AND PROCESS_WORKFLOW_BO=#{ew.entity.processWorkflowBo}</if>
                    <if test="ew.entity.enabled!=null"> AND ENABLED=#{ew.entity.enabled}</if>
                    <if test="ew.entity.subject!=null"> AND SUBJECT=#{ew.entity.subject}</if>
                    <if test="ew.entity.body!=null"> AND BODY=#{ew.entity.body}</if>
                    <if test="ew.entity.autoClose!=null"> AND AUTO_CLOSE=#{ew.entity.autoClose}</if>
                    <if test="ew.entity.autoCloseInterval!=null"> AND AUTO_CLOSE_INTERVAL=#{ew.entity.autoCloseInterval}</if>
                    <if test="ew.entity.autoCloseIntervalUnit!=null"> AND AUTO_CLOSE_INTERVAL_UNIT=#{ew.entity.autoCloseIntervalUnit}</if>
                    <if test="ew.entity.autoClosedByWf!=null"> AND AUTO_CLOSED_BY_WF=#{ew.entity.autoClosedByWf}</if>
                    <if test="ew.entity.signalFlag!=null"> AND SIGNAL_FLAG=#{ew.entity.signalFlag}</if>
                    <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                    <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </delete>

    <!-- BaseMapper标准查询/修改/删除 -->

</mapper>
