Compare commits
2 Commits
90147ed4e3
...
fb9a4e1b29
| Author | SHA1 | Date | |
|---|---|---|---|
| fb9a4e1b29 | |||
| 89aadf97db |
@@ -694,14 +694,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{excludedBillId}
|
#{excludedBillId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<choose>
|
order by p.bill_id
|
||||||
<when test="dateType != null and dateType == 'PICKUP_DATE'">
|
|
||||||
order by p.pickup_date, p.order_no, p.bill_id
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
order by p.biz_date, p.order_no, p.bill_id
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="sumPrcOrderBillIncomeByCustomerPeriod" resultType="java.math.BigDecimal">
|
<select id="sumPrcOrderBillIncomeByCustomerPeriod" resultType="java.math.BigDecimal">
|
||||||
|
|||||||
@@ -11,20 +11,27 @@
|
|||||||
AND bill_id IN
|
AND bill_id IN
|
||||||
<foreach collection="sourceIds" item="sourceId" open="(" separator="," close=")">#{sourceId}</foreach>
|
<foreach collection="sourceIds" item="sourceId" open="(" separator="," close=")">#{sourceId}</foreach>
|
||||||
</select>
|
</select>
|
||||||
<!-- c 固定为客户表别名;无部门层级扩展,不按角色管理 data_scope 过滤。 -->
|
<!-- c 固定为客户表别名;销售经理可见本部门及下级部门,不按角色管理 data_scope 过滤。 -->
|
||||||
<sql id="customerScope">
|
<sql id="customerScope">
|
||||||
<choose>
|
<choose>
|
||||||
<when test="scope != null and scope.all"/>
|
<when test="scope != null and scope.all"/>
|
||||||
<when test="scope != null and (scope.self or scope.department)">
|
<when test="scope != null and (scope.self or scope.department)">
|
||||||
AND c.del_flag = '0'
|
AND c.del_flag = '0'
|
||||||
AND EXISTS (
|
AND EXISTS (
|
||||||
SELECT 1 FROM sys_user su
|
SELECT 1 FROM sys_user su
|
||||||
WHERE CAST(su.user_id AS CHAR) = c.sales_user_id AND su.del_flag = '0'
|
WHERE CAST(su.user_id AS CHAR) = c.sales_user_id AND su.del_flag = '0'
|
||||||
AND (1 = 0
|
AND (1 = 0
|
||||||
<if test="scope.self">OR su.user_id = #{scope.userId}</if>
|
<if test="scope.self">OR su.user_id = #{scope.userId}</if>
|
||||||
<if test="scope.department">OR su.dept_id = #{scope.deptId}</if>
|
<if test="scope.department">
|
||||||
|
OR EXISTS (
|
||||||
|
SELECT 1 FROM sys_dept dept
|
||||||
|
WHERE dept.dept_id = su.dept_id
|
||||||
|
AND (dept.dept_id = #{scope.deptId}
|
||||||
|
OR find_in_set(#{scope.deptId}, dept.ancestors))
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
</when>
|
</when>
|
||||||
<otherwise>AND 1 = 0</otherwise>
|
<otherwise>AND 1 = 0</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
|
|||||||
Reference in New Issue
Block a user