Browse Source

隐患排查档案与省平台数量保持一致

master
liwenxuan 4 months ago
parent
commit
8ddd80aebb
  1. 22
      src/main/resources/mapper/FxfxdxMapper.xml

22
src/main/resources/mapper/FxfxdxMapper.xml

@ -488,14 +488,6 @@
a.FDANGERDESC AS yinhuanmiaoshu, a.FDANGERDESC AS yinhuanmiaoshu,
a.fdangerreason AS yuanyinfenxi, a.fdangerreason AS yuanyinfenxi,
a.fremark AS kongzhicuoshi, a.fremark AS kongzhicuoshi,
-- 资金万元计算(当前代码被注释,如需启用请确保逻辑正确)
/*(CASE
WHEN a.fcost IS NULL OR a.fcost = '' THEN NULL
WHEN a.fcost = '0' THEN '0'
ELSE
-- 将字符串转换为数值,除以10000 ,再转换回字符串并保留两位小数
CAST(ROUND(TRY_CONVERT(DECIMAL(18, 2), a.fcost) / 10000, 2) AS VARCHAR(20))
END) AS zijinwanyuan,*/
a.fcost AS zijinwanyuan, a.fcost AS zijinwanyuan,
-- 根据状态代码判断隐患状态 -- 根据状态代码判断隐患状态
(CASE (CASE
@ -546,22 +538,13 @@
LEFT JOIN PF_ACCOUNT k ON LEFT JOIN PF_ACCOUNT k ON
a.CREATOR = k.ID a.CREATOR = k.ID
outer apply ( outer apply (
-- 对每个c.ID,只取e表中匹配的第一条记录(可按实际需求调整排序)
select top 1 * select top 1 *
from ISM_RISKEVENT e from ISM_RISKEVENT e
where e.RISKUNITID = c.ID where e.RISKUNITID = c.ID
order by e.id -- 按id排序,取第一条;可改为e.create_time等 order by e.id
) e ) e
/*WHERE
a.ISDELETE = 'N'
AND e.ISDELETE = 'N'
and a.CREASTAMP >= '2025-01-01 00:00:00.000'
--and a.fmeasure='e8211360c0204428bc247c5c7d5cfd8e'
order by
chuangjianshijian desc*/
WHERE WHERE
--a.ORGANID = '309_ORG' a.ISDELETE = 'N'
and a.ISDELETE = 'N'
and a.fstate = '9' and a.fstate = '9'
and len(b.code)= 12 and len(b.code)= 12
and i.EMPNAME is not null and i.EMPNAME is not null
@ -571,6 +554,7 @@
else a.fstate else a.fstate
end )='9' end )='9'
and LEFT(a.fcheckpertime, 19) is not null and LEFT(a.fcheckpertime, 19) is not null
--and a.ORGANID = '309_ORG'
<choose> <choose>
<when test='isSingleDay == "Y"'> <when test='isSingleDay == "Y"'>
AND isnull(LEFT(a.MODISTAMP, 19), LEFT(a.CREASTAMP, 19)) between DATEADD(day, -1, GETDATE()) AND DATEADD(day, -0, GETDATE()) AND isnull(LEFT(a.MODISTAMP, 19), LEFT(a.CREASTAMP, 19)) between DATEADD(day, -1, GETDATE()) AND DATEADD(day, -0, GETDATE())

Loading…
Cancel
Save