Commit 8789fbed by wangweidong

检测结果查询

parent 71465f8d
......@@ -100,13 +100,28 @@
<select id="selectTestResultQuery" resultType="com.patzn.cloud.service.hmhj.vo.EntrustSampleVO">
SELECT
s.id,s.name,s.code,e.code AS "entrustCode",e.client,e.entrust_time,e.test_side,s.supplier,s.manufacturer
FROM
entrust_sample s
JOIN entrust e ON s.entrust_id = e.ID
WHERE s.deleted = 0
AND e.deleted = 0
s.ID,
s.NAME,
s.code,
e.code AS "entrustCode",
e.client,
e.entrust_time,
e.test_side,
s.supplier,
s.manufacturer
FROM entrust_sample s
JOIN entrust e ON s.entrust_id = e.ID
JOIN (
SELECT i.entrust_sample_id FROM entrust_sample_item i
JOIN entrust_sample_item_index x ON i.ID = x.entrust_sample_item_id
WHERE i.deleted = 0 AND x.deleted = 0 AND x.test_value IS NOT NULL
GROUP BY i.entrust_sample_id
) k ON s.ID = k.entrust_sample_id
WHERE
s.deleted = 0
AND e.deleted = 0
<if test="vo.name!=null">
AND s.name LIKE CONCAT('%',#{vo.name},'%')
</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