瀏覽代碼

问题修改

zhs 2 年之前
父節點
當前提交
6e8bf73378
共有 1 個文件被更改,包括 7 次插入4 次删除
  1. 7 4
      src/main/resources/mapper/QueryListMappeer.xml

+ 7 - 4
src/main/resources/mapper/QueryListMappeer.xml

@@ -5,19 +5,22 @@
     <!-- 呆滞品查询 -->
    <select id="dullGoods" resultType="java.util.Map">
        SELECT
+           a.id as id,
            a.material_id as materialId,
            a.amount as amount,
            a.scrq as scrq,
            a.storage_location_code as storageLocationCode,
-           b.name as materialName
+           b.name as materialName,
+           c.storage_location_name as storageLocationName
        FROM tld_inventory a
-       JOIN tld_material b on a.material_id = b.tld_id
-       WHERE datediff(a.scrq, now()) <![CDATA[>]]> 90
+       JOIN tld_material b ON a.material_id = b.tld_id
+       LEFT JOIN  tld_storage_location c ON a.storage_location_code = c.storage_location_code
+       WHERE datediff(now(), a.scrq) <![CDATA[>]]> 90
         <if test="storageLocationCode != null and storageLocationCode != ''">
             and a.storage_location_code = #{storageLocationCode}
         </if>
         <if test="wllbCode != null and wllbCode != ''">
-           and b.coed = #{wllbCode}
+           and b.code = #{wllbCode}
         </if>
    </select>
     <!-- 查询所有物料 -->