|
|
@ -913,8 +913,11 @@ GROUP BY
|
|
|
|
<result property="Number" column="Number"/>
|
|
|
|
<result property="Number" column="Number"/>
|
|
|
|
<!--部门-->
|
|
|
|
<!--部门-->
|
|
|
|
<result property="FFullName" column="FFullName"/>
|
|
|
|
<result property="FFullName" column="FFullName"/>
|
|
|
|
|
|
|
|
<!--销售磅单数-->
|
|
|
|
<!--采购总额-->
|
|
|
|
<result property="bangdan" column="bangdan"/>
|
|
|
|
|
|
|
|
<!--销售吨位-->
|
|
|
|
|
|
|
|
<result property="settlement" column="settlement"/>
|
|
|
|
|
|
|
|
<!--销售总额-->
|
|
|
|
<result property="amout" column="amout"/>
|
|
|
|
<result property="amout" column="amout"/>
|
|
|
|
<!--代付款总额-->
|
|
|
|
<!--代付款总额-->
|
|
|
|
<result property="notCollectionAmounts" column="notCollectionAmounts"/>
|
|
|
|
<result property="notCollectionAmounts" column="notCollectionAmounts"/>
|
|
|
@ -922,22 +925,40 @@ GROUP BY
|
|
|
|
<result property="collectionamounts" column="collectionamounts"/>
|
|
|
|
<result property="collectionamounts" column="collectionamounts"/>
|
|
|
|
</resultMap>
|
|
|
|
</resultMap>
|
|
|
|
<select id="getSalesorderData" resultMap="getSalesorderDataMap">
|
|
|
|
<select id="getSalesorderData" resultMap="getSalesorderDataMap">
|
|
|
|
|
|
|
|
|
|
|
|
SET @i = 0;
|
|
|
|
SET @i = 0;
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
|
( @i := @i + 1 ) AS 'Number',
|
|
|
|
( @i := @i + 1 ) AS 'Number',
|
|
|
|
F_FullName AS FFullName,
|
|
|
|
F_FullName AS FFullName,
|
|
|
|
SUM(price) AS amout,
|
|
|
|
SUM( a.price ) AS amout,
|
|
|
|
SUM(price)- SUM(amount_collected) AS notCollectionAmounts,
|
|
|
|
bangdan,
|
|
|
|
|
|
|
|
settlement,
|
|
|
|
|
|
|
|
SUM( a.price )- SUM( amount_collected ) AS notCollectionAmounts,
|
|
|
|
SUM( amount_collected ) AS collectionamounts
|
|
|
|
SUM( amount_collected ) AS collectionamounts
|
|
|
|
|
|
|
|
|
|
|
|
FROM
|
|
|
|
FROM
|
|
|
|
jg_salesorder a
|
|
|
|
jg_salesorder a
|
|
|
|
LEFT JOIN base_organize z ON a.department_id = z.F_Id
|
|
|
|
LEFT JOIN base_organize z ON a.department_id = z.F_Id
|
|
|
|
|
|
|
|
LEFT JOIN (
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
|
|
|
|
COUNT( b.id ) AS bangdan,
|
|
|
|
|
|
|
|
SUM(
|
|
|
|
|
|
|
|
Round( IF ( b.unit = '1', b.settlement / 1000, b.settlement ), 3 )) AS settlement,
|
|
|
|
|
|
|
|
a.department_id
|
|
|
|
|
|
|
|
FROM
|
|
|
|
|
|
|
|
jg_salesorder a
|
|
|
|
|
|
|
|
LEFT JOIN jg_salesorder_item0 b ON a.id = b.sales_order_id
|
|
|
|
|
|
|
|
AND b.delete_mark = '0'
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
to_days( a.creator_time ) = to_days(
|
|
|
|
to_days( a.creator_time ) = to_days(
|
|
|
|
now())
|
|
|
|
now())
|
|
|
|
AND
|
|
|
|
AND a.delete_mark = '0'
|
|
|
|
a.delete_mark='0'
|
|
|
|
GROUP BY
|
|
|
|
|
|
|
|
a.department_id
|
|
|
|
|
|
|
|
) c ON a.department_id = c.department_id
|
|
|
|
|
|
|
|
WHERE
|
|
|
|
|
|
|
|
to_days( a.creator_time ) = to_days(
|
|
|
|
|
|
|
|
now())
|
|
|
|
|
|
|
|
AND a.delete_mark = '0'
|
|
|
|
GROUP BY
|
|
|
|
GROUP BY
|
|
|
|
a.department_id
|
|
|
|
a.department_id
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|