gongchunyi
2026-06-24 96a6f204fadc4c2516f7ca00c6f1f3874279b32b
src/main/resources/mapper/quality/QualityTestStandardMapper.xml
@@ -7,18 +7,25 @@
        FROM quality_test_standard
        where
        1=1
        <if test="qualityTestStandard.productId != null and qualityTestStandard.productId != '' ">
            AND product_id = #{qualityTestStandard.productId}
        <if test="c.standardNo != null and c.standardNo != '' ">
            AND standard_no like concat('%',#{c.standardNo},'%')
        </if>
        <if test="c.standardName != null and c.standardName != '' ">
            AND standard_name like concat('%',#{c.standardName},'%')
        </if>
        <if test="c.state != null ">
            AND state =#{c.state}
        </if>
        <if test="c.inspectType != null ">
            AND inspect_type =#{c.inspectType}
        </if>
    </select>
    <select id="qualityTestStandardList" resultType="com.ruoyi.quality.pojo.QualityTestStandard">
        SELECT
        *
        FROM quality_test_standard
        where
        1=1
        <if test="qualityTestStandard.productId != null and qualityTestStandard.productId != '' ">
            AND product_id = #{qualityTestStandard.productId}
        </if>
    <select id="getQualityTestStandardByProductId" resultType="com.ruoyi.quality.pojo.QualityTestStandard">
        SELECT qts.*
        FROM quality_test_standard qts
                 left join quality_test_standard_binding qtsb on qtsb.test_standard_id = qts.id
        WHERE qtsb.product_id = #{productId}
          AND qts.inspect_type = #{inspectType}
        order by qts.id desc
    </select>
</mapper>