|
@@ -1024,10 +1024,24 @@
|
|
|
</update>
|
|
|
|
|
|
|
|
|
+<!-- <select id="getCheckPdfPaceInfo" resultType="org.springblade.business.vo.ChekPdfPaceVo">-->
|
|
|
+<!-- SELECT c.TotalCount,c.finishCount, IF(FLOOR(finishCount/TotalCount),null,0) as pace from (-->
|
|
|
+<!-- SELECT COUNT(1) as TotalCount,IF(SUM(IF(status = 'chek_status', 1, 0)),null,0) AS finishCount from u_information_query where contract_id=#{contractId} and classify=#{classify} and chek_status in(1,2,3)-->
|
|
|
+<!-- ) c-->
|
|
|
+<!-- </select>-->
|
|
|
+
|
|
|
<select id="getCheckPdfPaceInfo" resultType="org.springblade.business.vo.ChekPdfPaceVo">
|
|
|
- SELECT c.TotalCount,c.finishCount, IF(FLOOR(finishCount/TotalCount),null,0) as pace from (
|
|
|
- SELECT COUNT(1) as TotalCount,IF(SUM(IF(status = 'chek_status', 1, 0)),null,0) AS finishCount from u_information_query where contract_id=#{contractId} and classify=#{classify} and chek_status in(1,2,3)
|
|
|
- ) c
|
|
|
+ SELECT
|
|
|
+ COUNT(1) as totalCount,
|
|
|
+ SUM(CASE WHEN chek_status IN (1,2,3) THEN 1 ELSE 0 END) as finishCount,
|
|
|
+ CASE
|
|
|
+ WHEN COUNT(1) = 0 THEN 0
|
|
|
+ ELSE ROUND(SUM(CASE WHEN chek_status IN (1,2,3) THEN 1 ELSE 0 END) * 100.0 / COUNT(1), 2)
|
|
|
+ END as pace
|
|
|
+ FROM u_information_query
|
|
|
+ WHERE contract_id = #{contractId,jdbcType=VARCHAR}
|
|
|
+ AND classify = #{classify,jdbcType=VARCHAR}
|
|
|
+ AND chek_status IN (0,1,2,3)
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|