zss
2023-08-22 9af79e89d057f44b142fa8af6ae394d2ce7ccfe3
inspection-server/src/main/resources/mapper/InspectionMapper.xml
@@ -20,10 +20,43 @@
        from lims_laboratory.inspection i
        join lims_laboratory.user u on i.user_id = u.id
        join lims_laboratory.inspection_material im on i.id = im.inspection_id
        where   i.state=1
        where i.state=1
        <if test="message!=null">
            and i.code like concat('%', #{message}, '%')
            or im.name like concat('%', #{message}, '%')
        </if>
    </select>
    <!--计算检验的检验单数量-->
    <select id="seleCountIns" resultType="java.lang.Integer">
        select count(id)
        from lims_laboratory.inspection
        where state = 1
          and inspection_status in (0, 1)
    </select>
    <!--计算未检验的检验单数量-->
    <select id="seleCountUnIns" resultType="java.lang.Integer">
        select count(id)
        from lims_laboratory.inspection
        where state = 1
          and inspection_status is null
    </select>
    <!--获取检验单总数-->
    <select id="getcount" resultType="java.lang.Integer">
        select count(id)
        from lims_laboratory.inspection
        where state = 1
    </select>
    <!--检验结论,检验数量-->
    <select id="getResultNum" resultType="java.util.Map">
        select inspection_status result,
               count(id)         num
        from lims_laboratory.inspection
        where state=1
        group by result
        order by num desc
    </select>
</mapper>