<?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="cn.superdesk.uniorder.dao.mapper.unified.UnifiedUserlogMapper">
	<resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.unified.UnifiedUserlog">
		<id column="id" property="id" jdbcType="BIGINT"/>
		<result column="local_ip" property="localIp" jdbcType="VARCHAR"/>
		<result column="out_ip" property="outIp" jdbcType="VARCHAR"/>
		<result column="user_id" property="userId" jdbcType="BIGINT"/>
		<result column="ctype" property="ctype" jdbcType="VARCHAR"/>
		<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
		<result column="remarks" property="remarks" jdbcType="VARCHAR"/>
	</resultMap>
	<sql id="Base_Column_List">
    id, local_ip, out_ip, user_id, ctype, create_time, remarks
  </sql>
	<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
		select
		<include refid="Base_Column_List"/>
		from unified_userlog
		where id = #{id,jdbcType=BIGINT}
	</select>
	<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from unified_userlog
    where id = #{id,jdbcType=BIGINT}
  </delete>
	<insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.unified.UnifiedUserlog">
		<selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER">
			SELECT LAST_INSERT_ID()
		</selectKey>
		insert into unified_userlog (local_ip, out_ip, user_id,
		ctype, create_time, remarks
		)
		values (#{localIp,jdbcType=VARCHAR}, #{outIp,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT},
		#{ctype,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}
		)
	</insert>
	<insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.unified.UnifiedUserlog">
		<selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER">
			SELECT LAST_INSERT_ID()
		</selectKey>
		insert into unified_userlog
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="localIp != null">
				local_ip,
			</if>
			<if test="outIp != null">
				out_ip,
			</if>
			<if test="userId != null">
				user_id,
			</if>
			<if test="ctype != null">
				ctype,
			</if>
			<if test="createTime != null">
				create_time,
			</if>
			<if test="remarks != null">
				remarks,
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="localIp != null">
				#{localIp,jdbcType=VARCHAR},
			</if>
			<if test="outIp != null">
				#{outIp,jdbcType=VARCHAR},
			</if>
			<if test="userId != null">
				#{userId,jdbcType=BIGINT},
			</if>
			<if test="ctype != null">
				#{ctype,jdbcType=VARCHAR},
			</if>
			<if test="createTime != null">
				#{createTime,jdbcType=TIMESTAMP},
			</if>
			<if test="remarks != null">
				#{remarks,jdbcType=VARCHAR},
			</if>
		</trim>
	</insert>
	<update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.unified.UnifiedUserlog">
		update unified_userlog
		<set>
			<if test="localIp != null">
				local_ip = #{localIp,jdbcType=VARCHAR},
			</if>
			<if test="outIp != null">
				out_ip = #{outIp,jdbcType=VARCHAR},
			</if>
			<if test="userId != null">
				user_id = #{userId,jdbcType=BIGINT},
			</if>
			<if test="ctype != null">
				ctype = #{ctype,jdbcType=VARCHAR},
			</if>
			<if test="createTime != null">
				create_time = #{createTime,jdbcType=TIMESTAMP},
			</if>
			<if test="remarks != null">
				remarks = #{remarks,jdbcType=VARCHAR},
			</if>
		</set>
		where id = #{id,jdbcType=BIGINT}
	</update>
	<update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.unified.UnifiedUserlog">
    update unified_userlog
    set local_ip = #{localIp,jdbcType=VARCHAR},
      out_ip = #{outIp,jdbcType=VARCHAR},
      user_id = #{userId,jdbcType=BIGINT},
      ctype = #{ctype,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      remarks = #{remarks,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>