zhs il y a 2 ans
Parent
commit
6e8bf73378
1 fichiers modifiés avec 7 ajouts et 4 suppressions
  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>
     <!-- 查询所有物料 -->