zss
2023-08-22 affabbd21802dacbf943692912a83e63106670e4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yuanchu.limslaboratory.mapper.InspectionProductMapper">
    <update id="upda">
        update lims_laboratory.inspection_product
        set test_state=null
        where id = #{id}
          and state = 1
    </update>
 
    <!--根据检验单id查询检验项目的检验结果-->
    <select id="getresult" resultType="java.lang.Integer">
        select test_state
        from lims_laboratory.inspection_product
        where state = 1
          and inspection_material_id = (select id from lims_laboratory.inspection_material where inspection_id = #{id})
    </select>
    <!--根据检验样品id作废检验项目-->
    <update id="updat">
        update lims_laboratory.inspection_product
        set state=0
        where inspection_material_id = #{id}
    </update>
 
    <!--计算已检验项目数量-->
    <select id="seleCountInspro" resultType="java.lang.Integer">
        select count(id)
        from lims_laboratory.inspection_product
        where state = 1
          and test_state in (0, 1)
    </select>
 
    <!--计算未检验项目数量-->
    <select id="seleCountUnInspro" resultType="java.lang.Integer">
        select count(id)
        from lims_laboratory.inspection_product
        where state = 1
          and test_state is null
    </select>
</mapper>