<?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.yeshi.fanli.dao.mybatis.taobao.TaoBaoUnionAuthRecordMapper">
|
<resultMap id="BaseResultMap"
|
type="com.yeshi.fanli.entity.taobao.TaoBaoUnionAuthRecord">
|
<id column="tuar_id" property="id" jdbcType="BIGINT" />
|
<result column="tuar_taobao_user_nick" property="taoBaoUserNick"
|
jdbcType="VARCHAR" />
|
<result column="tuar_taobao_open_uid" property="taoBaoOpenUid"
|
jdbcType="VARCHAR" />
|
<result column="tuar_taobao_user_id" property="taoBaoUserId"
|
jdbcType="VARCHAR" />
|
<result column="tuar_create_time" property="createTime"
|
jdbcType="TIMESTAMP" />
|
<result column="tuar_update_time" property="updateTime"
|
jdbcType="TIMESTAMP" />
|
|
<association property="user" column="tuar_uid"
|
javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
<id column="tuar_uid" property="id" />
|
</association>
|
</resultMap>
|
<sql id="Base_Column_List">tuar_id,tuar_uid,tuar_taobao_user_nick,tuar_taobao_open_uid,tuar_taobao_user_id,tuar_create_time,tuar_update_time
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_taobao_union_auth_record where tuar_id =
|
#{id,jdbcType=BIGINT}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
yeshi_ec_taobao_union_auth_record where tuar_id =
|
#{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoUnionAuthRecord"
|
useGeneratedKeys="true" keyProperty="id">insert into
|
yeshi_ec_taobao_union_auth_record
|
(tuar_id,tuar_uid,tuar_taobao_user_nick,tuar_taobao_open_uid,tuar_taobao_user_id,tuar_create_time,tuar_update_time)
|
values
|
(#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{taoBaoUserNick,jdbcType=VARCHAR},#{taoBaoOpenUid,jdbcType=VARCHAR},#{taoBaoUserId,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
|
</insert>
|
<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoUnionAuthRecord"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into yeshi_ec_taobao_union_auth_record
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">tuar_id,</if>
|
<if test="user != null">tuar_uid,</if>
|
<if test="taoBaoUserNick != null">tuar_taobao_user_nick,</if>
|
<if test="taoBaoOpenUid != null">tuar_taobao_open_uid,</if>
|
<if test="taoBaoUserId != null">tuar_taobao_user_id,</if>
|
<if test="createTime != null">tuar_create_time,</if>
|
<if test="updateTime != null">tuar_update_time,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="user != null">#{user.id,jdbcType=BIGINT},</if>
|
<if test="taoBaoUserNick != null">#{taoBaoUserNick,jdbcType=VARCHAR},</if>
|
<if test="taoBaoOpenUid != null">#{taoBaoOpenUid,jdbcType=VARCHAR},</if>
|
<if test="taoBaoUserId != null">#{taoBaoUserId,jdbcType=VARCHAR},</if>
|
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoUnionAuthRecord">update
|
yeshi_ec_taobao_union_auth_record set tuar_uid =
|
#{user.id,jdbcType=BIGINT},tuar_taobao_user_nick =
|
#{taoBaoUserNick,jdbcType=VARCHAR},tuar_taobao_open_uid =
|
#{taoBaoOpenUid,jdbcType=VARCHAR},tuar_taobao_user_id =
|
#{taoBaoUserId,jdbcType=VARCHAR},tuar_create_time =
|
#{createTime,jdbcType=TIMESTAMP},tuar_update_time =
|
#{updateTime,jdbcType=TIMESTAMP} where tuar_id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoUnionAuthRecord">
|
update yeshi_ec_taobao_union_auth_record
|
<set>
|
<if test="user != null">tuar_uid=#{user.id,jdbcType=BIGINT},</if>
|
<if test="taoBaoUserNick != null">tuar_taobao_user_nick=#{taoBaoUserNick,jdbcType=VARCHAR},
|
</if>
|
<if test="taoBaoOpenUid != null">tuar_taobao_open_uid=#{taoBaoOpenUid,jdbcType=VARCHAR},
|
</if>
|
<if test="taoBaoUserId != null">tuar_taobao_user_id=#{taoBaoUserId,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">tuar_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">tuar_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
</set>
|
where tuar_id = #{id,jdbcType=BIGINT}
|
</update>
|
|
|
<select id="getTaoBaoUserNick" resultType="java.lang.String">
|
SELECT u.`tuar_taobao_user_nick` FROM `yeshi_ec_taobao_union_auth_record` u
|
WHERE u.`tuar_uid` = #{uid}
|
ORDER BY u.`tuar_create_time` DESC
|
LIMIT 1
|
</select>
|
</mapper>
|