zss
2023-08-22 da30df12fc02f28a4b016c8c35a3b57e5c29fe35
standard-server/src/main/resources/mapper/ProductModelMapper.xml
@@ -1,8 +1,18 @@
<?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" resultType="java.util.Map">
    <select id="selectproductModel" resultMap="selectproductModelMap">
        select id,
        father,
        name,
@@ -16,7 +26,6 @@
        <if test="father!=null and father!=''">
            and father like concat('%',#{father},'%')
        </if>
        order by father
    </select>
    <update id="delAllproductModel">
@@ -26,9 +35,9 @@
    </update>
    <!--添加标准选择项目分组-->
    <select id="selectfather" resultType="java.lang.String">
        select distinct father
        from lims_laboratory.product_model
        where state = 1
        SELECT DISTINCT father
        FROM lims_laboratory.product_model
        WHERE state = 1
    </select>
    <!--查询项目模版根据样品名-->
@@ -38,6 +47,13 @@
               unit
        from lims_laboratory.product_model
        where state = 1
          and material =#{name}
          and material = #{name}
    </select>
</mapper>
    <!--添加标准选择样品名称-->
    <select id="selectmater" resultType="java.lang.String">
        select material
        from lims_laboratory.product_model
        where state = 1
    </select>
</mapper>