From 58b691e9cfe1e5e1ae8a62c8b66f1995eaad0e9e Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期四, 27 二月 2025 15:07:32 +0800
Subject: [PATCH] 导出osd问题 以及缺少小时改分钟
---
ycl-server/src/main/resources/mapper/zgyw/CalculateReportMapper.xml | 30 +++++++++++++++++++++++-------
1 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CalculateReportMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CalculateReportMapper.xml
index 67e03ba..6852b2a 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CalculateReportMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CalculateReportMapper.xml
@@ -79,6 +79,7 @@
<result column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="unit_name" property="unitName"/>
+ <result column="unit_id" property="unitId"/>
<result column="name" property="contractName"/>
<result column="contract_id" property="contractId"/>
<result column="which_year" property="whichYear"/>
@@ -121,12 +122,14 @@
AND tcr.status=#{status}
</if>
</where>
+ group by tcr.id
ORDER BY
tcr.create_time
</select>
<select id="getById" resultMap="DetailResultMap">
SELECT tyu.unit_name,
+ tyu.id as unit_id,
tc.name,
tcr.id,
tcr.contract_id,
@@ -144,14 +147,27 @@
</select>
<select id="exportData" resultType="com.ycl.platform.domain.excel.CalculateExport">
- SELECT a.rule_name,
- COUNT(b.id) AS num,
- IFNULL(-SUM(b.score), 0) AS score
+ SELECT
+ a.rule_name as ruleName,
+ a.rule_condition as detailName,
+ COUNT(b.id) AS num,
+ a.calc_fraction as calcFraction,
+ IFNULL(-SUM(b.score), 0) AS score
FROM t_calculate_rule a
- LEFT JOIN t_calculate_record tcr ON a.contract_id = tcr.contract_id And tcr.id = #{calculateId}
- LEFT JOIN t_contract_score b ON b.rule_id = a.id AND auditing_status = 'PASS' AND b.deleted = 0 AND YEAR (b.create_time) = tcr.which_year
- WHERE a.deleted = 0
- GROUP BY a.rule_name
+ LEFT JOIN t_calculate_record tcr ON a.contract_id = tcr.contract_id
+ LEFT JOIN t_contract_score b ON b.rule_id = a.id AND auditing_status = 'PASS' AND b.deleted = 0
+ AND MONTH(b.create_time) = tcr.which_month
+ AND YEAR(b.create_time) = tcr.which_year
+ <where>
+ a.deleted = 0 and a.contract_id = #{contractId}
+ <if test="whichMonth!=null">
+ and tcr.which_month = #{whichMonth}
+ </if>
+ <if test="whichYear!=null">
+ and tcr.which_year = #{whichYear}
+ </if>
+ </where>
+ GROUP BY a.id
</select>
</mapper>
--
Gitblit v1.8.0