value
2023-08-29 53b5ea2b96d76b2072819f14a48f26c58cea0f84
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?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.ProductModelMapper">
    <resultMap id="selectproductModelMap" type="map">
        <id property="name" column="father"/>
        <collection property="children" resultMap="selectproductModelTowMap" javaType="List"/>
    </resultMap>
 
    <resultMap id="selectproductModelTowMap" type="map">
        <id property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="unit" column="unit"/>
    </resultMap>
    <!--查询标准模版列表-->
    <select id="selectproductModel" resultMap="selectproductModelMap">
        select id,
        father,
        name,
        unit
        from lims_laboratory.product_model
        where state=1
        and material=#{material}
        <if test="name!=null and name!=''">
            and name like concat('%',#{name},'%')
        </if>
        <if test="father!=null and father!=''">
            and father like concat('%',#{father},'%')
        </if>
    </select>
 
    <update id="delAllproductModel">
        update lims_laboratory.product_model
        set state=0
        where id in (${ids})
    </update>
    <!--添加标准选择项目分组-->
    <select id="selectfather" resultType="java.lang.String">
        SELECT DISTINCT father
        FROM lims_laboratory.product_model
        WHERE state = 1
    </select>
 
    <!--查询项目模版根据样品名-->
    <select id="seleMode" resultType="java.util.Map">
        select name,
               father,
               unit
        from lims_laboratory.product_model
        where state = 1
          and material = #{name}
    </select>
 
    <!--添加标准选择样品名称-->
    <select id="selectmater" resultType="java.lang.String">
        select DISTINCT material
        from lims_laboratory.product_model
        where state = 1
    </select>
</mapper>