Commit f4ff5eb0 by lijingjing

统计查询修改;

parent 7237c35e
...@@ -645,14 +645,14 @@ ...@@ -645,14 +645,14 @@
<select id="selectSampleItemStats" resultType="com.patzn.cloud.service.hmhj.vo.SampleItemStatsVO"> <select id="selectSampleItemStats" resultType="com.patzn.cloud.service.hmhj.vo.SampleItemStatsVO">
SELECT SELECT
s.code "sample_code", s.code "sample_code",
'[' || string_agg('{"key":"'||replace(ii.name,'-result','')||'","value":'||COALESCE(ii.test_value,'0')||'}',',') '[' || string_agg('{"key":"'||replace(ii.name,'-result','')||'","value":"'|| TRIM(COALESCE(ii.test_value,'0'))||'"}',',')
|| ']' "itemJson" || ']' "itemJson"
FROM FROM
entrust_sample_item_index ii entrust_sample_item_index ii
JOIN entrust_sample_item i ON i.ID = ii.entrust_sample_item_id JOIN entrust_sample_item i ON i.ID = ii.entrust_sample_item_id AND i.deleted = 0
JOIN entrust_sample s ON s.ID = i.entrust_sample_id JOIN entrust_sample s ON s.ID = i.entrust_sample_id AND s.deleted = 0
JOIN entrust e on e.id = s.entrust_id JOIN entrust e on e.id = s.entrust_id and e.deleted = 0
where ii.deleted = 0 and i.deleted = 0 and s.deleted = 0 and e.deleted = 0 AND s.type = 0 where ii.deleted = 0 and s.type = 0
<if test="null != vo.client"> <if test="null != vo.client">
and e.client LIKE CONCAT('%',#{vo.client},'%') and e.client LIKE CONCAT('%',#{vo.client},'%')
</if> </if>
......
...@@ -387,6 +387,7 @@ ...@@ -387,6 +387,7 @@
AND s.name like '%磷生铁%' AND s.name like '%磷生铁%'
AND i.period is not null AND i.period is not null
AND ii.test_value is not null AND ii.test_value is not null
AND TRIM(ii.test_value) ~ '^([0-9]+[.]?[0-9]+)$'
<if test="null != vo.timeS and null != vo.timeE"> <if test="null != vo.timeS and null != vo.timeE">
and i.test_time &gt;= #{vo.timeS} AND i.test_time &lt;= #{vo.timeE} and i.test_time &gt;= #{vo.timeS} AND i.test_time &lt;= #{vo.timeE}
</if> </if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment