<?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.interfaces.mapper.PtModelMapper">
    <resultMap id="BaseResultMap" type="com.ruoyi.interfaces.domain.PtModel">
        <id column="MID" property="mid" jdbcType="VARCHAR"/>
        <result column="NAME" property="name" jdbcType="VARCHAR"/>
        <result column="TYPE" property="type" jdbcType="VARCHAR"/>
        <result column="URL" property="url" jdbcType="VARCHAR"/>
        <result column="WSDL" property="wsdl" jdbcType="VARCHAR"/>
        <result column="NOTE" property="note" jdbcType="VARCHAR"/>
        <result column="FLAG" property="flag" jdbcType="VARCHAR"/>
    </resultMap>
    <sql id="Base_Column_List">
        MID
        , NAME, TYPE, URL, WSDL, NOTE,FLAG
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
        select
        <include refid="Base_Column_List"/>
        from PT_MODEL
        where MID = #{mid,jdbcType=VARCHAR}
    </select>

    <select id="selectAll" resultMap="BaseResultMap" parameterType="java.lang.String">
        select
        <include refid="Base_Column_List"/>
        from PT_MODEL
    </select>

    <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
        delete
        from PT_MODEL
        where MID = #{mid,jdbcType=VARCHAR}
    </delete>
    <insert id="insert" parameterType="com.ruoyi.interfaces.domain.PtModel">
        insert into PT_MODEL (MID, NAME, TYPE,
                              URL, WSDL, NOTE, FLAG)
        values (#{mid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
                #{url,jdbcType=VARCHAR}, #{wsdl,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR}, #{flag,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.ruoyi.interfaces.domain.PtModel">
        insert into PT_MODEL
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="mid != null">
                MID,
            </if>
            <if test="name != null">
                NAME,
            </if>
            <if test="type != null">
                TYPE,
            </if>
            <if test="url != null">
                URL,
            </if>
            <if test="wsdl != null">
                WSDL,
            </if>
            <if test="note != null">
                NOTE,
            </if>
            <if test="flag != null">
                FLAG,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="mid != null">
                #{mid,jdbcType=VARCHAR},
            </if>
            <if test="name != null">
                #{name,jdbcType=VARCHAR},
            </if>
            <if test="type != null">
                #{type,jdbcType=VARCHAR},
            </if>
            <if test="url != null">
                #{url,jdbcType=VARCHAR},
            </if>
            <if test="wsdl != null">
                #{wsdl,jdbcType=VARCHAR},
            </if>
            <if test="note != null">
                #{note,jdbcType=VARCHAR},
            </if>
            <if test="flag != null">
                #{flag,jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.interfaces.domain.PtModel">
        update PT_MODEL
        <set>
            <if test="name != null">
                NAME = #{name,jdbcType=VARCHAR},
            </if>
            <if test="type != null">
                TYPE = #{type,jdbcType=VARCHAR},
            </if>
            <if test="url != null">
                URL = #{url,jdbcType=VARCHAR},
            </if>
            <if test="wsdl != null">
                WSDL = #{wsdl,jdbcType=VARCHAR},
            </if>
            <if test="note != null">
                NOTE = #{note,jdbcType=VARCHAR},
            </if>
            <if test="flag != null">
                #{flag,jdbcType=VARCHAR},
            </if>
        </set>
        where MID = #{mid,jdbcType=VARCHAR}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.ruoyi.interfaces.domain.PtModel">
        update PT_MODEL
        set NAME = #{name,jdbcType=VARCHAR},
            TYPE = #{type,jdbcType=VARCHAR},
            URL  = #{url,jdbcType=VARCHAR},
            WSDL = #{wsdl,jdbcType=VARCHAR},
            NOTE = #{note,jdbcType=VARCHAR},
            FALG = #{flag,jdbcType=VARCHAR}
        where MID = #{mid,jdbcType=VARCHAR}
    </update>
    <update id="updateModelStatus">
        update PT_MODEL
        set FLAG = #{flag}
        where MID = #{mid}
    </update>

</mapper>
