1
13693261870
2024-11-22 54e0b93cde8a5358ae57aee2d3b3ff1c68c1a86c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?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.se.system.mapper.SysRoleCtrlMapper">
    
    <resultMap type="SysRoleCtrl" id="SysRoleCtrlResult">
        <result property="roleId"    column="role_id"    />
        <result property="ctrlId"    column="ctrl_id"    />
    </resultMap>
 
    <sql id="selectSysRoleCtrlVo">
        select role_id, ctrl_id from sys_role_ctrl
    </sql>
 
    <select id="selectSysRoleCtrlList" parameterType="SysRoleCtrl" resultMap="SysRoleCtrlResult">
        <include refid="selectSysRoleCtrlVo"/>
        <where>  
        </where>
    </select>
    
    <select id="selectSysRoleCtrlByRoleId" parameterType="Long" resultMap="SysRoleCtrlResult">
        <include refid="selectSysRoleCtrlVo"/>
        where role_id = #{roleId}
    </select>
 
    <insert id="insertSysRoleCtrl" parameterType="SysRoleCtrl">
        insert into sys_role_ctrl
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="roleId != null">role_id,</if>
            <if test="ctrlId != null">ctrl_id,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="roleId != null">#{roleId},</if>
            <if test="ctrlId != null">#{ctrlId},</if>
         </trim>
    </insert>
 
    <update id="updateSysRoleCtrl" parameterType="SysRoleCtrl">
        update sys_role_ctrl
        <trim prefix="SET" suffixOverrides=",">
            <if test="ctrlId != null">ctrl_id = #{ctrlId},</if>
        </trim>
        where role_id = #{roleId}
    </update>
 
    <delete id="deleteSysRoleCtrlByRoleId" parameterType="Long">
        delete from sys_role_ctrl where role_id = #{roleId}
    </delete>
 
    <delete id="deleteSysRoleCtrlByRoleIds" parameterType="String">
        delete from sys_role_ctrl where role_id in 
        <foreach item="roleId" collection="array" open="(" separator="," close=")">
            #{roleId}
        </foreach>
    </delete>
</mapper>