<?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.WConfigMapper">
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.WConfig">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 19 21:16:19 CST 2016.
    -->
    <id column="ConfigID" jdbcType="SMALLINT" property="configid" />
    <result column="ItemName" jdbcType="NVARCHAR" property="itemname" />
    <result column="Kind" jdbcType="VARCHAR" property="kind" />
    <result column="ConfigNo" jdbcType="VARCHAR" property="configno" />
    <result column="ItemValue" jdbcType="NVARCHAR" property="itemvalue" />
    <result column="ItemDec" jdbcType="NVARCHAR" property="itemdec" />
    <result column="ConfigType" jdbcType="TINYINT" property="configtype" />
    <result column="Modifier" jdbcType="VARCHAR" property="modifier" />
    <result column="Modified" jdbcType="TIMESTAMP" property="modified" />
    <result column="SysFlag" jdbcType="TINYINT" property="sysflag" />
  </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 Jan 19 21:16:19 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 Jan 19 21:16:19 CST 2016.
    -->
    ConfigID, ItemName, Kind, ConfigNo, ItemValue, ItemDec, ConfigType, Modifier, Modified,
    SysFlag
  </sql>
  <select id="selectByExample" parameterType="com.fuxi.ws.data.entity.WConfigExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 19 21:16:19 CST 2016.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from W_Config
    <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.Short" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 19 21:16:19 CST 2016.
    -->
    select
    <include refid="Base_Column_List" />
    from W_Config
    where ConfigID = #{configid,jdbcType=SMALLINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 19 21:16:19 CST 2016.
    -->
    delete from W_Config
    where ConfigID = #{configid,jdbcType=SMALLINT}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.WConfig">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 19 21:16:19 CST 2016.
    -->
    insert into W_Config (ConfigID, ItemName, Kind,
      ConfigNo, ItemValue, ItemDec,
      ConfigType, Modifier, Modified,
      SysFlag)
    values (#{configid,jdbcType=SMALLINT}, #{itemname,jdbcType=NVARCHAR}, #{kind,jdbcType=VARCHAR},
      #{configno,jdbcType=VARCHAR}, #{itemvalue,jdbcType=NVARCHAR}, #{itemdec,jdbcType=NVARCHAR},
      #{configtype,jdbcType=TINYINT}, #{modifier,jdbcType=VARCHAR}, #{modified,jdbcType=TIMESTAMP},
      #{sysflag,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.WConfig">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 19 21:16:19 CST 2016.
    -->
    insert into W_Config
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="configid != null">
        ConfigID,
      </if>
      <if test="itemname != null">
        ItemName,
      </if>
      <if test="kind != null">
        Kind,
      </if>
      <if test="configno != null">
        ConfigNo,
      </if>
      <if test="itemvalue != null">
        ItemValue,
      </if>
      <if test="itemdec != null">
        ItemDec,
      </if>
      <if test="configtype != null">
        ConfigType,
      </if>
      <if test="modifier != null">
        Modifier,
      </if>
      <if test="modified != null">
        Modified,
      </if>
      <if test="sysflag != null">
        SysFlag,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="configid != null">
        #{configid,jdbcType=SMALLINT},
      </if>
      <if test="itemname != null">
        #{itemname,jdbcType=NVARCHAR},
      </if>
      <if test="kind != null">
        #{kind,jdbcType=VARCHAR},
      </if>
      <if test="configno != null">
        #{configno,jdbcType=VARCHAR},
      </if>
      <if test="itemvalue != null">
        #{itemvalue,jdbcType=NVARCHAR},
      </if>
      <if test="itemdec != null">
        #{itemdec,jdbcType=NVARCHAR},
      </if>
      <if test="configtype != null">
        #{configtype,jdbcType=TINYINT},
      </if>
      <if test="modifier != null">
        #{modifier,jdbcType=VARCHAR},
      </if>
      <if test="modified != null">
        #{modified,jdbcType=TIMESTAMP},
      </if>
      <if test="sysflag != null">
        #{sysflag,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.WConfigExample" resultType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 19 21:16:19 CST 2016.
    -->
    select count(*) from W_Config
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.WConfig">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 19 21:16:19 CST 2016.
    -->
    update W_Config
    <set>
      <if test="itemname != null">
        ItemName = #{itemname,jdbcType=NVARCHAR},
      </if>
      <if test="kind != null">
        Kind = #{kind,jdbcType=VARCHAR},
      </if>
      <if test="configno != null">
        ConfigNo = #{configno,jdbcType=VARCHAR},
      </if>
      <if test="itemvalue != null">
        ItemValue = #{itemvalue,jdbcType=NVARCHAR},
      </if>
      <if test="itemdec != null">
        ItemDec = #{itemdec,jdbcType=NVARCHAR},
      </if>
      <if test="configtype != null">
        ConfigType = #{configtype,jdbcType=TINYINT},
      </if>
      <if test="modifier != null">
        Modifier = #{modifier,jdbcType=VARCHAR},
      </if>
      <if test="modified != null">
        Modified = #{modified,jdbcType=TIMESTAMP},
      </if>
      <if test="sysflag != null">
        SysFlag = #{sysflag,jdbcType=TINYINT},
      </if>
    </set>
    where ConfigID = #{configid,jdbcType=SMALLINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WConfig">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 19 21:16:19 CST 2016.
    -->
    update W_Config
    set ItemName = #{itemname,jdbcType=NVARCHAR},
      Kind = #{kind,jdbcType=VARCHAR},
      ConfigNo = #{configno,jdbcType=VARCHAR},
      ItemValue = #{itemvalue,jdbcType=NVARCHAR},
      ItemDec = #{itemdec,jdbcType=NVARCHAR},
      ConfigType = #{configtype,jdbcType=TINYINT},
      Modifier = #{modifier,jdbcType=VARCHAR},
      Modified = #{modified,jdbcType=TIMESTAMP},
      SysFlag = #{sysflag,jdbcType=TINYINT}
    where ConfigID = #{configid,jdbcType=SMALLINT}
  </update>

	<!-- 查询系统配置信息(去掉店铺设置部分) -->
	<select id="selectSysConfig" resultMap="BaseResultMap">
		select
		<include refid="Base_Column_List" />
		from W_Config
		where SysFlag=2
	</select>
	<!-- 网店logo，分享标题。描述，客服电话 -->
	<select id="selectShareConfig" resultMap="BaseResultMap">
		select
		<include refid="Base_Column_List" />
		from W_Config
		<if test="list.size() &gt;0">
			where
			Kind in
			<foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
				#{item}
			</foreach>
		</if>
		order by ConfigID
	</select>

	<update id="updateExtend" parameterType="java.lang.String">
		${SqlStr}
	</update>

	<!-- 系统版本号 -->
	<select id="selectSystemVersion" resultType="java.lang.String">
		select '6.0.0.6015' as SystemVersion
	</select>
	<!-- 公司服务器域名 -->
	<select id="selectServiceUrl" resultType="java.lang.String">
		select 'http://crm2016.fuxi.com' as ServiceUrl
	</select>

	<select id="remindinfo" resultType="java.util.LinkedHashMap">
		${paramSQL}
	</select>
</mapper>
