|
|
@@ -91,4 +91,29 @@
|
|
|
|
|
|
(select concat('{"x":',DATE_FORMAT(date_sub(now(),interval 5 MONTH),'%c'),',"sale":',ifnull(ROUND(sum((ifnull(si_amount/10000,0))),2),'0'),',"saleback":',ifnull(ROUND(sum((ifnull(si_amount_rec/10000,0))),2),'0'),'}') d6 from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(date_sub(now(),interval 5 MONTH),'%Y%m') and si_type='SALERETURN' ORDER BY si_amount desc)data_6)
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getKeyData" parameterType="long" resultType="string">
|
|
|
+ select concat('{"storageTotal":',storageTotal,',"receiveTotal":',receiveTotal,',"payTotal":',payTotal,',"balanceTotal":',balanceTotal,'}') from (
|
|
|
+ #库存总额:
|
|
|
+ (
|
|
|
+ SELECT ifnull(storage_,0) storageTotal from (
|
|
|
+ select sum(ifnull(po_amount,0)) storage_ from productonhand where companyid=#{componyId})a
|
|
|
+ ) a1,
|
|
|
+ #应收总额
|
|
|
+ (
|
|
|
+ select ifnull(receive_,0) receiveTotal from (
|
|
|
+ select sum(ifnull(cu_leftamount,0)) receive_ from customer where companyid=#{componyId}) b
|
|
|
+ )b1,
|
|
|
+ #应付总额
|
|
|
+ (
|
|
|
+ select ifnull(pay_,0) payTotal from (
|
|
|
+ select sum(ifnull(ve_leftamount,0)) pay_ from vendor where companyId=#{componyId}) c
|
|
|
+ )c1,
|
|
|
+ #账户余额
|
|
|
+ (
|
|
|
+ select ifnull(balance_,0) balanceTotal from (
|
|
|
+ select sum(ifnull(bk_thisamount,0)) balance_ from bankinformation where companyid=#{componyId})d
|
|
|
+ )d1
|
|
|
+ );
|
|
|
+ </select>
|
|
|
</mapper>
|