From 2661ce7da0b5544d5574cfad50cba9a9a643254c Mon Sep 17 00:00:00 2001
From: liuxm <liuxm@fescotech.com>
Date: 星期一, 06 五月 2024 15:47:05 +0800
Subject: [PATCH] 用户管理方法修改

---
 pms-parent/pms-global/src/main/resources/mapper/BaRoleMapper.xml |   27 ++++++++++++++++++++-------
 1 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/pms-parent/pms-global/src/main/resources/mapper/BaRoleMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/BaRoleMapper.xml
index cfc729f..d3fb7b3 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/BaRoleMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/BaRoleMapper.xml
@@ -8,6 +8,7 @@
     <result column="name" property="name" />
     <result column="disabled" property="disabled" />
     <result column="deleted" property="deleted" />
+    <result column="dt" property="dt" />
   </resultMap>
   <resultMap id="partResultMap" type="com.dy.pmsGlobal.pojoBa.BaRole">
     <result column="id" property="id" />
@@ -15,17 +16,17 @@
   </resultMap>
 
   <resultMap id="someResultMap" extends="partResultMap" type="com.dy.pmsGlobal.pojoBa.BaRole">
-    <collection property="priIds" ofType="java.lang.String" fetchType="eager" column="{roleId=id}" select="com.dy.pmsGlobal.daoBa.BaPrivilegeMapper.selectPrivilegeByRoleId" />
+    <collection property="priIds" ofType="java.lang.Integer" fetchType="eager" column="{roleId=id}" select="com.dy.pmsGlobal.daoBa.BaPrivilegeMapper.selectPrivilegeByRoleId" />
   </resultMap>
 
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
-    id, `name`, disabled, deleted
+    id, `name`, disabled, deleted,dt
   </sql>
 
   <sql id="Part_Column_List">
     <!--@mbg.generated-->
-    id, `name`, disabled
+    id, `name`, disabled,dt
   </sql>
 
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="someResultMap">
@@ -125,11 +126,17 @@
     select
     count(*)
     from ba_role r
-    inner join (select DISTINCT role_id from ba_role_privilege) rp on r.id=rp.role_id
-    where r.disabled!=1 and r.deleted!=1
+    left join (select DISTINCT role_id from ba_role_privilege) rp on r.id=rp.role_id
+    where  r.deleted!=1
     <trim prefix="and" suffixOverrides="and">
       <if test="name != null and name != ''">
         r.name like concat('%', #{name}, '%') and
+      </if>
+      <if test="disabled != null and disabled != ''">
+        r.disabled =#{disabled,jdbcType=BOOLEAN} and
+      </if>
+      <if test="dt != null and dt != ''">
+        DATE_FORMAT(r.dt, '%Y-%m-%d') = #{dt,jdbcType=TIMESTAMP}
       </if>
     </trim>
   </select>
@@ -140,12 +147,18 @@
       <property name="alias" value="r"/>
     </include>
     from ba_role r
-    inner join (select DISTINCT role_id from ba_role_privilege) rp on r.id=rp.role_id
-    where r.disabled!=1 and r.deleted!=1
+    left join (select DISTINCT role_id from ba_role_privilege) rp on r.id=rp.role_id
+    where r.deleted!=1
     <trim prefix="and" suffixOverrides="and">
       <if test="name != null and name != ''">
         r.name like concat('%', #{name}, '%') and
       </if>
+      <if test="disabled != null and disabled != ''">
+        r.disabled =#{disabled,jdbcType=BOOLEAN} and
+      </if>
+      <if test="dt != null and dt != ''">
+        DATE_FORMAT(r.dt, '%Y-%m-%d') = #{dt,jdbcType=TIMESTAMP}
+      </if>
     </trim>
     order by id DESC
     <trim prefix="limit " >

--
Gitblit v1.8.0