Commit 5b03b0e150bd3cdb3d93383e265f16f4220d4cd4

Authored by 房远帅
1 parent d0637f79

采购-报价管理:数据查看权限

@@ -84,17 +84,18 @@ @@ -84,17 +84,18 @@
84 <if test="vo.principalId != null and vo.principalId != ''"> 84 <if test="vo.principalId != null and vo.principalId != ''">
85 AND tb.principal_id = #{vo.principalId} 85 AND tb.principal_id = #{vo.principalId}
86 </if> 86 </if>
87 - <choose>  
88 - <when test="purchaseDepartmentList != null and purchaseDepartmentList.size() > 0">  
89 - AND tb.purchase_department IN 87 + <if test="(purchaseDepartmentList != null and purchaseDepartmentList.size() > 0) or userId != null">
  88 + AND (
  89 + <if test="purchaseDepartmentList != null and purchaseDepartmentList.size() > 0">
  90 + tb.purchase_department IN
90 <foreach collection="purchaseDepartmentList" item="item" open="(" separator="," close=")"> 91 <foreach collection="purchaseDepartmentList" item="item" open="(" separator="," close=")">
91 #{item} 92 #{item}
92 </foreach> 93 </foreach>
93 - </when>  
94 - <otherwise>  
95 - AND tb.principal_id = #{userId}  
96 - </otherwise>  
97 - </choose> 94 + OR
  95 + </if>
  96 + tb.principal_id = #{userId}
  97 + )
  98 + </if>
98 </where> 99 </where>
99 ORDER BY tb.create_time DESC, tb.id DESC 100 ORDER BY tb.create_time DESC, tb.id DESC
100 </select> 101 </select>