<?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.WOperatingMapper">
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.WOperating">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Oct 25 18:49:55 CST 2016.
    -->
    <id column="OperatingID" jdbcType="INTEGER" property="operatingid" />
    <result column="PoperatingID" jdbcType="INTEGER" property="poperatingid" />
    <result column="Operating" jdbcType="NVARCHAR" property="operating" />
    <result column="OPeratetype" jdbcType="TINYINT" property="operatetype" />
    <result column="ViewFlag" jdbcType="TINYINT" property="viewflag" />
    <result column="ShowIndex" jdbcType="SMALLINT" property="showindex" />
    <result column="Memo" jdbcType="NVARCHAR" property="memo" />
    <result column="Event" jdbcType="VARCHAR" property="event" />
    <result column="BelongOper" jdbcType="INTEGER" property="belongoper" />
    <result column="ShowSite" jdbcType="TINYINT" property="showsite" />
    <result column="Param" jdbcType="VARCHAR" property="param" />
    <result column="MastOper" jdbcType="TINYINT" property="mastoper" />
    <result column="DeptOper" jdbcType="TINYINT" property="deptoper" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Oct 25 18:49:55 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 Tue Oct 25 18:49:55 CST 2016.
    -->
    OperatingID, PoperatingID, Operating, OPeratetype, ViewFlag, ShowIndex, Memo, Event, 
    BelongOper, ShowSite, Param, MastOper, DeptOper
  </sql>
  <select id="selectByExample" parameterType="com.fuxi.ws.data.entity.WOperatingExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Oct 25 18:49:55 CST 2016.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from W_Operating
    <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 Tue Oct 25 18:49:55 CST 2016.
    -->
    select 
    <include refid="Base_Column_List" />
    from W_Operating
    where OperatingID = #{operatingid,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 Tue Oct 25 18:49:55 CST 2016.
    -->
    delete from W_Operating
    where OperatingID = #{operatingid,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.WOperating">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Oct 25 18:49:55 CST 2016.
    -->
    insert into W_Operating (OperatingID, PoperatingID, Operating, 
      OPeratetype, ViewFlag, ShowIndex, 
      Memo, Event, BelongOper, 
      ShowSite, Param, MastOper, 
      DeptOper)
    values (#{operatingid,jdbcType=INTEGER}, #{poperatingid,jdbcType=INTEGER}, #{operating,jdbcType=NVARCHAR}, 
      #{operatetype,jdbcType=TINYINT}, #{viewflag,jdbcType=TINYINT}, #{showindex,jdbcType=SMALLINT}, 
      #{memo,jdbcType=NVARCHAR}, #{event,jdbcType=VARCHAR}, #{belongoper,jdbcType=INTEGER}, 
      #{showsite,jdbcType=TINYINT}, #{param,jdbcType=VARCHAR}, #{mastoper,jdbcType=TINYINT}, 
      #{deptoper,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.WOperating">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Oct 25 18:49:55 CST 2016.
    -->
    insert into W_Operating
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="operatingid != null">
        OperatingID,
      </if>
      <if test="poperatingid != null">
        PoperatingID,
      </if>
      <if test="operating != null">
        Operating,
      </if>
      <if test="operatetype != null">
        OPeratetype,
      </if>
      <if test="viewflag != null">
        ViewFlag,
      </if>
      <if test="showindex != null">
        ShowIndex,
      </if>
      <if test="memo != null">
        Memo,
      </if>
      <if test="event != null">
        Event,
      </if>
      <if test="belongoper != null">
        BelongOper,
      </if>
      <if test="showsite != null">
        ShowSite,
      </if>
      <if test="param != null">
        Param,
      </if>
      <if test="mastoper != null">
        MastOper,
      </if>
      <if test="deptoper != null">
        DeptOper,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="operatingid != null">
        #{operatingid,jdbcType=INTEGER},
      </if>
      <if test="poperatingid != null">
        #{poperatingid,jdbcType=INTEGER},
      </if>
      <if test="operating != null">
        #{operating,jdbcType=NVARCHAR},
      </if>
      <if test="operatetype != null">
        #{operatetype,jdbcType=TINYINT},
      </if>
      <if test="viewflag != null">
        #{viewflag,jdbcType=TINYINT},
      </if>
      <if test="showindex != null">
        #{showindex,jdbcType=SMALLINT},
      </if>
      <if test="memo != null">
        #{memo,jdbcType=NVARCHAR},
      </if>
      <if test="event != null">
        #{event,jdbcType=VARCHAR},
      </if>
      <if test="belongoper != null">
        #{belongoper,jdbcType=INTEGER},
      </if>
      <if test="showsite != null">
        #{showsite,jdbcType=TINYINT},
      </if>
      <if test="param != null">
        #{param,jdbcType=VARCHAR},
      </if>
      <if test="mastoper != null">
        #{mastoper,jdbcType=TINYINT},
      </if>
      <if test="deptoper != null">
        #{deptoper,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.WOperatingExample" resultType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Oct 25 18:49:55 CST 2016.
    -->
    select count(*) from W_Operating
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.WOperating">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Oct 25 18:49:55 CST 2016.
    -->
    update W_Operating
    <set>
      <if test="poperatingid != null">
        PoperatingID = #{poperatingid,jdbcType=INTEGER},
      </if>
      <if test="operating != null">
        Operating = #{operating,jdbcType=NVARCHAR},
      </if>
      <if test="operatetype != null">
        OPeratetype = #{operatetype,jdbcType=TINYINT},
      </if>
      <if test="viewflag != null">
        ViewFlag = #{viewflag,jdbcType=TINYINT},
      </if>
      <if test="showindex != null">
        ShowIndex = #{showindex,jdbcType=SMALLINT},
      </if>
      <if test="memo != null">
        Memo = #{memo,jdbcType=NVARCHAR},
      </if>
      <if test="event != null">
        Event = #{event,jdbcType=VARCHAR},
      </if>
      <if test="belongoper != null">
        BelongOper = #{belongoper,jdbcType=INTEGER},
      </if>
      <if test="showsite != null">
        ShowSite = #{showsite,jdbcType=TINYINT},
      </if>
      <if test="param != null">
        Param = #{param,jdbcType=VARCHAR},
      </if>
      <if test="mastoper != null">
        MastOper = #{mastoper,jdbcType=TINYINT},
      </if>
      <if test="deptoper != null">
        DeptOper = #{deptoper,jdbcType=TINYINT},
      </if>
    </set>
    where OperatingID = #{operatingid,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WOperating">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Oct 25 18:49:55 CST 2016.
    -->
    update W_Operating
    set PoperatingID = #{poperatingid,jdbcType=INTEGER},
      Operating = #{operating,jdbcType=NVARCHAR},
      OPeratetype = #{operatetype,jdbcType=TINYINT},
      ViewFlag = #{viewflag,jdbcType=TINYINT},
      ShowIndex = #{showindex,jdbcType=SMALLINT},
      Memo = #{memo,jdbcType=NVARCHAR},
      Event = #{event,jdbcType=VARCHAR},
      BelongOper = #{belongoper,jdbcType=INTEGER},
      ShowSite = #{showsite,jdbcType=TINYINT},
      Param = #{param,jdbcType=VARCHAR},
      MastOper = #{mastoper,jdbcType=TINYINT},
      DeptOper = #{deptoper,jdbcType=TINYINT}
    where OperatingID = #{operatingid,jdbcType=INTEGER}
  </update>
  
  <select id="selectByExmp" parameterType="com.fuxi.ws.data.entity.WOperatingExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    'false' as QUERYID,
    OperatingID, PoperatingID, case OperatingID when 203 then (select top 1 ItemValue from W_Config where configid='73') + '列表'
			when 204 then (select top 1 ItemValue from W_Config where configid='74')  + '列表'
			when 103 then (select top 1 ItemValue from W_Config where configid='84')  + '设置'
			when 104 then (select top 1 ItemValue from W_Config where configid='85')  + '设置'
			else Operating end as Operating, 
    OPeratetype, ViewFlag, ShowIndex, Memo, Event, BelongOper, ShowSite, Param, MastOper, DeptOper
    from W_Operating
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>