<?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.WChatMapper">
	<resultMap id="BaseResultMap"
		type="com.fuxi.ws.data.entity.WChat">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Oct 14 
			13:33:59 CST 2015. -->
		<id column="ChatID" property="chatid" jdbcType="BIGINT" />
		<result column="UID" property="uid" jdbcType="CHAR" />
		<result column="VIPID" property="vipid" jdbcType="VARCHAR" />
		<result column="VIPNick" property="vipnick" jdbcType="NVARCHAR" />
		<result column="GuideID" property="guideid" jdbcType="VARCHAR" />
		<result column="GuideNick" property="guidenick"
			jdbcType="NVARCHAR" />
		<result column="SendContent" property="sendcontent"
			jdbcType="NVARCHAR" />
		<result column="Sender" property="sender" jdbcType="TINYINT" />
		<result column="SendTime" property="sendtime"
			jdbcType="TIMESTAMP" />
		<result column="Readed" property="readed" jdbcType="BIT" />
		<result column="CType" property="ctype" jdbcType="TINYINT" />
		<result column="ImgUrl" property="imgurl" jdbcType="VARCHAR" />
		<result column="LinkUrl" property="linkurl" jdbcType="VARCHAR" />
	</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 Oct 14 
			13:33:59 CST 2015. -->
		<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 Oct 14 
			13:33:59 CST 2015. -->
		ChatID, UID, VIPID, VIPNick, GuideID, GuideNick, SendContent, Sender,
		SendTime, Readed,
		CType, ImgUrl, LinkUrl
	</sql>
	<select id="selectByExample" resultMap="BaseResultMap"
		parameterType="com.fuxi.ws.data.entity.WChatExample">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Oct 14 
			13:33:59 CST 2015. -->
		select
		<if test="distinct">
			distinct
		</if>
		'false' as QUERYID,
		<include refid="Base_Column_List" />
		from W_Chat
		<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="java.lang.Long">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Oct 14 
			13:33:59 CST 2015. -->
		select
		<include refid="Base_Column_List" />
		from W_Chat
		where ChatID = #{chatid,jdbcType=BIGINT}
	</select>
	<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Oct 14 
			13:33:59 CST 2015. -->
		delete from W_Chat
		where ChatID = #{chatid,jdbcType=BIGINT}
	</delete>
	<insert id="insert"
		parameterType="com.fuxi.ws.data.entity.WChat" useGeneratedKeys="true"
		keyProperty="chatid">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Oct 14 
			13:33:59 CST 2015. -->
		insert into W_Chat (ChatID, UID, VIPID,
		VIPNick, GuideID, GuideNick,
		SendContent, Sender, SendTime,
		Readed, CType, ImgUrl,
		LinkUrl)
		values
		(#{chatid,jdbcType=BIGINT}, #{uid,jdbcType=CHAR},
		#{vipid,jdbcType=VARCHAR},
		#{vipnick,jdbcType=NVARCHAR},
		#{guideid,jdbcType=VARCHAR}, #{guidenick,jdbcType=NVARCHAR},
		#{sendcontent,jdbcType=NVARCHAR}, #{sender,jdbcType=TINYINT},
		#{sendtime,jdbcType=TIMESTAMP},
		#{readed,jdbcType=BIT},
		#{ctype,jdbcType=TINYINT}, #{imgurl,jdbcType=VARCHAR},
		#{linkurl,jdbcType=VARCHAR})
	</insert>
	<insert id="insertSelective"
		parameterType="com.fuxi.ws.data.entity.WChat" useGeneratedKeys="true"
		keyProperty="chatid">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Oct 14 
			13:33:59 CST 2015. -->
		insert into W_Chat
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="chatid != null">
				ChatID,
			</if>
			<if test="uid != null">
				UID,
			</if>
			<if test="vipid != null">
				VIPID,
			</if>
			<if test="vipnick != null">
				VIPNick,
			</if>
			<if test="guideid != null">
				GuideID,
			</if>
			<if test="guidenick != null">
				GuideNick,
			</if>
			<if test="sendcontent != null">
				SendContent,
			</if>
			<if test="sender != null">
				Sender,
			</if>
			<if test="sendtime != null">
				SendTime,
			</if>
			<if test="readed != null">
				Readed,
			</if>
			<if test="ctype != null">
				CType,
			</if>
			<if test="imgurl != null">
				ImgUrl,
			</if>
			<if test="linkurl != null">
				LinkUrl,
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="chatid != null">
				#{chatid,jdbcType=BIGINT},
			</if>
			<if test="uid != null">
				#{uid,jdbcType=CHAR},
			</if>
			<if test="vipid != null">
				#{vipid,jdbcType=VARCHAR},
			</if>
			<if test="vipnick != null">
				#{vipnick,jdbcType=NVARCHAR},
			</if>
			<if test="guideid != null">
				#{guideid,jdbcType=VARCHAR},
			</if>
			<if test="guidenick != null">
				#{guidenick,jdbcType=NVARCHAR},
			</if>
			<if test="sendcontent != null">
				#{sendcontent,jdbcType=NVARCHAR},
			</if>
			<if test="sender != null">
				#{sender,jdbcType=TINYINT},
			</if>
			<if test="sendtime != null">
				#{sendtime,jdbcType=TIMESTAMP},
			</if>
			<if test="readed != null">
				#{readed,jdbcType=BIT},
			</if>
			<if test="ctype != null">
				#{ctype,jdbcType=TINYINT},
			</if>
			<if test="imgurl != null">
				#{imgurl,jdbcType=VARCHAR},
			</if>
			<if test="linkurl != null">
				#{linkurl,jdbcType=VARCHAR},
			</if>
		</trim>
	</insert>
	<select id="countByExample"
		parameterType="com.fuxi.ws.data.entity.WChatExample"
		resultType="java.lang.Integer">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Oct 14 
			13:33:59 CST 2015. -->
		select count(*) from W_Chat
		<if test="_parameter != null">
			<include refid="Example_Where_Clause" />
		</if>
	</select>
	<update id="updateByPrimaryKeySelective"
		parameterType="com.fuxi.ws.data.entity.WChat">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Oct 14 
			13:33:59 CST 2015. -->
		update W_Chat
		<set>
			<if test="uid != null">
				UID = #{uid,jdbcType=CHAR},
			</if>
			<if test="vipid != null">
				VIPID = #{vipid,jdbcType=VARCHAR},
			</if>
			<if test="vipnick != null">
				VIPNick = #{vipnick,jdbcType=NVARCHAR},
			</if>
			<if test="guideid != null">
				GuideID = #{guideid,jdbcType=VARCHAR},
			</if>
			<if test="guidenick != null">
				GuideNick = #{guidenick,jdbcType=NVARCHAR},
			</if>
			<if test="sendcontent != null">
				SendContent = #{sendcontent,jdbcType=NVARCHAR},
			</if>
			<if test="sender != null">
				Sender = #{sender,jdbcType=TINYINT},
			</if>
			<if test="sendtime != null">
				SendTime = #{sendtime,jdbcType=TIMESTAMP},
			</if>
			<if test="readed != null">
				Readed = #{readed,jdbcType=BIT},
			</if>
			<if test="ctype != null">
				CType = #{ctype,jdbcType=TINYINT},
			</if>
			<if test="imgurl != null">
				ImgUrl = #{imgurl,jdbcType=VARCHAR},
			</if>
			<if test="linkurl != null">
				LinkUrl = #{linkurl,jdbcType=VARCHAR},
			</if>
		</set>
		where ChatID = #{chatid,jdbcType=BIGINT}
	</update>
	<update id="updateByPrimaryKey"
		parameterType="com.fuxi.ws.data.entity.WChat">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Oct 14 
			13:33:59 CST 2015. -->
		update W_Chat
		set UID = #{uid,jdbcType=CHAR},
		VIPID =
		#{vipid,jdbcType=VARCHAR},
		VIPNick = #{vipnick,jdbcType=NVARCHAR},
		GuideID = #{guideid,jdbcType=VARCHAR},
		GuideNick =
		#{guidenick,jdbcType=NVARCHAR},
		SendContent =
		#{sendcontent,jdbcType=NVARCHAR},
		Sender = #{sender,jdbcType=TINYINT},
		SendTime = #{sendtime,jdbcType=TIMESTAMP},
		Readed =
		#{readed,jdbcType=BIT},
		CType = #{ctype,jdbcType=TINYINT},
		ImgUrl =
		#{imgurl,jdbcType=VARCHAR},
		LinkUrl = #{linkurl,jdbcType=VARCHAR}
		where
		ChatID = #{chatid,jdbcType=BIGINT}
	</update>
</mapper>