2025-03-09 21:16:34 +08:00
|
|
|
<?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.yanzhu.manage.mapper.WxMenuConfigRoleMapper">
|
|
|
|
|
|
|
|
<resultMap type="WxMenuConfigRole" id="WxMenuConfigRoleResult">
|
|
|
|
<result property="smcid" column="smcid" />
|
|
|
|
<result property="roleId" column="role_id" />
|
2025-03-10 00:01:02 +08:00
|
|
|
<result property="roleName" column="role_name" />
|
2025-03-09 21:16:34 +08:00
|
|
|
<result property="userId" column="user_id" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectWxMenuConfigRoleVo">
|
|
|
|
select smcid, role_id, user_id from wx_menu_config_role
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectWxMenuConfigRoleList" parameterType="WxMenuConfigRole" resultMap="WxMenuConfigRoleResult">
|
|
|
|
<include refid="selectWxMenuConfigRoleVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="smcid != null "> and smcid = #{smcid}</if>
|
|
|
|
<if test="roleId != null "> and role_id = #{roleId}</if>
|
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
2025-03-10 00:01:02 +08:00
|
|
|
<select id="findgRoleListBySmcIds" parameterType="WxMenuConfigRole" resultMap="WxMenuConfigRoleResult">
|
|
|
|
select mcr.smcid, mcr.role_id, sr.role_name, mcr.user_id from wx_menu_config_role mcr
|
|
|
|
left join sys_role sr on sr.role_id = mcr.role_id
|
|
|
|
where mcr.smcid in
|
|
|
|
<foreach collection="smcIds" item="smcId" open="(" separator="," close=")">
|
|
|
|
#{smcId}
|
|
|
|
</foreach>
|
|
|
|
</select>
|
|
|
|
|
2025-03-09 21:16:34 +08:00
|
|
|
<select id="selectWxMenuConfigRoleBySmcid" parameterType="Long" resultMap="WxMenuConfigRoleResult">
|
|
|
|
<include refid="selectWxMenuConfigRoleVo"/>
|
|
|
|
where smcid = #{smcid}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertWxMenuConfigRole" parameterType="WxMenuConfigRole">
|
|
|
|
insert into wx_menu_config_role
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="smcid != null">smcid,</if>
|
|
|
|
<if test="roleId != null">role_id,</if>
|
|
|
|
<if test="userId != null">user_id,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="smcid != null">#{smcid},</if>
|
|
|
|
<if test="roleId != null">#{roleId},</if>
|
|
|
|
<if test="userId != null">#{userId},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateWxMenuConfigRole" parameterType="WxMenuConfigRole">
|
|
|
|
update wx_menu_config_role
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="roleId != null">role_id = #{roleId},</if>
|
|
|
|
<if test="userId != null">user_id = #{userId},</if>
|
|
|
|
</trim>
|
|
|
|
where smcid = #{smcid}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteWxMenuConfigRoleBySmcid" parameterType="Long">
|
|
|
|
delete from wx_menu_config_role where smcid = #{smcid}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteWxMenuConfigRoleBySmcids" parameterType="String">
|
|
|
|
delete from wx_menu_config_role where smcid in
|
|
|
|
<foreach item="smcid" collection="array" open="(" separator="," close=")">
|
|
|
|
#{smcid}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
</mapper>
|