|
@@ -254,18 +254,13 @@
|
|
select
|
|
select
|
|
a.id,
|
|
a.id,
|
|
a.delivery_id,
|
|
a.delivery_id,
|
|
- a.entry_number,
|
|
|
|
a.material_id,
|
|
a.material_id,
|
|
a.wbs,
|
|
a.wbs,
|
|
- a.measurement_id,
|
|
|
|
a.gs_delivery_num,
|
|
a.gs_delivery_num,
|
|
a.gs_cancel_num,
|
|
a.gs_cancel_num,
|
|
- a.out_num,
|
|
|
|
|
|
+ ifnull(a.out_num, 0) as out_num,
|
|
b.company_number,
|
|
b.company_number,
|
|
b.bills_time,
|
|
b.bills_time,
|
|
- b.delivery_type,
|
|
|
|
- b.source_type,
|
|
|
|
- b.move_type,
|
|
|
|
c.name as materialName,
|
|
c.name as materialName,
|
|
c.code as materialCode
|
|
c.code as materialCode
|
|
from tld_delivery a
|
|
from tld_delivery a
|
|
@@ -291,6 +286,119 @@
|
|
</select>
|
|
</select>
|
|
<!-- 导出销售单 -->
|
|
<!-- 导出销售单 -->
|
|
<select id="getDeliveryExcel" resultType="java.util.LinkedHashMap">
|
|
<select id="getDeliveryExcel" resultType="java.util.LinkedHashMap">
|
|
-
|
|
|
|
|
|
+ select
|
|
|
|
+ a.delivery_id,
|
|
|
|
+ a.material_id,
|
|
|
|
+ a.wbs,
|
|
|
|
+ a.gs_delivery_num,
|
|
|
|
+ a.gs_cancel_num,
|
|
|
|
+ a.out_num,
|
|
|
|
+ b.company_number,
|
|
|
|
+ b.bills_time,
|
|
|
|
+ c.name as materialName,
|
|
|
|
+ c.code as materialCode
|
|
|
|
+ from tld_delivery a
|
|
|
|
+ join tld_delivery_f b on a.delivery_id = b.delivery_id
|
|
|
|
+ join tld_material c on a.material_id = c.tld_id
|
|
|
|
+ <trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
|
+ <if test="deliveryId != null and deliveryId != ''">
|
|
|
|
+ and a.delivery_id = #{deliveryId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="materialCode != null and materialCode != ''">
|
|
|
|
+ and c.code like CONCAT(CONCAT('%', #{materialCode}), '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="materialName != null and materialName != ''">
|
|
|
|
+ and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
|
+ and a.bills_time <![CDATA[>=]]> #{startTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
|
+ and a.bills_time <![CDATA[<=]]> #{endTime}
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ </select>
|
|
|
|
+ <!-- 查询移库单 -->
|
|
|
|
+ <select id="getWarehouseTransfer" resultType="com.tld.model.WarehouseTransfer">
|
|
|
|
+ select
|
|
|
|
+ a.id,
|
|
|
|
+ a.warehouse_transfer_id,
|
|
|
|
+ a.entry_number,
|
|
|
|
+ a.supply_warehouse_id,
|
|
|
|
+ a.material_id,
|
|
|
|
+ a.wbs,
|
|
|
|
+ a.num,
|
|
|
|
+ a.out_num,
|
|
|
|
+ a.type,
|
|
|
|
+ b.warehouse_transfer_code,
|
|
|
|
+ b.ask_goods_warehouse_id,
|
|
|
|
+ b.document_time,
|
|
|
|
+ b.warehouse_transfer_type,
|
|
|
|
+ c.name as materialName,
|
|
|
|
+ c.code as materialCode,
|
|
|
|
+ f.name as askGoodsWarehouseaName,
|
|
|
|
+ e.name as supplyWarehouseName
|
|
|
|
+ from tld_warehouse_transfer a
|
|
|
|
+ join tld_warehouse_transfer_f b on a.warehouse_transfer_id = b.warehouse_transfer_id
|
|
|
|
+ join tld_material c on a.material_id = c.tld_id
|
|
|
|
+ join tld_warehouse e on a.supply_warehouse_id = e.tld_id
|
|
|
|
+ join tld_warehouse f on a.ask_goods_warehouse_id = f.tld_id
|
|
|
|
+ <trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
|
+ <if test="type != null and type != ''">
|
|
|
|
+ and a.type = #{type}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="materialCode != null and materialCode != ''">
|
|
|
|
+ and c.code like CONCAT(CONCAT('%', #{materialCode}), '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="materialName != null and materialName != ''">
|
|
|
|
+ and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
|
+ and a.document_time <![CDATA[>=]]> #{startTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
|
+ and a.document_time <![CDATA[<=]]> #{endTime}
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ </select>
|
|
|
|
+ <!-- 移库单导出 -->
|
|
|
|
+ <select id="getWarehouseTransferExcel" resultType="java.util.LinkedHashMap">
|
|
|
|
+ select
|
|
|
|
+ a.warehouse_transfer_id,
|
|
|
|
+ b.warehouse_transfer_code,
|
|
|
|
+ a.material_id,
|
|
|
|
+ c.name as materialName,
|
|
|
|
+ c.code as materialCode,
|
|
|
|
+ a.wbs,
|
|
|
|
+ a.num,
|
|
|
|
+ a.out_num,
|
|
|
|
+ b.ask_goods_warehouse_id,
|
|
|
|
+ a.supply_warehouse_id,
|
|
|
|
+ f.name as askGoodsWarehouseaName,
|
|
|
|
+ e.name as supplyWarehouseName,
|
|
|
|
+ b.document_time,
|
|
|
|
+ a.type
|
|
|
|
+ from tld_warehouse_transfer a
|
|
|
|
+ join tld_warehouse_transfer_f b on a.warehouse_transfer_id = b.warehouse_transfer_id
|
|
|
|
+ join tld_material c on a.material_id = c.tld_id
|
|
|
|
+ join tld_warehouse e on a.supply_warehouse_id = e.tld_id
|
|
|
|
+ join tld_warehouse f on a.ask_goods_warehouse_id = f.tld_id
|
|
|
|
+ <trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
|
+ <if test="type != null and type != ''">
|
|
|
|
+ and a.type = #{type}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="materialCode != null and materialCode != ''">
|
|
|
|
+ and c.code like CONCAT(CONCAT('%', #{materialCode}), '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="materialName != null and materialName != ''">
|
|
|
|
+ and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
|
+ and a.document_time <![CDATA[>=]]> #{startTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
|
+ and a.document_time <![CDATA[<=]]> #{endTime}
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
</select>
|
|
</select>
|
|
</mapper>
|
|
</mapper>
|