<?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.WMenuMapper">
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.WMenu">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat Apr 18 12:24:41 CST 2015.
    -->
    <id column="MenuID" jdbcType="INTEGER" property="menuid" />
    <result column="PmenuID" jdbcType="INTEGER" property="pmenuid" />
    <result column="MenuName" jdbcType="NVARCHAR" property="menuname" />
    <result column="MenuIdx" jdbcType="TINYINT" property="menuidx" />
    <result column="WeixinID" jdbcType="VARCHAR" property="weixinid" />
    <result column="MenuType" jdbcType="TINYINT" property="menutype" />
    <result column="MoldID" jdbcType="INTEGER" property="moldid" />
    <result column="LinkUrl" jdbcType="NVARCHAR" property="linkurl" />
    <result column="MapID" jdbcType="SMALLINT" property="mapid" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat Apr 18 12:24:41 CST 2015.
    -->
    <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 Sat Apr 18 12:24:41 CST 2015.
    -->
    MenuID, PmenuID, MenuName, MenuIdx, WeixinID, MenuType, MoldID, LinkUrl, MapID
  </sql>
  <select id="selectByExample" parameterType="com.fuxi.ws.data.entity.WMenuExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat Apr 18 12:24:41 CST 2015.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from W_Menu
    <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.Integer" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat Apr 18 12:24:41 CST 2015.
    -->
    select 
    <include refid="Base_Column_List" />
    from W_Menu
    where MenuID = #{menuid,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 Sat Apr 18 12:24:41 CST 2015.
    -->
    delete from W_Menu
    where MenuID = #{menuid,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.WMenu">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat Apr 18 12:24:41 CST 2015.
    -->
    insert into W_Menu (MenuID, PmenuID, MenuName, 
      MenuIdx, WeixinID, MenuType, 
      MoldID, LinkUrl, MapID
      )
    values (#{menuid,jdbcType=INTEGER}, #{pmenuid,jdbcType=INTEGER}, #{menuname,jdbcType=NVARCHAR}, 
      #{menuidx,jdbcType=TINYINT}, #{weixinid,jdbcType=VARCHAR}, #{menutype,jdbcType=TINYINT}, 
      #{moldid,jdbcType=INTEGER}, #{linkurl,jdbcType=NVARCHAR}, #{mapid,jdbcType=SMALLINT}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.WMenu">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat Apr 18 12:24:41 CST 2015.
    -->
    insert into W_Menu
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="menuid != null">
        MenuID,
      </if>
      <if test="pmenuid != null">
        PmenuID,
      </if>
      <if test="menuname != null">
        MenuName,
      </if>
      <if test="menuidx != null">
        MenuIdx,
      </if>
      <if test="weixinid != null">
        WeixinID,
      </if>
      <if test="menutype != null">
        MenuType,
      </if>
      <if test="moldid != null">
        MoldID,
      </if>
      <if test="linkurl != null">
        LinkUrl,
      </if>
      <if test="mapid != null">
        MapID,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="menuid != null">
        #{menuid,jdbcType=INTEGER},
      </if>
      <if test="pmenuid != null">
        #{pmenuid,jdbcType=INTEGER},
      </if>
      <if test="menuname != null">
        #{menuname,jdbcType=NVARCHAR},
      </if>
      <if test="menuidx != null">
        #{menuidx,jdbcType=TINYINT},
      </if>
      <if test="weixinid != null">
        #{weixinid,jdbcType=VARCHAR},
      </if>
      <if test="menutype != null">
        #{menutype,jdbcType=TINYINT},
      </if>
      <if test="moldid != null">
        #{moldid,jdbcType=INTEGER},
      </if>
      <if test="linkurl != null">
        #{linkurl,jdbcType=NVARCHAR},
      </if>
      <if test="mapid != null">
        #{mapid,jdbcType=SMALLINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.WMenuExample" resultType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat Apr 18 12:24:41 CST 2015.
    -->
    select count(*) from W_Menu
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.WMenu">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat Apr 18 12:24:41 CST 2015.
    -->
    update W_Menu
    <set>
      <if test="pmenuid != null">
        PmenuID = #{pmenuid,jdbcType=INTEGER},
      </if>
      <if test="menuname != null">
        MenuName = #{menuname,jdbcType=NVARCHAR},
      </if>
      <if test="menuidx != null">
        MenuIdx = #{menuidx,jdbcType=TINYINT},
      </if>
      <if test="weixinid != null">
        WeixinID = #{weixinid,jdbcType=VARCHAR},
      </if>
      <if test="menutype != null">
        MenuType = #{menutype,jdbcType=TINYINT},
      </if>
      <if test="moldid != null">
        MoldID = #{moldid,jdbcType=INTEGER},
      </if>
      <if test="linkurl != null">
        LinkUrl = #{linkurl,jdbcType=NVARCHAR},
      </if>
      <if test="mapid != null">
        MapID = #{mapid,jdbcType=SMALLINT},
      </if>
    </set>
    where MenuID = #{menuid,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WMenu">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat Apr 18 12:24:41 CST 2015.
    -->
    update W_Menu
    set PmenuID = #{pmenuid,jdbcType=INTEGER},
      MenuName = #{menuname,jdbcType=NVARCHAR},
      MenuIdx = #{menuidx,jdbcType=TINYINT},
      WeixinID = #{weixinid,jdbcType=VARCHAR},
      MenuType = #{menutype,jdbcType=TINYINT},
      MoldID = #{moldid,jdbcType=INTEGER},
      LinkUrl = #{linkurl,jdbcType=NVARCHAR},
      MapID = #{mapid,jdbcType=SMALLINT}
    where MenuID = #{menuid,jdbcType=INTEGER}
  </update>
</mapper>