|
|
@@ -472,6 +472,87 @@
|
|
|
order by bo.busines_date
|
|
|
</select>
|
|
|
|
|
|
+ <select id="sumMoneyNumber" parameterType="com.trade.purchase.order.vo.OrderTotalDTO" resultType= "map">
|
|
|
+ SELECT
|
|
|
+ ifnull( sum(boi.balance_number), 0 ) as balanceNumber,
|
|
|
+ ifnull( sum(boi.balance_money), 0 ) as balanceMoney
|
|
|
+ FROM
|
|
|
+ business_order bo
|
|
|
+ LEFT JOIN business_order_items boi ON boi.pid = bo.id
|
|
|
+ LEFT JOIN basic_storage_type bst ON bo.storage_id = bst.id
|
|
|
+ LEFT JOIN basic_storage_desc bsc ON boi.storage_id = bsc.id
|
|
|
+ LEFT JOIN basic_goods_desc bgd ON boi.item_id = bgd.id
|
|
|
+ LEFT JOIN basic_corps_desc bcd ON bo.corp_id = bcd.id
|
|
|
+ LEFT JOIN basic_corps_desc bcd1 ON bo.purchaser_id = bcd1.id
|
|
|
+ WHERE
|
|
|
+ boi.is_deleted = 0
|
|
|
+ AND bo.is_deleted = 0
|
|
|
+ and bo.trade_type = 'JTMC'
|
|
|
+ AND boi.bill_type = 'RK'
|
|
|
+ <if test="Order.sysNo!=null and Order.sysNo != ''">
|
|
|
+ and bo.sys_no=#{Order.sysNo}
|
|
|
+ </if>
|
|
|
+ <if test="Order.morderNo!=null and Order.morderNo != ''">
|
|
|
+ and bo.bill_no = #{Order.morderNo}
|
|
|
+ </if>
|
|
|
+ <if test="Order.businesStartDate!=null">
|
|
|
+ and bo.busines_date > #{businesStartDate}
|
|
|
+ </if>
|
|
|
+ <if test="Order.businesEndDate!=null">
|
|
|
+ and bo.busines_date <= #{businesEndDate}
|
|
|
+ </if>
|
|
|
+ <if test="Order.corpId!=null">
|
|
|
+ and bo.corp_id=#{Order.corpId}
|
|
|
+ </if>
|
|
|
+ <if test="Order.billNo!=null and Order.billNo != ''">
|
|
|
+ and boi.bill_no like CONCAT(CONCAT('%', #{Order.billNo}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="Order.purchaserId!=null">
|
|
|
+ and bo.purchaser_id = #{Order.purchaserId}
|
|
|
+ </if>
|
|
|
+ <if test="Order.warehouseId!=null">
|
|
|
+ and bo.storage_id = #{Order.warehouseId}
|
|
|
+ </if>
|
|
|
+ <if test="Order.tenantId!=null and Order.tenantId != ''">
|
|
|
+ and bo.tenant_id = #{Order.tenantId}
|
|
|
+ </if>
|
|
|
+ <if test="Order.itemId!=null and Order.itemId != ''">
|
|
|
+ and boi.item_id = #{Order.itemId}
|
|
|
+ </if>
|
|
|
+ <if test="Order.length!=null and Order.length != ''">
|
|
|
+ and boi.length = #{Order.length}
|
|
|
+ </if>
|
|
|
+ <if test="Order.width!=null and Order.width != ''">
|
|
|
+ and boi.width = #{Order.width}
|
|
|
+ </if>
|
|
|
+ <if test="Order.thickness!=null and Order.thickness != ''">
|
|
|
+ and boi.thickness = #{Order.thickness}
|
|
|
+ </if>
|
|
|
+ <if test="Order.vehicleShipNumber!=null and Order.vehicleShipNumber != ''">
|
|
|
+ and bo.vehicle_ship_number like CONCAT(CONCAT('%', #{Order.vehicleShipNumber}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="Order.itemType!=null and Order.itemType != ''">
|
|
|
+ and boi.item_type=#{Order.itemType}
|
|
|
+ </if>
|
|
|
+ <if test="Order.grade!=null and Order.grade != ''">
|
|
|
+ and boi.grade = #{Order.grade}
|
|
|
+ </if>
|
|
|
+ <if test="Order.storageId!=null">
|
|
|
+ and boi.storage_id = #{Order.storageId}
|
|
|
+ </if>
|
|
|
+ <if test="Order.unit!=null and Order.unit != ''">
|
|
|
+ and boi.unit = #{Order.unit}
|
|
|
+ </if>
|
|
|
+ <if test="Order.isIssue!=null and Order.isIssue != ''">
|
|
|
+ and boi.is_Issue = #{Order.isIssue}
|
|
|
+ </if>
|
|
|
+ <if test="Order.containerNo!=null and Order.containerNo != ''">
|
|
|
+ and boi.container_no = #{Order.containerNo}
|
|
|
+ </if>
|
|
|
+ <if test="Order.isIssue == null and Order.isIssue == ''">
|
|
|
+ and (boi.is_Issue = '3' or boi.is_Issue = '4' or boi.is_Issue = '5' or boi.is_Issue = '6')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
<select id="generalLedgerListByGoods" parameterType="String" resultType="java.util.Map">
|
|
|
SELECT boi.item_id AS id,
|