Commit b2682797 by lijingjing

修改验收台账查询;

parent ddef03e8
......@@ -127,45 +127,48 @@
<select id="selectVOList" resultType="com.patzn.cloud.service.hmhj.vo.EntrustVO">
with sample as (
SELECT
s.company_id,s.entrust_id,max(s.sample_from) "sample_from"
from entrust_sample s where s.deleted = 0
<if test="null != vo.sampleCode">
and s.code like concat('%',#{vo.sampleCode},'%')
</if>
<if test="null != vo.sampleStatus">
and s.status = #{vo.sampleStatus}
</if>
<if test="null != vo.judgeStatus">
and s.judge_status = #{vo.judgeStatus}
</if>
<if test="null == vo.sampleType">
and s.type = 0
</if>
<if test="null != vo.sampleType">
and s.type = #{vo.sampleType}
</if>
<if test="null != vo.judgeStatusList">
and s.judge_status IN
<foreach collection="vo.judgeStatusList" index="index" item="judgeStatus" open="(" separator="," close=")">
#{judgeStatus}
</foreach>
</if>
<if test="null != vo.notSampleStatus">
and s.status != #{vo.notSampleStatus}
</if>
<if test="null != vo.itemStatus || null != vo.testerId">
AND exists (
select 1 from entrust_sample_item i where i.deleted = 0
<if test="null != vo.itemStatus">
and i.entrust_sample_id = s.id and i.status = #{vo.itemStatus}
SELECT
s.company_id,s.entrust_id,max(s.sample_from) "sample_from"
from entrust_sample s where s.deleted = 0
<if test="null != vo.sampleCode">
and s.code like concat('%',#{vo.sampleCode},'%')
</if>
<if test="null != vo.testerId">
and i.entrust_sample_id = s.id and i.tester_id = #{vo.testerId}
<if test="null != vo.sampleName">
and s.name like concat('%',#{vo.sampleName},'%')
</if>
)
</if>
GROUP BY s.company_id,s.entrust_id
<if test="null != vo.sampleStatus">
and s.status = #{vo.sampleStatus}
</if>
<if test="null != vo.judgeStatus">
and s.judge_status = #{vo.judgeStatus}
</if>
<if test="null == vo.sampleType">
and s.type = 0
</if>
<if test="null != vo.sampleType">
and s.type = #{vo.sampleType}
</if>
<if test="null != vo.judgeStatusList">
and s.judge_status IN
<foreach collection="vo.judgeStatusList" index="index" item="judgeStatus" open="(" separator="," close=")">
#{judgeStatus}
</foreach>
</if>
<if test="null != vo.notSampleStatus">
and s.status != #{vo.notSampleStatus}
</if>
<if test="null != vo.itemStatus || null != vo.testerId">
AND exists (
select 1 from entrust_sample_item i where i.deleted = 0
<if test="null != vo.itemStatus">
and i.entrust_sample_id = s.id and i.status = #{vo.itemStatus}
</if>
<if test="null != vo.testerId">
and i.entrust_sample_id = s.id and i.tester_id = #{vo.testerId}
</if>
)
</if>
GROUP BY s.company_id,s.entrust_id
)
SELECT e.*,s.sample_from,r.report_send_time
FROM entrust e
......
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