39 lines
1.3 KiB
XML
Raw Permalink Normal View History

2026-03-10 14:30:24 +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="AdminRuleOther">
<insert id="add" parameterType="AdminRuleOther">
INSERT INTO AdminRuleOther ( adminId,subAdminId,roleType )
Values ( #{adminId},#{subAdminId},#{roleType})
</insert>
<insert id="insertAdminRuleOthers" parameterType="java.util.List">
INSERT INTO adminruleother ( adminId,subAdminId,roleType) Values
<foreach collection="list" index="index" item="item" separator=",">
(#{item.adminId}, #{item.subAdminId}, #{item.roleType})
</foreach>
</insert>
<delete id="deleteAdminRuleOthers" parameterType="java.util.Map">
delete from adminruleother where adminId=#{adminId} and roleType =#{roleType}
</delete>
<select id="selectAdminRuleOthers" parameterType="java.util.Map" resultType="AdminRuleOther">
select aro.adminId,aro.subAdminId,aro.roleType from adminruleother aro inner join
admin a on a.adminid=aro.adminId and a.roleType=#{roleType} and aro.roleType=#{subRoleType}
<if test="adminId != null"> AND
aro.adminId = #{adminId}
</if>
</select>
</mapper>