From 9357012ee7684579464a2d9b5b7c6859245ba283 Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期五, 28 六月 2024 11:22:15 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaPrivilegeMapper.xml | 88 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 88 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaPrivilegeMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaPrivilegeMapper.xml
new file mode 100644
index 0000000..6af6bd3
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaPrivilegeMapper.xml
@@ -0,0 +1,88 @@
+<?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.dy.pipIrrGlobal.daoBa.BaPrivilegeMapper">
+
+ <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaPrivilege">
+ <!--@mbg.generated-->
+ <!--@Table ba_privilege-->
+ <result column="id" jdbcType="BIGINT" property="id" />
+ <result column="num" jdbcType="INTEGER" property="num" />
+ <result column="name" jdbcType="VARCHAR" property="name" />
+ <result column="type" jdbcType="VARCHAR" property="type" />
+ </resultMap>
+
+ <sql id="Base_Column_List">
+ <!--@mbg.generated-->
+ id, num, name, type
+ </sql>
+
+ <select id="selectAll" resultMap="BaseResultMap">
+ select
+ <include refid="Base_Column_List" />
+ from ba_privilege
+ </select>
+
+ <select id="selectPrivilegeByUserId" resultType="Integer">
+ select p.num
+ from ba_privilege p
+ inner join ba_role_privilege rp on p.id = rp.privilegeId
+ inner join ba_user_role ur on rp.roleId = ur.roleId
+ inner join ba_role r on ur.roleId = r.id
+ where r.deleted != 1
+ <if test="userId != null">
+ and ur.userId = #{userId, jdbcType=BIGINT}
+ </if>
+ </select>
+
+ <select id="selectPrivilegeByRoleId" resultType="Integer">
+ select p.num
+ from ba_privilege p
+ inner join ba_role_privilege rp on p.id = rp.privilegeId
+ <if test="roleId != null">
+ where rp.roleId = #{roleId, jdbcType=BIGINT}
+ </if>
+ </select>
+
+ <insert id="putin" parameterType="com.dy.pipIrrGlobal.pojoBa.BaPrivilege">
+ <!--@mbg.generated-->
+ insert into ba_privilege (<include refid="Base_Column_List" />)
+ values (#{id,jdbcType=BIGINT},
+ #{num,jdbcType=INTEGER},
+ #{name,jdbcType=VARCHAR},
+ #{type, jdbcType=VARCHAR}
+ )
+ </insert>
+
+ <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaPrivilege">
+ <!--@mbg.generated-->
+ insert into ba_privilege
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ id,
+ </if>
+ <if test="num != null">
+ id,
+ </if>
+ <if test="name != null">
+ name,
+ </if>
+ <if test="type != null">
+ type,
+ </if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ #{id,jdbcType=BIGINT},
+ </if>
+ <if test="num != null">
+ #{name,jdbcType=INTEGER},
+ </if>
+ <if test="name != null">
+ #{name,jdbcType=VARCHAR},
+ </if>
+ <if test="type != null">
+ #{type,jdbcType=VARCHAR},
+ </if>
+ </trim>
+ </insert>
+</mapper>
\ No newline at end of file
--
Gitblit v1.8.0