zss
2023-08-22 c427ed3db05c772cec3658949e19bcf1b6c0d2a7
inspection-server/src/main/resources/mapper/InspectionMapper.xml
@@ -51,6 +51,20 @@
    </select>
    <!--检验结论,检验数量-->
    <select id="qualified" resultType="java.lang.Long">
        select count(id)
        from lims_laboratory.inspection
        where state = 1
        and type = 0
        <if test="b!=null ">
            and inspection_status = #{b}
        </if>
        <if test="b==null">
            and inspection_status is null
        </if>
    </select>
    <!--计算原材料与成品的合格率-->
    <select id="getResultNum" resultType="java.util.Map">
        select inspection_status result,
               count(id)         num
@@ -58,15 +72,6 @@
        where state = 1
        group by result
        order by num desc
    </select>
    <!--计算原材料与成品的合格率-->
    <select id="qualified" resultType="java.lang.Long">
        select count(id)
        from lims_laboratory.inspection
        where state = 1
          and type = 0
          and inspection_status = #{b}
    </select>
    <!--计算原材料检验单总数-->
@@ -82,6 +87,20 @@
        select count(id)
        from lims_laboratory.inspection
        where state = 1
          and type in (1,2)
          and type in (1, 2)
    </select>
    <!--计算原材料合格率-->
    <select id="qualifiedfin" resultType="java.lang.Long">
        select count(id)
        from lims_laboratory.inspection
        where state = 1
        and type in (1, 2)
        <if test="i!=null ">
            and inspection_status = #{i}
        </if>
        <if test="i==null">
            and inspection_status is null
        </if>
    </select>
</mapper>