|
|
@@ -691,34 +691,97 @@
|
|
|
GROUP BY acc.bill_no
|
|
|
ORDER BY acc.create_time
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="trend" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ m.id moon,
|
|
|
+ IFNULL( n.money, 0 ) money
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ 1 AS id UNION
|
|
|
+ SELECT
|
|
|
+ 2 UNION
|
|
|
+ SELECT
|
|
|
+ 3 UNION
|
|
|
+ SELECT
|
|
|
+ 4 UNION
|
|
|
+ SELECT
|
|
|
+ 5 UNION
|
|
|
+ SELECT
|
|
|
+ 6 UNION
|
|
|
+ SELECT
|
|
|
+ 7 UNION
|
|
|
+ SELECT
|
|
|
+ 8 UNION
|
|
|
+ SELECT
|
|
|
+ 9 UNION
|
|
|
+ SELECT
|
|
|
+ 10 UNION
|
|
|
+ SELECT
|
|
|
+ 11 UNION
|
|
|
+ SELECT
|
|
|
+ 12
|
|
|
+ ) m
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT
|
|
|
+ DATE_FORMAT( sea.bill_date, '%m' ) AS moon,
|
|
|
+ ROUND( IFNULL( SUM( pre.TEU * pre.quantity ), 0 ), 2 ) AS money
|
|
|
+ FROM
|
|
|
+ los_sea_bills sea
|
|
|
+ LEFT JOIN los_sea_pre_containers pre ON sea.id = pre.pid
|
|
|
+ WHERE
|
|
|
+ sea.is_deleted = 0
|
|
|
+ AND pre.is_deleted = 0
|
|
|
+ <if test="deptPid!=null">
|
|
|
+ AND sea.branch_id = #{deptPid}
|
|
|
+ </if>
|
|
|
+ <if test="postId!=null and postId != ''">
|
|
|
+ AND find_in_set(sea.team_id,#{postId})
|
|
|
+ </if>
|
|
|
+ <if test="tenantId!=null and tenantId != ''">
|
|
|
+ AND sea.tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ <if test="date==null or date == ''">
|
|
|
+ AND YEAR ( sea.bill_date ) = YEAR (NoW())
|
|
|
+ </if>
|
|
|
+ <if test="date!=null and date != ''">
|
|
|
+ AND YEAR ( sea.bill_date ) = #{date}
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ DATE_FORMAT( sea.bill_date, '%m' )
|
|
|
+ ) n ON m.id = n.moon
|
|
|
+ ORDER BY
|
|
|
+ m.id
|
|
|
+ </select>
|
|
|
<select id="financeProfit" resultType="org.springblade.los.statisticAnalysis.FinanceProfit">
|
|
|
SELECT
|
|
|
- seb.bill_type AS billType,
|
|
|
- seb.bill_no AS billNo,
|
|
|
- seb.hblno AS hBlNo,
|
|
|
- seb.mblno AS mBlNo,
|
|
|
- seb.corp_cn_name AS corpName,
|
|
|
- seb.bill_type AS statisticsDate,
|
|
|
- seb.src_cn_name AS salesman,
|
|
|
- seb.pod_cn_name AS pod,
|
|
|
- seb.pol_cn_name AS pol,
|
|
|
- seb.vessel_cn_name AS vesselCnName,
|
|
|
- seb.voyage_no AS voyageNo,
|
|
|
- seb.acc_dept_name AS accDeptName,
|
|
|
- seb.line_cn_name AS lineCnName,
|
|
|
- seb.carrier_cn_name AS carrierCnName,
|
|
|
- seb.operator_name AS operatorName,
|
|
|
- SUM(IF(feeDU.amount,feeDU.amount,0.00)) AS amountDrUsd,
|
|
|
- SUM(IF(feeDU.stl_ttl_amount,feeDU.stl_ttl_amount,0.00)) AS realAmountDrUsd,
|
|
|
- SUM(IF(feeDC.amount,feeDC.amount,0.00)) AS amountDr,
|
|
|
- SUM(IF(feeDC.stl_ttl_amount,feeDC.stl_ttl_amount,0.00)) AS realAmountDr,
|
|
|
- SUM(IF(feeCU.amount,feeCU.amount,0.00)) AS amountCrUsd,
|
|
|
- SUM(IF(feeCU.stl_ttl_amount,feeCU.stl_ttl_amount,0.00)) AS realAmountCrUsd,
|
|
|
- SUM(IF(feeCC.amount,feeCC.amount,0.00)) AS amountCr,
|
|
|
- SUM(IF(feeCC.stl_ttl_amount,feeCC.stl_ttl_amount,0.00)) AS realAmountCr,
|
|
|
- seb.amount_profit_loc AS amountProfitLoc
|
|
|
+ seb.bill_type AS billType,
|
|
|
+ seb.bill_no AS billNo,
|
|
|
+ seb.hblno AS hBlNo,
|
|
|
+ seb.mblno AS mBlNo,
|
|
|
+ seb.corp_cn_name AS corpName,
|
|
|
+ seb.bill_type AS statisticsDate,
|
|
|
+ seb.src_cn_name AS salesman,
|
|
|
+ seb.pod_cn_name AS pod,
|
|
|
+ seb.pol_cn_name AS pol,
|
|
|
+ seb.vessel_cn_name AS vesselCnName,
|
|
|
+ seb.voyage_no AS voyageNo,
|
|
|
+ seb.acc_dept_name AS accDeptName,
|
|
|
+ seb.line_cn_name AS lineCnName,
|
|
|
+ seb.carrier_cn_name AS carrierCnName,
|
|
|
+ seb.operator_name AS operatorName,
|
|
|
+ SUM(IF(feeDU.amount,feeDU.amount,0.00)) AS amountDrUsd,
|
|
|
+ SUM(IF(feeDU.stl_ttl_amount,feeDU.stl_ttl_amount,0.00)) AS realAmountDrUsd,
|
|
|
+ SUM(IF(feeDC.amount,feeDC.amount,0.00)) AS amountDr,
|
|
|
+ SUM(IF(feeDC.stl_ttl_amount,feeDC.stl_ttl_amount,0.00)) AS realAmountDr,
|
|
|
+ SUM(IF(feeCU.amount,feeCU.amount,0.00)) AS amountCrUsd,
|
|
|
+ SUM(IF(feeCU.stl_ttl_amount,feeCU.stl_ttl_amount,0.00)) AS realAmountCrUsd,
|
|
|
+ SUM(IF(feeCC.amount,feeCC.amount,0.00)) AS amountCr,
|
|
|
+ SUM(IF(feeCC.stl_ttl_amount,feeCC.stl_ttl_amount,0.00)) AS realAmountCr,
|
|
|
+ seb.amount_profit_loc AS amountProfitLoc
|
|
|
FROM
|
|
|
- los_sea_bills seb
|
|
|
+ los_sea_bills seb
|
|
|
LEFT JOIN los_fee_center feeCC ON seb.id = feeCC.pid
|
|
|
AND feeCC.dc = 'C' and feeCC.cur_code = 'CNY' AND feeCC.is_deleted = '0'
|
|
|
LEFT JOIN los_fee_center feeCU ON seb.id = feeCU.pid
|
|
|
@@ -728,9 +791,9 @@
|
|
|
LEFT JOIN los_fee_center feeDU ON seb.id = feeDU.pid
|
|
|
AND feeDU.dc = 'D' and feeDU.cur_code = 'USD' AND feeDU.is_deleted = '0'
|
|
|
WHERE
|
|
|
- seb.is_deleted = '0'
|
|
|
+ seb.is_deleted = '0'
|
|
|
<if test="data.billType != null and data.billType != ''">
|
|
|
- and find_in_set(seb.bill_type,#{data.billType})
|
|
|
+ and find_in_set(seb.business_type,#{data.billType})
|
|
|
</if>
|
|
|
<if test="data.billNo != null and data.billNo != ''">
|
|
|
and seb.bill_no like concat('%', #{data.billNo}, '%')
|
|
|
@@ -751,7 +814,7 @@
|
|
|
and seb.voyage_no = #{data.voyageNo}
|
|
|
</if>
|
|
|
<if test='data.accDeptId != null'>
|
|
|
- and seb.acc_dept_id = #{data.accDeptId}
|
|
|
+ and seb.acc_dept = #{data.accDeptId}
|
|
|
</if>
|
|
|
<if test='data.lineId != null'>
|
|
|
and seb.line_id = #{data.lineId}
|
|
|
@@ -773,7 +836,7 @@
|
|
|
and seb.approved_date >= #{data.statisticsDateStart}
|
|
|
</if>
|
|
|
<if test='data.statisticsDateEnd != null and data.statisticsDateEnd != null'>
|
|
|
- and seb.approved_date <= #{data.statisticsDateStart}
|
|
|
+ and seb.approved_date <= #{data.statisticsDateEnd}
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="data.examineDate == null or data.examineDate == ''">
|
|
|
@@ -781,7 +844,7 @@
|
|
|
and seb.bill_date >= #{data.statisticsDateStart}
|
|
|
</if>
|
|
|
<if test='data.statisticsDateEnd != null and data.statisticsDateEnd != null'>
|
|
|
- and seb.bill_date <= #{data.statisticsDateStart}
|
|
|
+ and seb.bill_date <= #{data.statisticsDateEnd}
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="data.costMerge != null and data.costMerge != ''">
|
|
|
@@ -789,69 +852,7 @@
|
|
|
seb.bill_no
|
|
|
</if>
|
|
|
ORDER BY
|
|
|
- seb.create_time
|
|
|
- </select>
|
|
|
- <select id="trend" resultType="java.util.Map">
|
|
|
- SELECT
|
|
|
- m.id moon,
|
|
|
- IFNULL( n.money, 0 ) money
|
|
|
- FROM
|
|
|
- (
|
|
|
- SELECT
|
|
|
- 1 AS id UNION
|
|
|
- SELECT
|
|
|
- 2 UNION
|
|
|
- SELECT
|
|
|
- 3 UNION
|
|
|
- SELECT
|
|
|
- 4 UNION
|
|
|
- SELECT
|
|
|
- 5 UNION
|
|
|
- SELECT
|
|
|
- 6 UNION
|
|
|
- SELECT
|
|
|
- 7 UNION
|
|
|
- SELECT
|
|
|
- 8 UNION
|
|
|
- SELECT
|
|
|
- 9 UNION
|
|
|
- SELECT
|
|
|
- 10 UNION
|
|
|
- SELECT
|
|
|
- 11 UNION
|
|
|
- SELECT
|
|
|
- 12
|
|
|
- ) m
|
|
|
- LEFT JOIN (
|
|
|
- SELECT
|
|
|
- DATE_FORMAT( sea.bill_date, '%m' ) AS moon,
|
|
|
- ROUND( IFNULL( SUM( pre.TEU * pre.quantity ), 0 ), 2 ) AS money
|
|
|
- FROM
|
|
|
- los_sea_bills sea
|
|
|
- LEFT JOIN los_sea_pre_containers pre ON sea.id = pre.pid
|
|
|
- WHERE
|
|
|
- sea.is_deleted = 0
|
|
|
- AND pre.is_deleted = 0
|
|
|
- <if test="deptPid!=null">
|
|
|
- AND sea.branch_id = #{deptPid}
|
|
|
- </if>
|
|
|
- <if test="postId!=null and postId != ''">
|
|
|
- AND find_in_set(sea.team_id,#{postId})
|
|
|
- </if>
|
|
|
- <if test="tenantId!=null and tenantId != ''">
|
|
|
- AND sea.tenant_id = #{tenantId}
|
|
|
- </if>
|
|
|
- <if test="date==null or date == ''">
|
|
|
- AND YEAR ( sea.bill_date ) = YEAR (NoW())
|
|
|
- </if>
|
|
|
- <if test="date!=null and date != ''">
|
|
|
- AND YEAR ( sea.bill_date ) = #{date}
|
|
|
- </if>
|
|
|
- GROUP BY
|
|
|
- DATE_FORMAT( sea.bill_date, '%m' )
|
|
|
- ) n ON m.id = n.moon
|
|
|
- ORDER BY
|
|
|
- m.id
|
|
|
+ seb.create_time
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|