zhs %!s(int64=2) %!d(string=hai) anos
pai
achega
5b82f32eaf

+ 16 - 11
src/main/resources/mapper/AskGoodsMapper.xml

@@ -34,17 +34,22 @@
     </insert>
     <!-- 查询生产领料单 -->
     <select id="getAskGoodsfList" resultType="com.tld.model.AskGoods">
-        select
-               DISTINCT a.ask_goods_id,
-               a.ask_goods_code,
-               b.name as departmentName,
-               a.company_number
-        from tld_ask_goods_f a
-        join tld_ask_goods d on a.ask_goods_id = d.ask_goods_id
-        left join tld_department b on a.department = b.tld_id
-        join tld_material c on d.material_id = c.tld_id
-        where c.part_type != '半成品'
-        order by a.sqrq desc
+        SELECT
+            a.ask_goods_id,
+            a.material_id,
+            IFNULL( a.out_num, 0 ) AS num,
+            e.NAME AS materialName,
+            e.CODE AS materialCode,
+            b.ask_goods_code,
+            b.company_number
+        FROM
+            tld_ask_goods a
+            JOIN tld_ask_goods_f b ON a.ask_goods_id = b.ask_goods_id
+            LEFT JOIN tld_department c ON b.department = c.CODE
+            JOIN tld_material e ON a.material_id = e.tld_id
+        WHERE
+                ( a.num + 0 ) <![CDATA[>]]> (
+                IFNULL( a.out_num, 0 ) + 0) and e.part_type != '半成品' and e.part_type != '产成品'
     </select>
     <!-- 查询指定生产单的物料 -->
     <select id="getAskGoodsMaterial" resultType="com.tld.model.AskGoods">

+ 15 - 7
src/main/resources/mapper/InviteMapper.xml

@@ -39,14 +39,22 @@
     </insert>
     <!-- 查询生产领料单 -->
     <select id="getAskGoodsfList" resultType="com.tld.model.AskGoods">
-        select
+        SELECT
             a.ask_goods_id,
-            a.ask_goods_code,
-            b.name as departmentName,
-            a.company_number
-        from tld_invite_f a
-        left join tld_department b on a.department = b.tld_id
-        order by a.sqrq desc
+            a.material_id,
+            IFNULL( a.out_num, 0 ) AS num,
+            e.NAME AS materialName,
+            e.CODE AS materialCode,
+            b.ask_goods_code,
+            b.company_number
+        FROM
+            tld_invite a
+            JOIN tld_invite_f b ON a.ask_goods_id = b.ask_goods_id
+            LEFT JOIN tld_department c ON b.department = c.CODE
+            JOIN tld_material e ON a.material_id = e.tld_id
+        WHERE
+                ( a.num + 0 ) <![CDATA[>]]> (
+                IFNULL( a.out_num, 0 ) + 0) and e.part_type != '半成品' and e.part_type != '产成品'
     </select>
     <!-- 查询指定生产单的物料 -->
     <select id="getAskGoodsMaterial" resultType="com.tld.model.AskGoods">

+ 4 - 1
src/main/resources/mapper/StorageLocationMapper.xml

@@ -40,11 +40,14 @@
             <if test="isNotDisable != null and isNotDisable != ''">
                 and a.is_not_disable = #{isNotDisable}
             </if>
+            <if test="warehouseWhere != null and warehouseWhere != ''">
+                and a.warehouse_where = #{warehouseWhere}
+            </if>
             <if test="id != null and id != ''">
                 and a.id = #{id}
             </if>
             <if test="isProduct != null and isProduct != ''">
-                and is_product = #{isProduct}
+                and a.is_product = #{isProduct}
             </if>
         </trim>
         order by a.id desc

+ 4 - 5
src/main/resources/mapper/WarehousingMapper.xml

@@ -18,11 +18,10 @@
     <!-- 根据物料分类查询库位 -->
     <select id="getMaterialClassType" resultType="com.tld.model.MaterialClass">
         select
-            a.id,
-            a.storage_location_code
-        from tld_material_class a
-        join tld_material b on a.wllb_code = b.code
-        join tld_inventory c on b.wllb_class = c.wllb_class
+            b.id,
+            b.storage_location_code
+        from tld_material a
+        join tld_storage_location b on a.wllb_class = b.storage_location_type
         where a.wllb_code = #{wllbCode}
     </select>
     <!-- 新增库位信息虚拟表 -->