<?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>
|