0 union select max(r.departcoding) as coding,r.depart as depart,sum(-i.amount) as amount,sum(-i.amount*i.price) as price,0 as goodsAmount2,0 as goodsPrice2,0 as goodsAmount3,0 as goodsPrice3,0 as goodsAmount4,0 as goodsPrice4 from ReturnGoodsRecord r,ReturnGoodsItem i where r.id = i.returngoodsrecord_id and r.type = '一次性物品' $P!{returnGoodsSql} group by r.depart )endTable group by endTable.depart order by coding asc]]> <band height="35" splitType="Stretch"> <textField> <reportElement uuid="eaa09313-0e2c-4c09-9d46-b37fe79b3884" x="0" y="5" width="745" height="30"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="宋体" size="16" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$P{title}]]></textFieldExpression> </textField> </band>