<?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.fuxi.ws.data.dao.WPlatformMapper">
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.WPlatform">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Jun 16 16:46:23 CST 2016.
    -->
    <id column="PlatFormID" jdbcType="SMALLINT" property="platformid" />
    <result column="Type" jdbcType="TINYINT" property="type" />
    <result column="LinkUrl" jdbcType="VARCHAR" property="linkurl" />
    <result column="PromptSql" jdbcType="VARCHAR" property="promptsql" />
    <result column="PromptText" jdbcType="NVARCHAR" property="prompttext" />
    <result column="DealKind" jdbcType="TINYINT" property="dealkind" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Jun 16 16:46:23 CST 2016.
    -->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Jun 16 16:46:23 CST 2016.
    -->
    PlatFormID, Type, LinkUrl, PromptSql, PromptText, DealKind
  </sql>
  <select id="selectByExample" parameterType="com.fuxi.ws.data.entity.WPlatformExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Jun 16 16:46:23 CST 2016.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from W_PlatForm
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Jun 16 16:46:23 CST 2016.
    -->
    select 
    <include refid="Base_Column_List" />
    from W_PlatForm
    where PlatFormID = #{platformid,jdbcType=SMALLINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Jun 16 16:46:23 CST 2016.
    -->
    delete from W_PlatForm
    where PlatFormID = #{platformid,jdbcType=SMALLINT}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.WPlatform">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Jun 16 16:46:23 CST 2016.
    -->
    insert into W_PlatForm (PlatFormID, Type, LinkUrl, 
      PromptSql, PromptText, DealKind
      )
    values (#{platformid,jdbcType=SMALLINT}, #{type,jdbcType=TINYINT}, #{linkurl,jdbcType=VARCHAR}, 
      #{promptsql,jdbcType=VARCHAR}, #{prompttext,jdbcType=NVARCHAR}, #{dealkind,jdbcType=TINYINT}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.WPlatform">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Jun 16 16:46:23 CST 2016.
    -->
    insert into W_PlatForm
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="platformid != null">
        PlatFormID,
      </if>
      <if test="type != null">
        Type,
      </if>
      <if test="linkurl != null">
        LinkUrl,
      </if>
      <if test="promptsql != null">
        PromptSql,
      </if>
      <if test="prompttext != null">
        PromptText,
      </if>
      <if test="dealkind != null">
        DealKind,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="platformid != null">
        #{platformid,jdbcType=SMALLINT},
      </if>
      <if test="type != null">
        #{type,jdbcType=TINYINT},
      </if>
      <if test="linkurl != null">
        #{linkurl,jdbcType=VARCHAR},
      </if>
      <if test="promptsql != null">
        #{promptsql,jdbcType=VARCHAR},
      </if>
      <if test="prompttext != null">
        #{prompttext,jdbcType=NVARCHAR},
      </if>
      <if test="dealkind != null">
        #{dealkind,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.WPlatformExample" resultType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Jun 16 16:46:23 CST 2016.
    -->
    select count(*) from W_PlatForm
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.WPlatform">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Jun 16 16:46:23 CST 2016.
    -->
    update W_PlatForm
    <set>
      <if test="type != null">
        Type = #{type,jdbcType=TINYINT},
      </if>
      <if test="linkurl != null">
        LinkUrl = #{linkurl,jdbcType=VARCHAR},
      </if>
      <if test="promptsql != null">
        PromptSql = #{promptsql,jdbcType=VARCHAR},
      </if>
      <if test="prompttext != null">
        PromptText = #{prompttext,jdbcType=NVARCHAR},
      </if>
      <if test="dealkind != null">
        DealKind = #{dealkind,jdbcType=TINYINT},
      </if>
    </set>
    where PlatFormID = #{platformid,jdbcType=SMALLINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WPlatform">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Jun 16 16:46:23 CST 2016.
    -->
    update W_PlatForm
    set Type = #{type,jdbcType=TINYINT},
      LinkUrl = #{linkurl,jdbcType=VARCHAR},
      PromptSql = #{promptsql,jdbcType=VARCHAR},
      PromptText = #{prompttext,jdbcType=NVARCHAR},
      DealKind = #{dealkind,jdbcType=TINYINT}
    where PlatFormID = #{platformid,jdbcType=SMALLINT}
  </update>
  
  <select id="selectplatvalue" resultType="java.lang.String">
		${sqlstr}
  </select>
</mapper>