<?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.gkhy.safePlatform.account.repository.RoleProjectInfoRepository" >
|
|
<resultMap id="RoleProjectInfo" type="com.gkhy.safePlatform.account.entity.user.RoleProjectInfo">
|
<result property="id" column="id"/>
|
<result property="projectId" column="project_id" />
|
<result property="roleId" column="role_id" />
|
|
</resultMap>
|
<insert id="insertBatch" parameterType="com.gkhy.safePlatform.account.entity.user.RoleProjectInfo" >
|
insert into
|
sys_role_project
|
<trim prefix="(" suffix=") values" suffixOverrides="," >
|
project_id,
|
role_id,
|
</trim>
|
<foreach collection="list" item="item" separator=",">
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
#{item.projectId},
|
#{item.roleId},
|
</trim>
|
</foreach>
|
|
|
</insert>
|
<delete id="deleteByRoleId">
|
delete from sys_role_project
|
where role_id = #{roleId}
|
</delete>
|
<select id="getRoleProjectInfo" resultMap="RoleProjectInfo">
|
select
|
id,
|
project_id,
|
role_id
|
from sys_role_project
|
where role_id = #{roleId}
|
and project_id = #{projectId}
|
|
</select>
|
|
|
</mapper>
|