Browse Source

修改用户组查询时,如果组内没有人员则查询不到问题

zh 3 năm trước cách đây
mục cha
commit
42c427b8a4

+ 4 - 5
boman-modules/boman-system/src/main/resources/mapper/system/BomanGroupMapper.xml

@@ -39,8 +39,8 @@
     <select id="selectGroupList" parameterType="com.boman.domain.BomanGroup" resultMap="BomanGroupResult">
         select g.id, g.group_name, g.status, g.number,  g.create_by, g.create_time, g.is_del, gu.user_name , gu.id as g_u_id
         from boman_group g
-        left join boman_group_user gu on gu.group_id = g.id
-        where gu.is_del = 'N'
+        left join boman_group_user gu on gu.group_id = g.id and gu.is_del = 'N'
+        where 1 = 1
         <if test="groupName != null and groupName != ''">
             AND g.group_name like concat('%', #{groupName}, '%')
         </if>
@@ -52,9 +52,8 @@
     <select id="selectGroupById" parameterType="Long" resultMap="BomanGroupResult">
         select g.id, g.group_name, g.status, g.number,  g.create_by, g.create_time, g.is_del, gu.user_name , gu.id
         from boman_group g
-        left join boman_group_user gu on gu.group_id = g.id
-        where g.is_del = 'N'
-        and g.id = #{id}
+        left join boman_group_user gu on gu.group_id = g.id and g.is_del = 'N'
+        where g.id = #{id}
     </select>
 
     <select id="checkGroupNameUnique" resultMap="BomanGroupResult">