Browse Source

fix 数据权限过滤问题

xucaiqin 1 tháng trước cách đây
mục cha
commit
2fb6d7acb8

+ 41 - 23
sckw-modules/sckw-order/src/main/resources/mapper/KwoTradeOrderMapper.xml

@@ -85,24 +85,30 @@
             <choose>
                 <when test="query.manager != null and !query.manager">
                     <if test="query.isMain == 1">
-                        <if test="query.entList != null and query.entList.size() > 0">
-                            and (
-                                d.top_ent_id in
-                            <foreach collection="query.entList" item="authUserId" open="(" close=")" separator=",">
-                                #{authUserId}
-                            </foreach>
-                            )
+                        <if test="query.entList != null and query.entList.size() > 0  and query.entType != null">
+                            <if test="query.entType == 1">
+                                and
+                                    e.top_ent_id in
+                                <foreach collection="query.entList" item="authUserId" open="(" close=")" separator=",">
+                                    #{authUserId}
+                                </foreach>
+                            </if>
+                            <if test="query.entType == 2">
+                                and
+                                    d.top_ent_id in
+                                <foreach collection="query.entList" item="authUserId" open="(" close=")" separator=",">
+                                    #{authUserId}
+                                </foreach>
+                            </if>
                         </if>
                     </if>
                     <if test="query.isMain == 0">
                         <if test="query.entId != null and query.entType != null">
                             <if test="query.entType == 1">
-                                and (e.top_ent_id = #{query.entId}
-                                    )
+                                and e.top_ent_id = #{query.entId}
                             </if>
                             <if test="query.entType == 2">
-                                and (d.top_ent_id = #{query.entId}
-                                    )
+                                and d.top_ent_id = #{query.entId}
                             </if>
                         </if>
                     </if>
@@ -448,20 +454,32 @@
             a.del_flag = 0
             <choose>
                 <when test="query.manager != null and !query.manager">
-                    <if test="query.isMain == 0">
-                        <if test="query.entList != null and query.entList.size() > 0">
-                            and (
-                            d.top_ent_id in
-                            <foreach collection="query.entList" item="authUserId" open="(" close=")" separator=",">
-                                #{authUserId}
-                            </foreach>
-                            )
+                    <if test="query.isMain == 1">
+                        <if test="query.entList != null and query.entList.size() > 0  and query.entType != null">
+                            <if test="query.entType == 1">
+                                and
+                                e.top_ent_id in
+                                <foreach collection="query.entList" item="authUserId" open="(" close=")" separator=",">
+                                    #{authUserId}
+                                </foreach>
+                            </if>
+                            <if test="query.entType == 2">
+                                and
+                                d.top_ent_id in
+                                <foreach collection="query.entList" item="authUserId" open="(" close=")" separator=",">
+                                    #{authUserId}
+                                </foreach>
+                            </if>
                         </if>
                     </if>
-                    <if test="query.isMain == 1">
-                        <if test="query.entId != null">
-                            and (d.top_ent_id = #{query.entId}
-                            )
+                    <if test="query.isMain == 0">
+                        <if test="query.entId != null and query.entType != null">
+                            <if test="query.entType == 1">
+                                and e.top_ent_id = #{query.entId}
+                            </if>
+                            <if test="query.entType == 2">
+                                and d.top_ent_id = #{query.entId}
+                            </if>
                         </if>
                     </if>
                 </when>