|
@@ -123,9 +123,7 @@
|
|
|
SELECT NVL(SUM(c.CONTRACT_AMOUNT), 0) as signAmount,
|
|
|
NVL(SUM(CASE WHEN c.SIGN_WAY = 3 then C.CONTRACT_AMOUNT ELSE 0 END), 0) AS newAmount
|
|
|
FROM CONTRACT c
|
|
|
- <if test="params != null and params.deptId != null and params.deptId != ''">
|
|
|
- RIGHT JOIN PROJECT pr ON pr.ID = c.PROJECT_ID
|
|
|
- </if>
|
|
|
+ RIGHT JOIN PROJECT pr ON pr.ID = c.PROJECT_ID
|
|
|
<where>
|
|
|
c.ISVALID = 1 AND c.FLOW_STATUS = 90
|
|
|
<if test="params != null and params.year != null and params.year != ''">
|
|
@@ -134,6 +132,12 @@
|
|
|
<if test="params != null and params.deptId != null and params.deptId != ''">
|
|
|
AND pr.ZRBM_ID = #{params.deptId}
|
|
|
</if>
|
|
|
+ <if test="params != null and params.deptIds != null and params.deptIds.size > 0">
|
|
|
+ AND pr.ZRBM_ID in
|
|
|
+ <foreach collection="params.deptIds" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
<if test="params != null and params.managerId != null and params.managerId != ''">
|
|
|
AND c.AREA_MANAGER_ID = #{params.managerId}
|
|
|
</if>
|
|
@@ -239,11 +243,18 @@
|
|
|
select COALESCE(SUM(COALESCE(t2.RETURN_AMOUNT,0)),0) as returnAmount
|
|
|
FROM CONTRACT_RETURN_MONEY t2
|
|
|
RIGHT JOIN CONTRACT t1 on t2.CONTRACT_ID = t1.ID and t1.ISVALID = 1 and t1.FLOW_STATUS = 90
|
|
|
+ LEFT JOIN PROJECT pr ON pr.ID = t1.PROJECT_ID
|
|
|
<where>
|
|
|
- t2.ISVALID = 1 and t2.BZ != '冲红'
|
|
|
- <if test="params != null and params.year != null and params.year != ''">
|
|
|
- AND TO_CHAR(t2.RETURN_DATE,'YYYY') = #{params.year,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
+ t2.ISVALID = 1 and t2.BZ != '冲红'
|
|
|
+ <if test="params != null and params.year != null and params.year != ''">
|
|
|
+ AND TO_CHAR(t2.RETURN_DATE,'YYYY') = #{params.year,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="params != null and params.deptIds != null and params.deptIds.size > 0">
|
|
|
+ AND pr.ZRBM_ID in
|
|
|
+ <foreach collection="params.deptIds" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
</mapper>
|