|
|
@@ -121,9 +121,9 @@
|
|
121
|
121
|
<select id="queryQcInTzdInfByDepot" resultType="java.util.Map">
|
|
122
|
122
|
SELECT
|
|
123
|
123
|
ifnull(xzklhjz, 0.0) AS "zl",
|
|
124
|
|
- ifnull(c.shiping_count, 0.0) AS "sl",
|
|
125
|
|
- ifnull(c.remain_quantity, 0.0) AS "sysl",
|
|
126
|
|
- ifnull(c.complete_quantity, 0.0) AS "wcsl",
|
|
|
124
|
+ ifnull(c.shiping_count*1000, 0.0) AS "sl",
|
|
|
125
|
+ ifnull(c.remain_quantity*1000, c.shiping_count*1000) AS "sysl",
|
|
|
126
|
+ ifnull(c.complete_quantity*1000, 0.0) AS "wcsl",
|
|
127
|
127
|
ifnull(c.id, '') AS "dataId",
|
|
128
|
128
|
ifnull(b.tzdcbid, '') AS "tzdcbid",
|
|
129
|
129
|
ifnull(b.tzdbh, '') AS "tzdh"
|
|
|
@@ -153,9 +153,9 @@
|
|
153
|
153
|
<select id="queryQCOutTzdInfByDepot" resultType="java.util.Map">
|
|
154
|
154
|
SELECT
|
|
155
|
155
|
ifnull(klhjz, 0.0) AS "zl",
|
|
156
|
|
- ifnull(c.shiping_count, 0.0) AS "sl",
|
|
157
|
|
- ifnull(c.remain_quantity, 0.0) AS "sysl",
|
|
158
|
|
- ifnull(c.complete_quantity, 0.0) AS "wcsl",
|
|
|
156
|
+ ifnull(c.shiping_count*1000, 0.0) AS "sl",
|
|
|
157
|
+ ifnull(c.remain_quantity*1000, c.shiping_count*1000) AS "sysl",
|
|
|
158
|
+ ifnull(c.complete_quantity*1000, 0.0) AS "wcsl",
|
|
159
|
159
|
ifnull(c.id, '') AS "dataId",
|
|
160
|
160
|
ifnull(b.tzdcbid, '') AS "tzdcbid",
|
|
161
|
161
|
ifnull(b.tzdbh, '') AS "tzdh"
|
|
|
@@ -227,15 +227,15 @@ LEFT JOIN basic_enum grain_kind_enum ON grain_kind_enum.enumId = DATA_CRKYW_TZD
|
|
227
|
227
|
notice.id AS "dataid", -- 主表ID
|
|
228
|
228
|
notice.id AS tzdID, -- 通知单id
|
|
229
|
229
|
notice.bill_number AS tzdbh, -- 通知单编号,
|
|
230
|
|
- shiping_count as sl, -- 通知单数量
|
|
231
|
|
- CASE WHEN notice.bill_type=1 THEN in_count-IFNULL(detail.complete_quantity,0) ELSE out_count-IFNULL(detail.complete_quantity,0) END AS sysl, -- 剩余数量
|
|
|
230
|
+ shiping_count*1000 as sl, -- 通知单数量
|
|
|
231
|
+ CASE WHEN notice.bill_type=1 THEN in_count*1000-IFNULL(detail.complete_quantity,0)*1000 ELSE out_count*1000-IFNULL(detail.complete_quantity,0)*1000 END AS sysl, -- 剩余数量
|
|
232
|
232
|
CASE WHEN notice.bill_type=1 THEN '420801654D8F01A7D9FCE01B90A395E6' ELSE '284344D15DCA72D90AA43C24BD4F9B47' END AS FLOWID, -- 流程Id
|
|
233
|
233
|
DATE_FORMAT(detail.input_time,'%Y-%m-%d %T') AS rcsj -- 入仓时间
|
|
234
|
234
|
,notice.contract AS htbh -- 合同编号
|
|
235
|
235
|
,notice.contract_bid AS htId -- 合同id
|
|
236
|
|
- ,plan.plan_number AS jhdbh -- 计划编号
|
|
|
236
|
+ ,notice.plan_number AS jhdbh -- 计划编号
|
|
237
|
237
|
,notice.plan_bid AS jhdId -- 计划id
|
|
238
|
|
- ,enum.enumName as jhfl -- 计划分类
|
|
|
238
|
+ ,plan.plan_type as jhfl -- 计划分类
|
|
239
|
239
|
,customer.name as slr -- <!-- 客户名称 -->
|
|
240
|
240
|
,customer.address as slrdz, -- <!-- 地址 -->
|
|
241
|
241
|
IFNULL(customer.social_credit_code,customer.identification) as slrsfzh,-- <!-- 企业信用代码或者身份证号 -->
|
|
|
@@ -262,7 +262,7 @@ LEFT JOIN basic_enum grain_kind_enum ON grain_kind_enum.enumId = DATA_CRKYW_TZD
|
|
262
|
262
|
detail.grain_producing_area AS "cd",
|
|
263
|
263
|
|
|
264
|
264
|
tzscnf_enum.enumName AS "tzscnf_value", -- 生产年份名称
|
|
265
|
|
- detail.grain_annual AS "scnf",
|
|
|
265
|
+ tzscnf_enum.enumId AS "scnf",
|
|
266
|
266
|
|
|
267
|
267
|
detail.house_id as chID, -- 仓房id
|
|
268
|
268
|
detail.warehouse_id as hwID, -- 货位id
|
|
|
@@ -272,11 +272,11 @@ LEFT JOIN basic_enum grain_kind_enum ON grain_kind_enum.enumId = DATA_CRKYW_TZD
|
|
272
|
272
|
business_delivery_storage_notice notice
|
|
273
|
273
|
inner JOIN business_store_ware_detail detail on notice.id = detail.zid
|
|
274
|
274
|
left join business_customer customer on customer.id=notice.customer_bid
|
|
275
|
|
- left join business_plan plan on notice.plan_bid = plan.id
|
|
276
|
|
- left join basic_enum enum on plan.execute_type = enum.enumId
|
|
|
275
|
+ left join business_rp_report plan on notice.plan_bid = plan.id
|
|
|
276
|
+ -- left join basic_enum enum on plan.execute_type = enum.enumId
|
|
277
|
277
|
|
|
278
|
278
|
LEFT JOIN basic_enum lsxz_enum ON lsxz_enum.enumId = detail.grain_attribute
|
|
279
|
|
- LEFT JOIN basic_enum tzscnf_enum ON tzscnf_enum.enumId = detail.grain_annual
|
|
|
279
|
+ LEFT JOIN basic_enum tzscnf_enum ON tzscnf_enum.parentId = 1004 and tzscnf_enum.enumname = detail.productive_year
|
|
280
|
280
|
LEFT JOIN basic_enum cd_enum ON cd_enum.enumId = detail.grain_producing_area
|
|
281
|
281
|
|
|
282
|
282
|
LEFT JOIN basic_enum grain_attribute_enum ON grain_attribute_enum.enumId = detail.grain_attribute
|