Commit 50cd25ee by wubh

包活干V2.0.0-修改:快递单数据权限问题

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@28433 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 47e8e1d5
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
left join sys_user us on us.id = d.sender_id left join sys_user us on us.id = d.sender_id
left join sys_user ur on ur.id = d.receiver_id left join sys_user ur on ur.id = d.receiver_id
<!-- 查询权限下所有组织 --> <!-- 查询权限下所有组织 -->
left join sys_user_org suo on suo.user_id = #{userId,jdbcType=INTEGER} left join sys_user_org uorg on uorg.user_id = #{userId,jdbcType=INTEGER}
<where> <where>
<if test="keyword != null and keyword != ''"> <if test="keyword != null and keyword != ''">
<!-- 按照关键词查询 --> <!-- 按照关键词查询 -->
...@@ -143,17 +143,14 @@ ...@@ -143,17 +143,14 @@
and d.status = #{status,jdbcType=TINYINT} and d.status = #{status,jdbcType=TINYINT}
and d.canceled = 1 and d.canceled = 1
</if> </if>
<!--and (-->
<!-- &lt;!&ndash; 用户为收件人,查询全部 &ndash;&gt;-->
<!-- d.sender_id = #{userId,jdbcType=INTEGER}-->
<!-- &lt;!&ndash; 用户为寄件人,查询状态不为待寄件的记录 &ndash;&gt;-->
<!-- or (d.receiver_id = #{userId,jdbcType=INTEGER} and d.status != 1)-->
<!--)-->
and ( and (
<!-- 用户权限下有收件人组织,查询全部 --> <!-- 通过用户权限下收寄件人组织+收寄件人类型和当前用户判断,才能判断快递单是否属于当前用户 -->
us.org_id = suo.org_id <!-- 用户权限下有收件人组织,并且寄件人类型和当前用户匹配,则查询全部 -->
<!-- 用户权限下有寄件人组织,查询状态不为待寄件的记录 --> (us.org_id = uorg.org_id and us.user_type = #{userType,jdbcType=TINYINT})
or (ur.org_id = suo.org_id and d.status != 1) <!-- 用户权限下有寄件人组织,并且收件人类型和当前用户匹配,则查询状态不为待寄件的记录 -->
or (ur.org_id = uorg.org_id
and ur.user_type = #{userType,jdbcType=TINYINT}
and d.status != 1)
) )
</where> </where>
order by d.create_time desc order by d.create_time desc
...@@ -170,19 +167,16 @@ ...@@ -170,19 +167,16 @@
left join sys_user us on us.id = d.sender_id left join sys_user us on us.id = d.sender_id
left join sys_user ur on ur.id = d.receiver_id left join sys_user ur on ur.id = d.receiver_id
<!-- 查询权限下所有组织 --> <!-- 查询权限下所有组织 -->
left join sys_user_org suo on suo.user_id = #{userId,jdbcType=INTEGER} left join sys_user_org uorg on uorg.user_id = #{userId,jdbcType=INTEGER}
where d.id = #{id,jdbcType=INTEGER} where d.id = #{id,jdbcType=INTEGER}
<!--and (-->
<!-- &lt;!&ndash; 用户为收件人,查询全部 &ndash;&gt;-->
<!-- d.sender_id = #{userId,jdbcType=INTEGER}-->
<!-- &lt;!&ndash; 用户为寄件人,查询状态不为待寄件的记录 &ndash;&gt;-->
<!-- or (d.receiver_id = #{userId,jdbcType=INTEGER} and d.status != 1)-->
<!--)-->
and ( and (
<!-- 用户权限下有收件人组织,查询全部 --> <!-- 通过用户权限下收寄件人组织+收寄件人类型和当前用户判断,才能判断快递单是否属于当前用户 -->
us.org_id = suo.org_id <!-- 用户权限下有收件人组织,并且寄件人类型和当前用户匹配,则查询全部 -->
<!-- 用户权限下有寄件人组织,查询状态不为待寄件的记录 --> (us.org_id = uorg.org_id and us.user_type = #{userType,jdbcType=TINYINT})
or (ur.org_id = suo.org_id and d.status != 1) <!-- 用户权限下有寄件人组织,并且收件人类型和当前用户匹配,则查询状态不为待寄件的记录 -->
or (ur.org_id = uorg.org_id
and ur.user_type = #{userType,jdbcType=TINYINT}
and d.status != 1)
) )
</select> </select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!