gdg
2020-12-08 39d6fc5c2983a6afd757ed271301ebe65ac871b7
src/main/java/com/nanometer/smartlab/dao/SysLaboratoryDao.xml
@@ -48,6 +48,29 @@
    </if>
  </select>
  <select id="exportLabList" parameterType="java.util.Map" resultType="java.util.Map">
    SELECT bm1.meta_value type ,sl.name,sl.info_code infoCode,sl.bar_code barCode,
    CASE
    WHEN (ISNULL(location1)=1) || (LENGTH(trim(location1))=0)
    THEN
    CONCAT(location1,location2)
    ELSE
    CONCAT(location1,'-',location2)
    END
    location,
    bm2.meta_value department
    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
    where sl .valid_flag = 1
    <if test="name != null and name != ''">
      and sl.name like concat("%",#{name},"%")
    </if>
    <if test="type != null and type != ''">
      and sl.type = #{type};
    </if>
  </select>
  <select id="getSysLaboratoryTotalCount" parameterType="java.util.Map" resultType="int">
    select count(1) from sys_laboratory as su
    where su.valid_flag = 1