提交
This commit is contained in:
36
src/main/resources/mapper/SysUsersRolesMapper.xml
Normal file
36
src/main/resources/mapper/SysUsersRolesMapper.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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.chaozhanggui.system.cashierservice.dao.SysUsersRolesMapper">
|
||||
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.SysUsersRolesKey">
|
||||
<id column="user_id" jdbcType="BIGINT" property="userId" />
|
||||
<id column="role_id" jdbcType="BIGINT" property="roleId" />
|
||||
</resultMap>
|
||||
<delete id="deleteByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.SysUsersRolesKey">
|
||||
delete from sys_users_roles
|
||||
where user_id = #{userId,jdbcType=BIGINT}
|
||||
and role_id = #{roleId,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.SysUsersRolesKey">
|
||||
insert into sys_users_roles (user_id, role_id)
|
||||
values (#{userId,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.SysUsersRolesKey">
|
||||
insert into sys_users_roles
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
role_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
#{roleId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user