<?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.user.UserAccountBindingHistoryMapper">
|
<resultMap id="BaseResultMap"
|
type="com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory">
|
<id column="uabh_id" property="id" jdbcType="BIGINT" />
|
<result column="uabh_uid" property="uid" jdbcType="BIGINT" />
|
<result column="uabh_type" property="type" jdbcType="INTEGER" />
|
<result column="uabh_content" property="content" jdbcType="VARCHAR" />
|
<result column="uabh_first" property="first" jdbcType="BOOLEAN" />
|
<result column="uabh_create_time" property="createTime"
|
jdbcType="TIMESTAMP" />
|
</resultMap>
|
<sql id="Base_Column_List">uabh_id,uabh_uid,uabh_type,uabh_content,uabh_first,uabh_create_time
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_user_account_bind_history where uabh_id =
|
#{id,jdbcType=BIGINT}
|
</select>
|
|
|
<select id="selectLatestByTypeAndUid" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_user_account_bind_history where uabh_uid =#{uid} and
|
uabh_type=#{type} order by uabh_create_time desc limit 1
|
</select>
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
yeshi_ec_user_account_bind_history where uabh_id =
|
#{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert"
|
parameterType="com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory"
|
useGeneratedKeys="true" keyProperty="id">insert into
|
yeshi_ec_user_account_bind_history
|
(uabh_id,uabh_uid,uabh_type,uabh_content,uabh_first,uabh_create_time)
|
values
|
(#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{type,jdbcType=INTEGER},#{content,jdbcType=VARCHAR},#{first,jdbcType=BOOLEAN},#{createTime,jdbcType=TIMESTAMP})
|
</insert>
|
<insert id="insertSelective"
|
parameterType="com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into yeshi_ec_user_account_bind_history
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">uabh_id,</if>
|
<if test="uid != null">uabh_uid,</if>
|
<if test="type != null">uabh_type,</if>
|
<if test="content != null">uabh_content,</if>
|
<if test="first != null">uabh_first,</if>
|
<if test="createTime != null">uabh_create_time,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="uid != null">#{uid,jdbcType=BIGINT},</if>
|
<if test="type != null">#{type,jdbcType=INTEGER},</if>
|
<if test="content != null">#{content,jdbcType=VARCHAR},</if>
|
<if test="first != null">#{first,jdbcType=BOOLEAN},</if>
|
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey"
|
parameterType="com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory">update yeshi_ec_user_account_bind_history set uabh_uid =
|
#{uid,jdbcType=BIGINT},uabh_type =
|
#{type,jdbcType=INTEGER},uabh_content =
|
#{content,jdbcType=VARCHAR},uabh_first =
|
#{first,jdbcType=BOOLEAN},uabh_create_time =
|
#{createTime,jdbcType=TIMESTAMP} where uabh_id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective"
|
parameterType="com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory">
|
update yeshi_ec_user_account_bind_history
|
<set>
|
<if test="uid != null">uabh_uid=#{uid,jdbcType=BIGINT},</if>
|
<if test="type != null">uabh_type=#{type,jdbcType=INTEGER},</if>
|
<if test="content != null">uabh_content=#{content,jdbcType=VARCHAR},</if>
|
<if test="first != null">uabh_first=#{first,jdbcType=BOOLEAN},</if>
|
<if test="createTime != null">uabh_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
</set>
|
where uabh_id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|