From 1c5faa38ccb71410d00b4bf9272843c51bc32c49 Mon Sep 17 00:00:00 2001 From: tangw Date: Wed, 21 Jan 2026 18:13:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A8=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liswork/src/main/resources/mapper/QcStatMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liswork/src/main/resources/mapper/QcStatMapper.xml b/liswork/src/main/resources/mapper/QcStatMapper.xml index 5c38d7d..4efdaa7 100644 --- a/liswork/src/main/resources/mapper/QcStatMapper.xml +++ b/liswork/src/main/resources/mapper/QcStatMapper.xml @@ -37,7 +37,7 @@ SELECT qc_val.yq,qc_val.xmdh,qc_val.zkph,count(1) cnt3,cast(avg(zkjg) as decimal(12, 3)) avg3, cast(STDEV(zkjg) as decimal(12, 3)) sd3,cast(100*STDEV(zkjg)/avg(zkjg) as decimal(12, 3)) as cv3 FROM qc_val where zkrq>=(select max(ksrq) from qc_sample x where x.yq=qc_val.yq and x.xmdh=qc_val.xmdh and x.zkph=qc_val.zkph and convert(datetime,convert(char(8),#{zkrq},120)+'01') >=x.ksrq) - and isnull((select min(ksrq) from qc_sample x where x.yq=qc_val.yq and x.xmdh=qc_val.xmdh and x.zkph=qc_val.zkph and x.ksrq>(select max(ksrq) from qc_sample x where x.yq=qc_val.yq and x.xmdh=qc_val.xmdh and x.zkph=qc_val.zkph and x.ksrq<=convert(datetime,convert(char(8),#{zkrq},120)+'01')) and convert(datetime,convert(char(8),DATEADD(month,1,#{zkrq}),120)+'01')>=x.ksrq ),convert(datetime,convert(char(8),DATEADD(month,1,#{zkrq}),120)+'01') )>zkrq + and isnull((select min(ksrq) from qc_sample x where x.yq=qc_val.yq and x.xmdh=qc_val.xmdh and x.zkph=qc_val.zkph and x.ksrq>(select max(ksrq) from qc_sample x where x.yq=qc_val.yq and x.xmdh=qc_val.xmdh and x.zkph=qc_val.zkph and convert(datetime,convert(char(8),#{zkrq},120)+'01')>=x.ksrq ) and convert(datetime,convert(char(8),DATEADD(month,1,#{zkrq}),120)+'01')>=x.ksrq ),convert(datetime,convert(char(8),DATEADD(month,1,#{zkrq}),120)+'01') )>zkrq and qc_val.yq=#{yq} and qc_val.zkph=#{zkph} group by qc_val.yq,qc_val.zkph,qc_val.xmdh