|
@@ -132,23 +132,79 @@
|
|
|
AND (DATE_FORMAT(w.in_out_date,"%Y%m%d") <=
|
|
|
DATE_FORMAT(#{endDate},"%Y%m%d"))
|
|
|
</if>
|
|
|
+ UNION ALL
|
|
|
+ SELECT
|
|
|
+ c.comp_name as compName,
|
|
|
+ w.warehouse_name as warehouseName,
|
|
|
+ w.bin_number as binNumber,
|
|
|
+ w.create_date as createDate,
|
|
|
+ w.contract_no as contractNo,
|
|
|
+ '' as paymentNo,
|
|
|
+ '' as customerName,
|
|
|
+ '' as supplier,
|
|
|
+ w.goods_name as goodsName,
|
|
|
+ case when w.goods_name = '玉米(潮粮)' then '潮粮' else '干粮' end as type,
|
|
|
+ w.grade as grade,
|
|
|
+ d.water_content as waterContent,
|
|
|
+ d.impurity as impurity,
|
|
|
+ w.car_no as carNo,
|
|
|
+ w.box_no as boxNo,
|
|
|
+ w.box_no_other as boxNoOther,
|
|
|
+ w.title_no as titleNo,
|
|
|
+ w.title_no_other as titleNoOther,
|
|
|
+ 0 as netWeightPrice,
|
|
|
+ w.gross_weight as grossWeight,
|
|
|
+ w.tare as tare,
|
|
|
+ w.deduction_weight as buckleWeight,
|
|
|
+ w.net_weight as netWeight,
|
|
|
+ '' as unitDeduction,
|
|
|
+ '' as pureWeightPrice,
|
|
|
+ w.pure_weight as pureWeight,
|
|
|
+ 0 as amountIngPayable,
|
|
|
+ 0 as amountEdPayable,
|
|
|
+ '' as payeeName,
|
|
|
+ '' as cardNo,
|
|
|
+ '' as bankDeposit,
|
|
|
+ '' as bankDepositBranch
|
|
|
+ FROM warehouse_in_out_info w
|
|
|
+ left join warehouse_in_out_detail d on w.id=d.info_id and d.delete_flag = 0
|
|
|
+ left join stock_purchase_receipt_report s on s.warehouse_record_id=w.id and s.delete_flag = 0
|
|
|
+ left join warehouse_base_info b on b.id=w.base_id and b.delete_flag = 0
|
|
|
+ left join common_company c on c.comp_id = b.comp_id and c.delete_flag = 0
|
|
|
+ WHERE w.delete_flag = '0'
|
|
|
+ AND b.comp_id = #{compId}
|
|
|
+ and w.in_out_flag = 2
|
|
|
+ and w.in_out_type='移库入库'
|
|
|
+ and w.status_flag=3
|
|
|
+ and s.id is null
|
|
|
+ <if test="warehouseName != null and warehouseName != ''">
|
|
|
+ AND w.warehouse_name= #{warehouseName}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null">
|
|
|
+ AND (DATE_FORMAT(w.in_out_date,"%Y%m%d") >=
|
|
|
+ DATE_FORMAT(#{startDate},"%Y%m%d"))
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null">
|
|
|
+ AND (DATE_FORMAT(w.in_out_date,"%Y%m%d") <=
|
|
|
+ DATE_FORMAT(#{endDate},"%Y%m%d"))
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<!-- 获得出库导出列表 -->
|
|
|
<select id="getListByConditionOut" parameterType="Map"
|
|
|
resultType="com.yh.saas.plugin.yiliangyiyun.entity.view.ExportVView">
|
|
|
SELECT
|
|
|
- m.seller as compName,
|
|
|
+ '' as compName,
|
|
|
w.warehouse_name as warehouseName,
|
|
|
w.bin_number as binNumber,
|
|
|
w.create_date as createDate,
|
|
|
cm.cost as costPrice,
|
|
|
w.contract_no as contractNo,
|
|
|
- m.buyer as customerName,
|
|
|
- g.goods_name as goodsName,
|
|
|
- case when g.goods_name = '玉米(潮粮)' then '潮粮' else '干粮' end as type,
|
|
|
- g.grade as grade,
|
|
|
- g.water_content as waterContent,
|
|
|
- g.impurity as impurity,
|
|
|
+ '' as customerName,
|
|
|
+ w.goods_name as goodsName,
|
|
|
+ case when w.goods_name = '玉米(潮粮)' then '潮粮' else '干粮' end as type,
|
|
|
+ w.grade as grade,
|
|
|
+ d.water_content as waterContent,
|
|
|
+ d.impurity as impurity,
|
|
|
w.car_no as carNo,
|
|
|
w.box_no as boxNo,
|
|
|
w.box_no_other as boxNoOther,
|
|
@@ -157,8 +213,8 @@
|
|
|
w.wing_number as wingNumber,
|
|
|
w.ship_number as shipNumber,
|
|
|
w.ship_name as shipName,
|
|
|
- m.unit_contract_price as unitContractPrice,
|
|
|
- m.weight as weight,
|
|
|
+ 0 as unitContractPrice,
|
|
|
+ 0 as weight,
|
|
|
w.gross_weight as grossWeight,
|
|
|
w.tare as tare,
|
|
|
'' as contractStatus,
|
|
@@ -177,10 +233,10 @@
|
|
|
w.net_weight as netWeight
|
|
|
FROM warehouse_in_out_info w
|
|
|
left join cost_management_info cm on cm.warehouse_id = w.base_id and cm.goods_name = w.goods_name and cm.delete_flag = 0
|
|
|
- left join contract_management_info m on m.contract_no = w.contract_no and m.delete_flag = 0
|
|
|
- left join contract_goods_info g on m.id=g.contract_id and g.delete_flag = 0
|
|
|
+ left join warehouse_in_out_detail d on w.id=d.info_id and d.delete_flag = 0
|
|
|
+ left join warehouse_base_info b on b.id=w.base_id and b.delete_flag = 0
|
|
|
WHERE w.delete_flag = '0'
|
|
|
- AND m.comp_id = #{compId}
|
|
|
+ AND b.comp_id = #{compId}
|
|
|
and w.in_out_flag = 1
|
|
|
and w.in_out_type='移库出库'
|
|
|
and w.status_flag=3
|