|
@ -14,7 +14,7 @@ |
|
|
specification, |
|
|
specification, |
|
|
MAX(batch) AS batch, |
|
|
MAX(batch) AS batch, |
|
|
MAX(barLevel) AS barLevel, |
|
|
MAX(barLevel) AS barLevel, |
|
|
DATE_FORMAT(md.createTime, '%Y-%m') AS date, |
|
|
DATE_FORMAT(md.createTime, '%Y-%m-%d') AS date, |
|
|
COALESCE(SUM(CASE WHEN md.type = 1 THEN md.length ELSE 0 END), 0) AS ll_length, |
|
|
COALESCE(SUM(CASE WHEN md.type = 1 THEN md.length ELSE 0 END), 0) AS ll_length, |
|
|
COALESCE(SUM(CASE WHEN md.type = 1 THEN md.weight ELSE 0 END), 0) AS ll_weight, |
|
|
COALESCE(SUM(CASE WHEN md.type = 1 THEN md.weight ELSE 0 END), 0) AS ll_weight, |
|
|
COALESCE(SUM(CASE WHEN md.type = 2 THEN md.length ELSE 0 END), 0) AS sc_length, |
|
|
COALESCE(SUM(CASE WHEN md.type = 2 THEN md.length ELSE 0 END), 0) AS sc_length, |
|
@ -33,7 +33,7 @@ |
|
|
FROM material_data |
|
|
FROM material_data |
|
|
WHERE |
|
|
WHERE |
|
|
supplierCode = md.supplierCode AND |
|
|
supplierCode = md.supplierCode AND |
|
|
createTime <![CDATA[ < ]]> DATE_FORMAT(DATE_SUB(CONCAT(YEAR(#{query.start_time}), '-', MONTH(#{query.start_time}), '-01'), INTERVAL 1 DAY), '%Y-%m-%d') |
|
|
createTime <![CDATA[ < ]]> DATE_FORMAT(DATE_SUB(CONCAT(YEAR(#{query.start_time}), '-', DAY(#{query.start_time}), '-01'), INTERVAL 1 DAY), '%Y-%m-%d') |
|
|
), 0) AS sy_weight, |
|
|
), 0) AS sy_weight, |
|
|
COALESCE( |
|
|
COALESCE( |
|
|
(SELECT |
|
|
(SELECT |
|
@ -52,9 +52,9 @@ |
|
|
FROM |
|
|
FROM |
|
|
material_data md |
|
|
material_data md |
|
|
WHERE |
|
|
WHERE |
|
|
DATE_FORMAT(md.createTime, '%Y-%m') = DATE_FORMAT(#{query.start_time}, '%Y-%m') |
|
|
DATE_FORMAT(md.createTime, '%Y-%m-%d') = DATE_FORMAT(#{query.start_time}, '%Y-%m-%d') |
|
|
GROUP BY |
|
|
GROUP BY |
|
|
md.productName,md.specification,supplierCode, DATE_FORMAT(md.createTime, '%Y-%m') |
|
|
md.productName,md.specification,supplierCode, DATE_FORMAT(md.createTime, '%Y-%m-%d') |
|
|
ORDER BY |
|
|
ORDER BY |
|
|
md.supplierCode, md.productName |
|
|
md.supplierCode, md.productName |
|
|
|
|
|
|
|
|