这个是我要的效果,你要的数据源是什么啊?SQL么?下面是SQL。
SELECT
a.doccode as 对账单guid,
a.paynotedoccode as 对账单号,
a.relationguid as 结算对象guid,
a.invoicetitleguid as **抬头guid,
b.feetype as 费用代码,
b.totalmoney as 金额,
c.blcode AS m主提单号,
c.destinationportname AS 目的港,
to_char(c.etddate, 'yyyy-mm-dd'::text) AS etd2,
d.previousmemo::jsonb->> 'cltmemo'::text as **号,
d.othermemo::jsonb->> 'cltmemo'::text as 净重,
( SELECT bbb.container
FROM ( SELECT array_to_string(array_agg(((aaa.digit || '*'::text) || aaa.containercode)), ','::text) AS container,
aaa.doccode
FROM ( SELECT (json_array_elements((u.containerinfojson)::json) ->> 'basedigit'::text) AS digit,
(json_array_elements((u.containerinfojson)::json) ->> 'containercode'::text) AS containercode,
u.doccode
FROM doc_hdworkdochd u
ORDER BY (json_array_elements((u.containerinfojson)::json) ->> 'containercode'::text)) aaa
WHERE (COALESCE(aaa.containercode, ''::text) <> ''::text)
GROUP BY aaa.doccode) bbb
WHERE ((bbb.doccode)::text = (d.doccode)::text)) AS 配箱信息
from doc_paynote a
LEFT JOIN doc_hdworksettlehd b on b.balancefeecode=a.doccode
LEFT JOIN doc_hdworkdochd c on c.doccode=b.workdoccode
LEFT JOIN doc_hdentrustdochd d on d.maindoccode=c.doccode
where a.doccode=?
|