select wgb.warehouse_id,wgb.saleorder_code,wgb.product_id,mso.order_amount,wgb.total_amount,wgb.frozen_amount,wgb.occupy_amount,wbw.warehouse_name,mbmi.material_code,mbmi.material_name from mes_sale_order mso left join
(select wps.warehouse_id,wps.saleorder_code,wps.product_id,sum(total_amount) total_amount,sum(frozen_amount) frozen_amount,sum(occupy_amount) occupy_amount from wms_product_stock wps where wps.total_amount>0 and wps.stock_type='3'
@ -294,9 +298,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insertid="batchWmsRawOutstock">
insert into wms_raw_outstock(raw_outstock_id, task_code,warehouse_id,location_code,order_id,plan_code,plan_detail_code,station_id,material_id,material_batch,pallet_info_code,outstock_amount,end_station_code,operation_type,task_type,audit_status,execute_status,apply_by,apply_date,apply_reason) values
insert into wms_raw_outstock(raw_outstock_id, task_code,warehouse_id,location_code,stock_total_id,order_id,plan_code,plan_detail_code,station_id,material_id,material_batch,pallet_info_code,outstock_amount,end_station_code,operation_type,task_type,audit_status,execute_status,apply_by,apply_date,apply_reason) values
@ -255,7 +255,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<iftest="applyReason != null and applyReason != ''"> and wrr.apply_reason like concat('%', #{applyReason}, '%')</if>
<iftest="auditReason != null and auditReason != ''"> and wrr.audit_reason like concat('%', #{auditReason}, '%')</if>
<iftest="auditStatus != null and auditStatus != ''"> and wrr.audit_status = #{auditStatus}</if>
<iftest="executeStatus != null and executeStatus != ''"> and wrr.execute_status = #{executeStatus}</if>
<iftest="executeStatus != null and executeStatus != '' and executeStatus != 'notFinish'"> and wrr.execute_status = #{executeStatus}</if>
<iftest="executeStatus != null and executeStatus != '' and executeStatus == 'notFinish'"> and (wrr.execute_status = '0' or wrr.execute_status = '1')</if>
<iftest="applyBy != null and applyBy != ''"> and wrr.apply_by like concat('%', #{applyBy}, '%')</if>
<iftest="auditStatus != null and auditStatus != ''"> and wrr.audit_status = #{auditStatus}</if>