<?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.WdRptdeptmonthMapper" >
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.WdRptdeptmonth" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 18 10:50:38 CST 2018.
    -->
    <id column="departmentid" property="departmentid" jdbcType="VARCHAR" />
    <id column="DataMonth" property="datamonth" jdbcType="INTEGER" />
    <result column="DataYear" property="datayear" jdbcType="INTEGER" />
    <result column="Department" property="department" jdbcType="VARCHAR" />
    <result column="SellNum" property="sellnum" jdbcType="INTEGER" />
    <result column="SellBillNum" property="sellbillnum" jdbcType="INTEGER" />
    <result column="SellMoney" property="sellmoney" jdbcType="DECIMAL" />
    <result column="RealMoney" property="realmoney" jdbcType="DECIMAL" />
    <result column="Discount" property="discount" jdbcType="DECIMAL" />
    <result column="VipPrice" property="vipprice" jdbcType="DECIMAL" />
    <result column="AveragePrice" property="averageprice" jdbcType="DECIMAL" />
    <result column="UnionRate" property="unionrate" jdbcType="DECIMAL" />
    <result column="VipSell" property="vipsell" jdbcType="INTEGER" />
    <result column="VipMoney" property="vipmoney" jdbcType="INTEGER" />
  </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 18 10:50:38 CST 2018.
    -->
    <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 Wed Jul 18 10:50:38 CST 2018.
    -->
    departmentid, DataMonth, DataYear, Department, SellNum, SellBillNum, SellMoney, RealMoney, 
    Discount, VipPrice, AveragePrice, UnionRate, VipSell, VipMoney
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.fuxi.ws.data.entity.WdRptdeptmonthExample" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 18 10:50:38 CST 2018.
    -->
    select
    <if test="distinct" >
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from WD_RptDeptMonth
    <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="com.fuxi.ws.data.entity.WdRptdeptmonthKey" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 18 10:50:38 CST 2018.
    -->
    select 
    <include refid="Base_Column_List" />
    from WD_RptDeptMonth
    where departmentid = #{departmentid,jdbcType=VARCHAR}
      and DataMonth = #{datamonth,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WdRptdeptmonthKey" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 18 10:50:38 CST 2018.
    -->
    delete from WD_RptDeptMonth
    where departmentid = #{departmentid,jdbcType=VARCHAR}
      and DataMonth = #{datamonth,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.WdRptdeptmonth" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 18 10:50:38 CST 2018.
    -->
    insert into WD_RptDeptMonth (departmentid, DataMonth, DataYear, 
      Department, SellNum, SellBillNum, 
      SellMoney, RealMoney, Discount, 
      VipPrice, AveragePrice, UnionRate, 
      VipSell, VipMoney)
    values (#{departmentid,jdbcType=VARCHAR}, #{datamonth,jdbcType=INTEGER}, #{datayear,jdbcType=INTEGER}, 
      #{department,jdbcType=VARCHAR}, #{sellnum,jdbcType=INTEGER}, #{sellbillnum,jdbcType=INTEGER}, 
      #{sellmoney,jdbcType=DECIMAL}, #{realmoney,jdbcType=DECIMAL}, #{discount,jdbcType=DECIMAL}, 
      #{vipprice,jdbcType=DECIMAL}, #{averageprice,jdbcType=DECIMAL}, #{unionrate,jdbcType=DECIMAL}, 
      #{vipsell,jdbcType=INTEGER}, #{vipmoney,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.WdRptdeptmonth" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 18 10:50:38 CST 2018.
    -->
    insert into WD_RptDeptMonth
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="departmentid != null" >
        departmentid,
      </if>
      <if test="datamonth != null" >
        DataMonth,
      </if>
      <if test="datayear != null" >
        DataYear,
      </if>
      <if test="department != null" >
        Department,
      </if>
      <if test="sellnum != null" >
        SellNum,
      </if>
      <if test="sellbillnum != null" >
        SellBillNum,
      </if>
      <if test="sellmoney != null" >
        SellMoney,
      </if>
      <if test="realmoney != null" >
        RealMoney,
      </if>
      <if test="discount != null" >
        Discount,
      </if>
      <if test="vipprice != null" >
        VipPrice,
      </if>
      <if test="averageprice != null" >
        AveragePrice,
      </if>
      <if test="unionrate != null" >
        UnionRate,
      </if>
      <if test="vipsell != null" >
        VipSell,
      </if>
      <if test="vipmoney != null" >
        VipMoney,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="departmentid != null" >
        #{departmentid,jdbcType=VARCHAR},
      </if>
      <if test="datamonth != null" >
        #{datamonth,jdbcType=INTEGER},
      </if>
      <if test="datayear != null" >
        #{datayear,jdbcType=INTEGER},
      </if>
      <if test="department != null" >
        #{department,jdbcType=VARCHAR},
      </if>
      <if test="sellnum != null" >
        #{sellnum,jdbcType=INTEGER},
      </if>
      <if test="sellbillnum != null" >
        #{sellbillnum,jdbcType=INTEGER},
      </if>
      <if test="sellmoney != null" >
        #{sellmoney,jdbcType=DECIMAL},
      </if>
      <if test="realmoney != null" >
        #{realmoney,jdbcType=DECIMAL},
      </if>
      <if test="discount != null" >
        #{discount,jdbcType=DECIMAL},
      </if>
      <if test="vipprice != null" >
        #{vipprice,jdbcType=DECIMAL},
      </if>
      <if test="averageprice != null" >
        #{averageprice,jdbcType=DECIMAL},
      </if>
      <if test="unionrate != null" >
        #{unionrate,jdbcType=DECIMAL},
      </if>
      <if test="vipsell != null" >
        #{vipsell,jdbcType=INTEGER},
      </if>
      <if test="vipmoney != null" >
        #{vipmoney,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.WdRptdeptmonthExample" resultType="java.lang.Integer" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 18 10:50:38 CST 2018.
    -->
    select count(*) from WD_RptDeptMonth
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.WdRptdeptmonth" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 18 10:50:38 CST 2018.
    -->
    update WD_RptDeptMonth
    <set >
      <if test="datayear != null" >
        DataYear = #{datayear,jdbcType=INTEGER},
      </if>
      <if test="department != null" >
        Department = #{department,jdbcType=VARCHAR},
      </if>
      <if test="sellnum != null" >
        SellNum = #{sellnum,jdbcType=INTEGER},
      </if>
      <if test="sellbillnum != null" >
        SellBillNum = #{sellbillnum,jdbcType=INTEGER},
      </if>
      <if test="sellmoney != null" >
        SellMoney = #{sellmoney,jdbcType=DECIMAL},
      </if>
      <if test="realmoney != null" >
        RealMoney = #{realmoney,jdbcType=DECIMAL},
      </if>
      <if test="discount != null" >
        Discount = #{discount,jdbcType=DECIMAL},
      </if>
      <if test="vipprice != null" >
        VipPrice = #{vipprice,jdbcType=DECIMAL},
      </if>
      <if test="averageprice != null" >
        AveragePrice = #{averageprice,jdbcType=DECIMAL},
      </if>
      <if test="unionrate != null" >
        UnionRate = #{unionrate,jdbcType=DECIMAL},
      </if>
      <if test="vipsell != null" >
        VipSell = #{vipsell,jdbcType=INTEGER},
      </if>
      <if test="vipmoney != null" >
        VipMoney = #{vipmoney,jdbcType=INTEGER},
      </if>
    </set>
    where departmentid = #{departmentid,jdbcType=VARCHAR}
      and DataMonth = #{datamonth,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WdRptdeptmonth" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 18 10:50:38 CST 2018.
    -->
    update WD_RptDeptMonth
    set DataYear = #{datayear,jdbcType=INTEGER},
      Department = #{department,jdbcType=VARCHAR},
      SellNum = #{sellnum,jdbcType=INTEGER},
      SellBillNum = #{sellbillnum,jdbcType=INTEGER},
      SellMoney = #{sellmoney,jdbcType=DECIMAL},
      RealMoney = #{realmoney,jdbcType=DECIMAL},
      Discount = #{discount,jdbcType=DECIMAL},
      VipPrice = #{vipprice,jdbcType=DECIMAL},
      AveragePrice = #{averageprice,jdbcType=DECIMAL},
      UnionRate = #{unionrate,jdbcType=DECIMAL},
      VipSell = #{vipsell,jdbcType=INTEGER},
      VipMoney = #{vipmoney,jdbcType=INTEGER}
    where departmentid = #{departmentid,jdbcType=VARCHAR}
      and DataMonth = #{datamonth,jdbcType=INTEGER}
  </update>
</mapper>