update
This commit is contained in:
@@ -1,156 +0,0 @@
|
||||
<?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.cool.store.mapper.UserAuthMappingMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.UserAuthMappingDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
||||
<result column="mapping_id" jdbcType="VARCHAR" property="mappingId"/>
|
||||
<result column="type" jdbcType="VARCHAR" property="type"/>
|
||||
<result column="source" jdbcType="VARCHAR" property="source"/>
|
||||
<result column="create_id" jdbcType="VARCHAR" property="createId"/>
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
|
||||
<result column="update_id" jdbcType="VARCHAR" property="updateId"/>
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, mapping_id, type, source, create_id, create_time, update_id, update_time
|
||||
</sql>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into user_auth_mapping_${enterpriseId}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="record.userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="record.mappingId != null">
|
||||
mapping_id,
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="record.source != null">
|
||||
source,
|
||||
</if>
|
||||
<if test="record.createId != null">
|
||||
create_id,
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="record.updateId != null">
|
||||
update_id,
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="record.userId != null">
|
||||
#{record.userId},
|
||||
</if>
|
||||
<if test="record.mappingId != null">
|
||||
#{record.mappingId},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
#{record.type},
|
||||
</if>
|
||||
<if test="record.source != null">
|
||||
#{record.source},
|
||||
</if>
|
||||
<if test="record.createId != null">
|
||||
#{record.createId},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
#{record.createTime},
|
||||
</if>
|
||||
<if test="record.updateId != null">
|
||||
#{record.updateId},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
#{record.updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective">
|
||||
update user_auth_mapping_${enterpriseId}
|
||||
<set>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId},
|
||||
</if>
|
||||
<if test="record.mappingId != null">
|
||||
mapping_id = #{record.mappingId},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
type = #{record.type},
|
||||
</if>
|
||||
<if test="record.source != null">
|
||||
source = #{record.source},
|
||||
</if>
|
||||
<if test="record.createId != null">
|
||||
create_id = #{record.createId},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime},
|
||||
</if>
|
||||
<if test="record.updateId != null">
|
||||
update_id = #{record.updateId},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
<select id="listUserAuthMappingByUserId" resultMap="BaseResultMap">
|
||||
select * from user_auth_mapping_${eid}
|
||||
where user_id=#{userId}
|
||||
</select>
|
||||
|
||||
<select id="listUserAuthMappingByUserIds" resultMap="BaseResultMap">
|
||||
select * from user_auth_mapping_${eid}
|
||||
<foreach collection="userIds" item="userId" open="user_id in (" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<delete id="deleteAuthMappingByIds">
|
||||
delete from user_auth_mapping_${eid}
|
||||
where id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectIdsByUserId" resultType="java.lang.Long">
|
||||
select id from user_auth_mapping_${eid} where user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<insert id="insertUserAuthMapping">
|
||||
insert into user_auth_mapping_${eid}
|
||||
(
|
||||
`user_id`,
|
||||
`mapping_id`,
|
||||
`type`,
|
||||
`source`,
|
||||
`create_id`,
|
||||
`create_time`
|
||||
)
|
||||
values
|
||||
(
|
||||
#{auth.userId},
|
||||
#{auth.mappingId},
|
||||
#{auth.type},
|
||||
#{auth.source},
|
||||
#{auth.createId},
|
||||
#{auth.createTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteAuthMappingByIdAndType">
|
||||
delete from user_auth_mapping_${eid}
|
||||
where type=#{type} and mapping_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user