mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?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.dg.core.db.gen.mapper.RoleMenuEntityMapper">
 
    <resultMap type="com.dg.core.db.gen.entity.RoleMenuEntity" id="RoleMenuEntityResult">
        <id     property="id"      column="id"      />
        <id     property="roleId"      column="role_id"      />
        <id     property="menuId"      column="menu_id"      />
        <id     property="createTime"      column="create_time"      />
        <id     property="updateTime"      column="update_time"      />
 
    </resultMap>
 
    <sql id="selectRoleManagementEntityVo">
        SELECT
            id,
            role_id,
            menu_id,
            create_time,
            update_time
        FROM
            automessage_role_menu
    </sql>
 
    <select id="selectConfigList" parameterType="string" resultMap="RoleMenuEntityResult">
        <include refid="selectRoleManagementEntityVo"/>
        <where>
            <if test="roleId!=null and roleId!=''">
                and role_id=#{roleId}
            </if>
 
 
        </where>
    </select>
 
    <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.RoleManagementEntity">
        insert into automessage_role_menu (
        <if test="id != null">id,</if>
        <if test="roleId != null and roleId != '' ">role_id,</if>
        <if test="menuId != null and menuId != '' ">menu_id,</if>
        update_time,
        create_time
        )values(
        <if test="id != null">#{id},</if>
        <if test="roleId != null and roleId != '' ">#{roleId},</if>
        <if test="menuId != null and menuId != '' ">#{menuId},</if>
        sysdate(),
        sysdate()
        )
    </insert>
 
    <update id="updateConfig" parameterType="com.dg.core.db.gen.entity.RoleManagementEntity">
        update automessage_role_menu
        <set>
            <if test="id != null">id=#{id},</if>
            <if test="roleId != null and roleId != '' ">role_id=#{roleId},</if>
            <if test="menuId != null and menuId != '' ">menu_id=#{menuId},</if>
            update_time=sysdate()
        </set>
        where  id= #{Id}
    </update>
 
    <delete id="deleteConfigById" parameterType="string">
        delete from automessage_role_menu where id= #{Id}
    </delete>
 
    <select id="countNum" resultType="integer">
        select count(id) from automessage_role_menu
    </select>
 
</mapper>