李宇
2021-06-18 305aa3ffe7908b95d59cdf43723b81b4861ef2c1
src/main/java/com/nanometer/smartlab/dao/SysLaboratoryDao.xml
@@ -31,6 +31,9 @@
    <if test="department != null and department != ''">
      and su.department = #{department}
    </if>
    <if test="project != null and project != ''">
      and su.project like concat("%",#{project},"%")
    </if>
  </sql>
  <select id="getSysLaboratory" parameterType="java.lang.String"  resultMap="SysLaboratory" >
@@ -58,7 +61,8 @@
    CONCAT(location1,'-',location2)
    END
    location,
    bm2.meta_value department
    bm2.meta_value department,
    sl.project
    from sys_laboratory as sl
    LEFT JOIN base_meta bm1 on bm1.id = sl.type
    left JOIN base_meta bm2 on bm2.id = sl.department
@@ -68,6 +72,9 @@
    </if>
    <if test="type != null and type != ''">
      and sl.type = #{type};
    </if>
    <if test="project != null and project != ''">
      and sl.project like concat("%",#{project},"%")
    </if>
  </select>
@@ -112,7 +119,22 @@
    where bar_code = #{barCode}
    and valid_flag=1
  </select>
  <select id="getLaboratoryByProject" resultType="com.nanometer.smartlab.entity.dto.LaboratoryVo$Laboratory">
    SELECT
    CONCAT('楼号:',sl.location1,'-地址号:',sl.location2) as address,
    bm.meta_value as department
    FROM
   sys_laboratory as sl
    LEFT JOIN base_meta bm on bm.id = sl.department
    WHERE
   sl.project LIKE CONCAT('%',#{project},'%')
  </select>
  <select id="getSysLaboratoryByName"  resultMap="SysLaboratory">
    select *
    from  sys_laboratory
    where name = #{0}
    and valid_flag = 1
  </select>
  <update id="updateLabExport" parameterType="com.nanometer.smartlab.entity.SysLaboratory">
    update sys_laboratory set
    type=#{type},