zhangyuewww %!s(int64=3) %!d(string=hai) anos
pai
achega
c2f70af563

+ 13 - 15
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseBaseInfoMapper.xml

@@ -43,10 +43,10 @@
         q.title_no as titleNo,
         q.title_no_other as titleNoOther,
         a.tidal_grain_price as netWeightPrice,
-        a.gross_weight as grossWeight,
-        a.tare as tare,
-        a.weight_deduction as buckleWeight,
-        a.net_weight as netWeight,
+        a.gross_weight/1000 as grossWeight,
+        a.tare/1000 as tare,
+        a.weight_deduction/1000 as buckleWeight,
+        a.net_weight/1000 as netWeight,
         a.unit_deduction as unitDeduction,
         a.solid_grain_price as pureWeightPrice,
         a.pure_weight as pureWeight,
@@ -87,12 +87,12 @@
         s.contract_no as contractNo,
         '' as paymentNo,
         m.seller as customerName,
-        i.supplier as supplier,
-        p.goods_name as goodsName,
-        case when p.goods_name = '玉米(潮粮)' then '潮粮' else '干粮' end as type,
-        p.grade as grade,
-        p.water_content as waterContent,
-        p.impurity as impurity,
+        '' as supplier,
+        g.goods_name as goodsName,
+        case when g.goods_name = '玉米(潮粮)' then '潮粮' else '干粮' end as type,
+        g.grade as grade,
+        g.water_content as waterContent,
+        g.impurity as impurity,
         s.car_no as carNo,
         w.box_no as boxNo,
         w.box_no_other as boxNoOther,
@@ -116,12 +116,10 @@
         left join warehouse_in_out_info w on w.id = s.warehouse_record_id and w.delete_flag = 0
         left join common_company c on c.comp_id = s.comp_id and c.delete_flag = 0
         left join contract_management_info m on m.comp_id = s.comp_id and m.contract_no = s.contract_no and  c.delete_flag = 0
-        left join contract_process_info p on m.id=p.contract_id and  p.delete_flag = 0
-        left join identity_authentication_info i on i.customer_name = m.seller
-        and i.customer_phone = m.seller_phone and i.customer_type_flag = 1 and i.delete_flag = 0 and i.cover = 0
-        left join common_company_identity cci on  cci.com_id = s.comp_id  and cci.delete_flag = 0
+        left join contract_goods_info g on m.id=g.contract_id and  g.delete_flag = 0
+        left join customer_info i on (i.comp_name = m.seller and customer_type='企业客户') or (i.customer_name = m.seller and customer_type='个人客户')
+        and i.customer_phone = m.seller_phone and i.delete_flag = 0
         WHERE s.delete_flag = '0'
-        and cci.identity_id = i.id
         AND s.comp_id = #{compId}
         <if test="warehouseName != null and warehouseName != ''">
             AND s.warehouse_name= #{warehouseName}