value
2023-08-28 d9505757da1a789c4bb9f7c05e8bfd1f09b77ba1
standard-server/src/main/resources/mapper/SpecificationsMapper.xml
@@ -1,23 +1,14 @@
<?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.SpecificationsMapper">
    <select id="listSpecificationsInformation" resultType="map">
        SELECT s.`id`,s.`name`,DATE_FORMAT(s.`update_time`, '%Y-%m-%d %H:%i') updateTime,u.`name` username,s.`vel`,s.`spe_state`
        FROM specifications s,`user` u
        WHERE s.`user_id` = u.`id`
            AND s.`serial_id` = #{serialNumberId}
        <if test="specificationsName != null">
            AND s.`name` = #{specificationsName}
        </if>
    </select>
    <select id="selectSNameSNName" resultType="Map">
        select m.num,m.supplier,m.name m_name,m.location,m.batch,m.reel_number,concat(s.name,'/',sn.name) ss_name,s.voltage_level,s.cross_section,s.number_of_cores,s.instruct from material m,specifications s,serial_number sn
        where m.specifications_id = s.id
        and s.serial_id = sn.id
        and m.id = #{materialId}
        order by s.create_time desc
        limit 1
    <!--根据规格id查询物料名称-->
    <select id="selMateName" resultType="java.lang.String">
        select name
        from lims_laboratory.material
        where state = 1
          and id = (select material_id
                    from lims_laboratory.standard
                    where standard.state = 1
                      and standard.id=#{standardId});
    </select>
</mapper>