<?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.WGuideweekrptMapper">
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.WGuideweekrpt">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 06 17:29:38 CST 2016.
    -->
    <id column="RptWeek" jdbcType="INTEGER" property="rptweek" />
    <id column="GuideID" jdbcType="VARCHAR" property="guideid" />
    <result column="GuideName" jdbcType="NVARCHAR" property="guidename" />
    <result column="GuideMobile" jdbcType="VARCHAR" property="guidemobile" />
    <result column="DepartmentID" jdbcType="VARCHAR" property="departmentid" />
    <result column="Department" jdbcType="NVARCHAR" property="department" />
    <result column="photo" jdbcType="VARCHAR" property="photo" />
    <result column="TotalVip" jdbcType="INTEGER" property="totalvip" />
    <result column="TotalOrder" jdbcType="INTEGER" property="totalorder" />
    <result column="TotalNum" jdbcType="INTEGER" property="totalnum" />
    <result column="TotalSale" jdbcType="DECIMAL" property="totalsale" />
    <result column="TotalSales" jdbcType="DECIMAL" property="totalsales" />
    <result column="GuideAmt" jdbcType="DECIMAL" property="guideamt" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 06 17:29:38 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 Wed Jul 06 17:29:38 CST 2016.
    -->
    RptWeek, GuideID, GuideName, GuideMobile, DepartmentID, Department, photo, TotalVip, 
    TotalOrder, TotalNum, TotalSale, TotalSales, GuideAmt
  </sql>
  <select id="selectByExample" parameterType="com.fuxi.ws.data.entity.WGuideweekrptExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 06 17:29:38 CST 2016.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from W_GuideWeekRpt
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WGuideweekrptKey" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 06 17:29:38 CST 2016.
    -->
    select 
    <include refid="Base_Column_List" />
    from W_GuideWeekRpt
    where RptWeek = #{rptweek,jdbcType=INTEGER}
      and GuideID = #{guideid,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WGuideweekrptKey">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 06 17:29:38 CST 2016.
    -->
    delete from W_GuideWeekRpt
    where RptWeek = #{rptweek,jdbcType=INTEGER}
      and GuideID = #{guideid,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.WGuideweekrpt">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 06 17:29:38 CST 2016.
    -->
    insert into W_GuideWeekRpt (RptWeek, GuideID, GuideName, 
      GuideMobile, DepartmentID, Department, 
      photo, TotalVip, TotalOrder, 
      TotalNum, TotalSale, TotalSales, 
      GuideAmt)
    values (#{rptweek,jdbcType=INTEGER}, #{guideid,jdbcType=VARCHAR}, #{guidename,jdbcType=NVARCHAR}, 
      #{guidemobile,jdbcType=VARCHAR}, #{departmentid,jdbcType=VARCHAR}, #{department,jdbcType=NVARCHAR}, 
      #{photo,jdbcType=VARCHAR}, #{totalvip,jdbcType=INTEGER}, #{totalorder,jdbcType=INTEGER}, 
      #{totalnum,jdbcType=INTEGER}, #{totalsale,jdbcType=DECIMAL}, #{totalsales,jdbcType=DECIMAL}, 
      #{guideamt,jdbcType=DECIMAL})
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.WGuideweekrpt">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 06 17:29:38 CST 2016.
    -->
    insert into W_GuideWeekRpt
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="rptweek != null">
        RptWeek,
      </if>
      <if test="guideid != null">
        GuideID,
      </if>
      <if test="guidename != null">
        GuideName,
      </if>
      <if test="guidemobile != null">
        GuideMobile,
      </if>
      <if test="departmentid != null">
        DepartmentID,
      </if>
      <if test="department != null">
        Department,
      </if>
      <if test="photo != null">
        photo,
      </if>
      <if test="totalvip != null">
        TotalVip,
      </if>
      <if test="totalorder != null">
        TotalOrder,
      </if>
      <if test="totalnum != null">
        TotalNum,
      </if>
      <if test="totalsale != null">
        TotalSale,
      </if>
      <if test="totalsales != null">
        TotalSales,
      </if>
      <if test="guideamt != null">
        GuideAmt,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="rptweek != null">
        #{rptweek,jdbcType=INTEGER},
      </if>
      <if test="guideid != null">
        #{guideid,jdbcType=VARCHAR},
      </if>
      <if test="guidename != null">
        #{guidename,jdbcType=NVARCHAR},
      </if>
      <if test="guidemobile != null">
        #{guidemobile,jdbcType=VARCHAR},
      </if>
      <if test="departmentid != null">
        #{departmentid,jdbcType=VARCHAR},
      </if>
      <if test="department != null">
        #{department,jdbcType=NVARCHAR},
      </if>
      <if test="photo != null">
        #{photo,jdbcType=VARCHAR},
      </if>
      <if test="totalvip != null">
        #{totalvip,jdbcType=INTEGER},
      </if>
      <if test="totalorder != null">
        #{totalorder,jdbcType=INTEGER},
      </if>
      <if test="totalnum != null">
        #{totalnum,jdbcType=INTEGER},
      </if>
      <if test="totalsale != null">
        #{totalsale,jdbcType=DECIMAL},
      </if>
      <if test="totalsales != null">
        #{totalsales,jdbcType=DECIMAL},
      </if>
      <if test="guideamt != null">
        #{guideamt,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.WGuideweekrptExample" resultType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 06 17:29:38 CST 2016.
    -->
    select count(*) from W_GuideWeekRpt
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.WGuideweekrpt">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 06 17:29:38 CST 2016.
    -->
    update W_GuideWeekRpt
    <set>
      <if test="guidename != null">
        GuideName = #{guidename,jdbcType=NVARCHAR},
      </if>
      <if test="guidemobile != null">
        GuideMobile = #{guidemobile,jdbcType=VARCHAR},
      </if>
      <if test="departmentid != null">
        DepartmentID = #{departmentid,jdbcType=VARCHAR},
      </if>
      <if test="department != null">
        Department = #{department,jdbcType=NVARCHAR},
      </if>
      <if test="photo != null">
        photo = #{photo,jdbcType=VARCHAR},
      </if>
      <if test="totalvip != null">
        TotalVip = #{totalvip,jdbcType=INTEGER},
      </if>
      <if test="totalorder != null">
        TotalOrder = #{totalorder,jdbcType=INTEGER},
      </if>
      <if test="totalnum != null">
        TotalNum = #{totalnum,jdbcType=INTEGER},
      </if>
      <if test="totalsale != null">
        TotalSale = #{totalsale,jdbcType=DECIMAL},
      </if>
      <if test="totalsales != null">
        TotalSales = #{totalsales,jdbcType=DECIMAL},
      </if>
      <if test="guideamt != null">
        GuideAmt = #{guideamt,jdbcType=DECIMAL},
      </if>
    </set>
    where RptWeek = #{rptweek,jdbcType=INTEGER}
      and GuideID = #{guideid,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WGuideweekrpt">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 06 17:29:38 CST 2016.
    -->
    update W_GuideWeekRpt
    set GuideName = #{guidename,jdbcType=NVARCHAR},
      GuideMobile = #{guidemobile,jdbcType=VARCHAR},
      DepartmentID = #{departmentid,jdbcType=VARCHAR},
      Department = #{department,jdbcType=NVARCHAR},
      photo = #{photo,jdbcType=VARCHAR},
      TotalVip = #{totalvip,jdbcType=INTEGER},
      TotalOrder = #{totalorder,jdbcType=INTEGER},
      TotalNum = #{totalnum,jdbcType=INTEGER},
      TotalSale = #{totalsale,jdbcType=DECIMAL},
      TotalSales = #{totalsales,jdbcType=DECIMAL},
      GuideAmt = #{guideamt,jdbcType=DECIMAL}
    where RptWeek = #{rptweek,jdbcType=INTEGER}
      and GuideID = #{guideid,jdbcType=VARCHAR}
  </update>
</mapper>