未结算报表修改
This commit is contained in:
parent
349f2493cf
commit
eae04e9353
|
|
@ -225,7 +225,7 @@
|
||||||
SELECT
|
SELECT
|
||||||
bai.agreement_id as agreementId, bai.agreement_code as agreementCode, bai.is_slt as isSlt,
|
bai.agreement_id as agreementId, bai.agreement_code as agreementCode, bai.is_slt as isSlt,
|
||||||
bui.unit_id as unitId, bui.unit_name as unitName, bp.pro_id as projectId , bp.pro_name as projectName,
|
bui.unit_id as unitId, bui.unit_name as unitName, bp.pro_id as projectId , bp.pro_name as projectName,
|
||||||
saa.remark, bai.protocol, saa.cost as costs,
|
bai.protocol,
|
||||||
case
|
case
|
||||||
when (saa.id is null or saa.status = '0') then '0'
|
when (saa.id is null or saa.status = '0') then '0'
|
||||||
when saa.status = '1' then '1'
|
when saa.status = '1' then '1'
|
||||||
|
|
@ -960,16 +960,10 @@
|
||||||
bui.unit_name as unitName,
|
bui.unit_name as unitName,
|
||||||
bai.project_id as projectId,
|
bai.project_id as projectId,
|
||||||
bp.pro_name as projectName,
|
bp.pro_name as projectName,
|
||||||
saa.remark,
|
|
||||||
bai.protocol,
|
bai.protocol,
|
||||||
saa.cost as costs,
|
SUM(IFNULL(saa.`status`,0)) as num,
|
||||||
CASE
|
sai.is_slt as sltStatus,
|
||||||
WHEN saa.id IS NULL OR saa.status = '0' THEN '0'
|
|
||||||
WHEN saa.status = '1' THEN '1'
|
|
||||||
WHEN saa.status = '2' THEN '2'
|
|
||||||
WHEN saa.status = '3' THEN '3'
|
|
||||||
ELSE '0'
|
|
||||||
END as sltStatus,
|
|
||||||
CASE
|
CASE
|
||||||
WHEN bp.actual_end_date is not null THEN '1'
|
WHEN bp.actual_end_date is not null THEN '1'
|
||||||
ELSE '0'
|
ELSE '0'
|
||||||
|
|
@ -979,9 +973,11 @@
|
||||||
INNER JOIN bm_unit bui ON bui.unit_id = bai.unit_id AND bui.type_id != '1731'
|
INNER JOIN bm_unit bui ON bui.unit_id = bai.unit_id AND bui.type_id != '1731'
|
||||||
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
|
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
|
||||||
LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit
|
LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit
|
||||||
LEFT JOIN slt_agreement_apply saa ON saa.agreement_id = bai.agreement_id AND (saa.status IS NULL OR saa.status != '2')
|
LEFT JOIN slt_agreement_apply saa on bai.agreement_id = saa.agreement_id AND saa.settlement_type =1
|
||||||
|
LEFT JOIN slt_agreement_info sai on bai.agreement_id = sai.agreement_id
|
||||||
WHERE bai.status = '1'
|
WHERE bai.status = '1'
|
||||||
AND (bai.is_slt = '0' OR bai.is_slt IS NULL)
|
AND sai.is_slt = 0
|
||||||
|
|
||||||
<if test="unitIds != null and unitIds.size() > 0">
|
<if test="unitIds != null and unitIds.size() > 0">
|
||||||
AND bai.unit_id IN
|
AND bai.unit_id IN
|
||||||
<foreach item="item" index="index" collection="unitIds" open="(" separator="," close=")">
|
<foreach item="item" index="index" collection="unitIds" open="(" separator="," close=")">
|
||||||
|
|
@ -1009,6 +1005,8 @@
|
||||||
<if test="isFinish != null and isFinish == 0">
|
<if test="isFinish != null and isFinish == 0">
|
||||||
AND bp.actual_end_date is null
|
AND bp.actual_end_date is null
|
||||||
</if>
|
</if>
|
||||||
|
GROUP BY bai.agreement_id
|
||||||
|
HAVING num = 0
|
||||||
ORDER BY bai.create_time DESC
|
ORDER BY bai.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -1712,12 +1710,15 @@
|
||||||
<select id="getSltReportListCount" resultType="int">
|
<select id="getSltReportListCount" resultType="int">
|
||||||
SELECT
|
SELECT
|
||||||
count(*)
|
count(*)
|
||||||
FROM bm_agreement_info bai
|
from
|
||||||
|
(SELECT bai.agreement_id,SUM(IFNULL(saa.`status`,0)) as num FROM bm_agreement_info bai
|
||||||
INNER JOIN bm_unit bui ON bui.unit_id = bai.unit_id AND bui.type_id != '1731'
|
INNER JOIN bm_unit bui ON bui.unit_id = bai.unit_id AND bui.type_id != '1731'
|
||||||
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
|
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
|
||||||
LEFT JOIN slt_agreement_apply saa ON saa.agreement_id = bai.agreement_id AND (saa.status IS NULL OR saa.status != '2')
|
LEFT JOIN slt_agreement_apply saa on bai.agreement_id = saa.agreement_id AND saa.settlement_type =1
|
||||||
|
LEFT JOIN slt_agreement_info sai on bai.agreement_id = sai.agreement_id
|
||||||
WHERE bai.status = '1'
|
WHERE bai.status = '1'
|
||||||
AND (bai.is_slt = '0' OR bai.is_slt IS NULL)
|
AND sai.is_slt = 0
|
||||||
|
|
||||||
<if test="unitIds != null and unitIds.size() > 0">
|
<if test="unitIds != null and unitIds.size() > 0">
|
||||||
AND bai.unit_id IN
|
AND bai.unit_id IN
|
||||||
<foreach item="item" index="index" collection="unitIds" open="(" separator="," close=")">
|
<foreach item="item" index="index" collection="unitIds" open="(" separator="," close=")">
|
||||||
|
|
@ -1739,7 +1740,10 @@
|
||||||
<if test="projectName != null and projectName != ''">
|
<if test="projectName != null and projectName != ''">
|
||||||
AND bp.pro_name LIKE CONCAT('%', #{projectName}, '%')
|
AND bp.pro_name LIKE CONCAT('%', #{projectName}, '%')
|
||||||
</if>
|
</if>
|
||||||
ORDER BY bai.create_time DESC
|
GROUP BY bai.agreement_id
|
||||||
|
HAVING num = 0
|
||||||
|
ORDER BY bai.create_time DESC) res
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectPeriodCostListForCharge" parameterType="com.bonus.material.settlement.domain.dto.PeriodCostQueryDto" resultMap="PeriodCostResultMap">
|
<select id="selectPeriodCostListForCharge" parameterType="com.bonus.material.settlement.domain.dto.PeriodCostQueryDto" resultMap="PeriodCostResultMap">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue