From eafecc3ac0227960f2b8fa377be27f066e10e50f Mon Sep 17 00:00:00 2001
From: baoshiwei <baoshiwei@shlanbao.cn>
Date: 星期二, 20 五月 2025 10:47:58 +0800
Subject: [PATCH] perf(lb-qms): 优化查询功能和时间范围筛选

---
 ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml
index d2108eb..322403f 100644
--- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml
+++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml
@@ -7,20 +7,23 @@
     <resultMap type="org.dromara.system.domain.vo.SysPostVo" id="SysPostResult">
     </resultMap>
 
-    <select id="selectPostListByUserId" parameterType="Long" resultType="Long">
-        select p.post_id
+    <select id="selectPagePostList" resultMap="SysPostResult">
+        select
+        <if test="ew.getSqlSelect != null">
+            ${ew.getSqlSelect}
+        </if>
+        <if test="ew.getSqlSelect == null">
+            *
+        </if>
+        from sys_post ${ew.getCustomSqlSegment}
+    </select>
+
+    <select id="selectPostsByUserId" parameterType="Long" resultMap="SysPostResult">
+        select p.post_id, p.dept_id, p.post_name, p.post_code, p.post_category
         from sys_post p
                  left join sys_user_post up on up.post_id = p.post_id
                  left join sys_user u on u.user_id = up.user_id
         where u.user_id = #{userId}
-    </select>
-
-    <select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
-        select p.post_id, p.post_name, p.post_code
-        from sys_post p
-                 left join sys_user_post up on up.post_id = p.post_id
-                 left join sys_user u on u.user_id = up.user_id
-        where u.user_name = #{userName}
     </select>
 
 </mapper>

--
Gitblit v1.9.3