|
@@ -221,5 +221,161 @@
|
|
|
where TWR.RESULT_TOTAL_ID = #{resultTotalId} and TWR.TARE_SEGMENT_SQE = #{segmentSqe}
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+ <select id="getInputOrderList" parameterType="java.util.Map" resultType="java.util.Map" >
|
|
|
+ select
|
|
|
+ *
|
|
|
+ from
|
|
|
+ (
|
|
|
+ select
|
|
|
+ OO.ORDER_ID "orderId",
|
|
|
+ APO.PURCHASE_ORDER_ID "purchaseOrderId",
|
|
|
+ AP.PLAN_ID "planId",
|
|
|
+ APO.PURCHASE_ORDER_NO "purchaseOrderNo",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ AP.PLAN_NO "planNo",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ RC.CAPACITY_ID "capacityId",
|
|
|
+ OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
|
|
|
+ to_char(AP.PLAN_TRUCK_TIME, 'yyyy-mm-dd')"planTruckTime",
|
|
|
+ to_char(AP.PLAN_INCOMING_TIME, 'yyyy-mm-dd') "planIncomingTime",
|
|
|
+ OO.INSERT_USERNAME "insertUsername",
|
|
|
+ OO.INSERT_TIME "insertTime",
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RW.WAREHOUSE_NAME "warehouseName", --卸货点
|
|
|
+ to_char(OO.ORDER_ENTRY_TIME, 'yyyy-mm-dd') "orderEntryTime", --进厂时间
|
|
|
+ RS.SUPPLIER_NAME "supplierName", --发货单位
|
|
|
+ RCSE.CONSIGNEE_COMPANY_NAME "consigneeCompanyName", --收货单位,
|
|
|
+ OO.ORDER_ISSUE_TIME "orderIssueTime"
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ left join AMS_PURCHASE_ORDER APO
|
|
|
+ on OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
|
|
|
+ left join AMSTRUCK_PURPLAN AP
|
|
|
+ on AP.BATCH_ID = APO.BATCH_ID and AP.PLAN_STATUS != 3
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = OO.CAPACITY_ID
|
|
|
+ left join OMSTRUCK_ORDER_MATERIAL OOM
|
|
|
+ on OOM.ORDER_ID = OO.ORDER_ID
|
|
|
+ left join RMS_MATERIAL RM
|
|
|
+ on RM.MATERIAL_ID = OOM.MATERIAL_ID
|
|
|
+ left join RMS_WAREHOUSE RW
|
|
|
+ on OO.UNLOAD_POINT_ID = RW.WAREHOUSE_ID
|
|
|
+ left join RMS_SUPPLIER RS
|
|
|
+ on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
|
|
|
+ left join RMS_CONSIGNEE RCSE
|
|
|
+ on APO.RECEIVE_UNIT_ID = RCSE.CONSIGNEE_ID
|
|
|
+ <where>
|
|
|
+ <choose>
|
|
|
+ <when test="orderStatus != 8">
|
|
|
+ and OO.ORDER_STATUS = #{orderStatus}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and OO.ORDER_STATUS in (0, 1, 2, 4, 5, 6)
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ <if test="carrierId != null ">
|
|
|
+ and AP.CARRIER_ID = #{carrierId}
|
|
|
+ </if>
|
|
|
+ <if test="orderType != null">
|
|
|
+ and OO.ORDER_TYPE = #{orderType}
|
|
|
+ </if>
|
|
|
+ <if test="orderType != null">
|
|
|
+ and OO.ORDER_TYPE in (6, 7)
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="materialName != null">
|
|
|
+ <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
+ "materialName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderMaterialWeight != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderMaterialWeight" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="planNo != null">
|
|
|
+ and
|
|
|
+ <foreach collection="planNo" item="item" open="(" separator="or" close=")">
|
|
|
+ "planNo" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="planTruckTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="planTruckTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "planTruckTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="planIncomingTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="planIncomingTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "planIncomingTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="insertUsername != null">
|
|
|
+ and
|
|
|
+ <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
|
|
|
+ "insertUsername" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="insertTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "insertTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="warehouseName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
|
|
|
+ "warehouseName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderEntryTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderEntryTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderEntryTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="supplierName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
|
|
|
+ "supplierName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="consigneeCompanyName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
|
|
|
+ "consigneeCompanyName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy">
|
|
|
+ </include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "insertTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
+ <sql id="orderBy">
|
|
|
+ <if test="orderField != null and orderField != ''">
|
|
|
+ order by "${orderField}"
|
|
|
+ <if test="orderType != null and orderType != ''">
|
|
|
+ ${orderType}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
</mapper>
|