0 union select max(r.departcoding) as coding,r.depart as depart,sum(-i.materialAmount) as amount,sum(-i.amount*i.fluctuationPrice) as price 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="579" height="30"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="宋体" size="16" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$P{title}]]></textFieldExpression> </textField> </band>