<?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.WMoldMapper" >
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.WMold" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Jan 09 12:12:13 CST 2015.
    -->
    <id column="MoldID" property="moldid" jdbcType="INTEGER" />
    <result column="MoldName" property="moldname" jdbcType="NVARCHAR" />
    <result column="MoldUrl" property="moldurl" jdbcType="NVARCHAR" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Jan 09 12:12:13 CST 2015.
    -->
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" 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 Fri Jan 09 12:12:13 CST 2015.
    -->
    MoldID, MoldName, MoldUrl
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.fuxi.ws.data.entity.WMoldExample" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Jan 09 12:12:13 CST 2015.
    -->
    select
    <if test="distinct" >
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from W_Mold
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Jan 09 12:12:13 CST 2015.
    -->
    select 
    <include refid="Base_Column_List" />
    from W_Mold
    where MoldID = #{moldid,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Jan 09 12:12:13 CST 2015.
    -->
    delete from W_Mold
    where MoldID = #{moldid,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.WMold" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Jan 09 12:12:13 CST 2015.
    -->
    insert into W_Mold (MoldID, MoldName, MoldUrl
      )
    values (#{moldid,jdbcType=INTEGER}, #{moldname,jdbcType=NVARCHAR}, #{moldurl,jdbcType=NVARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.WMold" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Jan 09 12:12:13 CST 2015.
    -->
    insert into W_Mold
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="moldid != null" >
        MoldID,
      </if>
      <if test="moldname != null" >
        MoldName,
      </if>
      <if test="moldurl != null" >
        MoldUrl,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="moldid != null" >
        #{moldid,jdbcType=INTEGER},
      </if>
      <if test="moldname != null" >
        #{moldname,jdbcType=NVARCHAR},
      </if>
      <if test="moldurl != null" >
        #{moldurl,jdbcType=NVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.WMoldExample" resultType="java.lang.Integer" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Jan 09 12:12:13 CST 2015.
    -->
    select count(*) from W_Mold
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.WMold" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Jan 09 12:12:13 CST 2015.
    -->
    update W_Mold
    <set >
      <if test="moldname != null" >
        MoldName = #{moldname,jdbcType=NVARCHAR},
      </if>
      <if test="moldurl != null" >
        MoldUrl = #{moldurl,jdbcType=NVARCHAR},
      </if>
    </set>
    where MoldID = #{moldid,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WMold" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Jan 09 12:12:13 CST 2015.
    -->
    update W_Mold
    set MoldName = #{moldname,jdbcType=NVARCHAR},
      MoldUrl = #{moldurl,jdbcType=NVARCHAR}
    where MoldID = #{moldid,jdbcType=INTEGER}
  </update>
</mapper>