zss
2023-08-22 8c37d903a2fe25d5857c4555c791d552bec60cb8
laboratory-server/src/main/resources/mapper/InstrumentMapper.xml
@@ -23,23 +23,27 @@
    <!--选择设备-->
    <resultMap id="chooseinstumMap" type="map">
        <id property="father_name" column="father_name"/>
        <collection property="father" resultMap="chooseinstumTowMap" javaType="List"/>
        <id property="id" column="cid"/>
        <result property="name" column="father_name"/>
        <collection property="children" resultMap="chooseinstumTowMap" javaType="List"/>
    </resultMap>
    <resultMap id="chooseinstumTowMap" type="map">
        <id property="son_name" column="son_name"/>
        <collection property="chldren" resultMap="chooseinstumTowsMap" javaType="List"/>
        <id property="id" column="cid"/>
        <result property="name" column="son_name"/>
        <collection property="children" resultMap="chooseinstumTowsMap" javaType="List"/>
    </resultMap>
    <resultMap id="chooseinstumTowsMap" type="map">
        <id property="id" column="id"/>
        <result property="name" column="name"/>
    </resultMap>
    <select id="chooseinstum" resultMap="chooseinstumMap">
        select instrument.id,
               father_name,
               son_name,
        select c.id cid,
            instrument.id,
               father_name ,
               son_name ,
               equipment_name name
        from lims_laboratory.instrument
                 left join lims_laboratory.classify c on c.id = instrument.classify_id
        where conditions in(1,5)
    </select>
</mapper>