Bläddra i källkod

修改建议2021年12月1日09:07:25

txf 3 år sedan
förälder
incheckning
121cd8f37f

+ 2 - 2
pom.xml

@@ -111,8 +111,8 @@
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-                        <param>AMSTRUCK_INWARD_REQUIREMENT</param><!--销售计划-->
-<!--                        <param>AMS_SALE_PLAN_MATERIAL</param>&lt;!&ndash;销售计划物资中间表&ndash;&gt;-->
+<!--                        <param>AMSTRUCK_INWARD_REQUIREMENT</param>&lt;!&ndash;销售计划&ndash;&gt;-->
+<!--                        <param>AMSTRUCK_INWARD_REQUIREMENT</param>&lt;!&ndash;销售计划物资中间表&ndash;&gt;-->
 <!--                        <param>AMSTRUCK_RAIL_DAYPLAN</param>&lt;!&ndash;销售计划物资中间表&ndash;&gt;-->
 <!--                        <param>AMS_CONTRACT_TRANSPORT_PRICE</param>&lt;!&ndash;销售订单&ndash;&gt;-->
 <!--                        <param>AMS_SALE_ORDER_MATERIAL</param>&lt;!&ndash;销售订单车序号表&ndash;&gt;-->

+ 2 - 26
src/main/java/com/steerinfo/dil/controller/AmsSalePlanController.java

@@ -169,34 +169,10 @@ public class AmsSalePlanController extends BaseRESTfulController {
                                            Integer apiId,
                                            String con) {
 
-        //框计算
         if(con != null){
-            if(!"undefined".equals(con)){
-                //设置要查询的索引名称
-                String index="get_steel_material_list";
-                //获取查询结果
-                return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
-            }
+            mapValue.put("con", "%" + con + "%");
         }
-
-        List<Map<String, Object>> list = null;
-        //如果有条件查询则跳过初始化,和创建索引
-        if(mapValue.size() == 1){
-            //将查询结果存入索引中
-            list = amsSalePlanService.getAllSteelMaterialMes(mapValue);
-            Map<String, Object> map = new HashMap<>();
-            //添加索引
-            map.put("index","get_steel_material_list");
-            //添加id
-            map.put("indexId","steelMaterialId");
-            list.add(map);
-            //新建索引
-            esFeign.insertIndex(list);
-            //删除
-            list.remove(list.size()-1);
-        }
-        if(list == null)
-            list = amsSalePlanService.getAllSteelMaterialMes(mapValue);
+        List<Map<String, Object>> list = amsSalePlanService.getAllSteelMaterialMes(mapValue);
         PageHelper.startPage(pageNum,pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = amsSalePlanService.getAllSteelMaterialMes(mapValue);

+ 13 - 0
src/main/java/com/steerinfo/dil/controller/AmstruckInwardPlanController.java

@@ -59,6 +59,19 @@ public class AmstruckInwardPlanController extends BaseRESTfulController {
         return success(result);
 
     }
+
+    /**
+     * 完成运输计划
+     */
+    @PostMapping("/finishTruckPlan/{planId}")
+    public RESTfulResult finishTruckPlan(@PathVariable("planId") Integer planId){
+        AmstruckInwardPlan amstruckInwardPlan = new AmstruckInwardPlan();
+        amstruckInwardPlan.setPlanId(new BigDecimal(planId));
+        amstruckInwardPlan.setPlanStatus(new BigDecimal(4));
+        int i = amstruckInwardPlanService.updateTruckPlan(amstruckInwardPlan);
+        return success(i);
+    }
+
     /**
      * 修改运输计划
      */

+ 16 - 0
src/main/java/com/steerinfo/dil/model/AmstruckInwardRequirement.java

@@ -3,6 +3,7 @@ package com.steerinfo.dil.model;
 import com.steerinfo.framework.model.IBasePO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -140,6 +141,12 @@ public class AmstruckInwardRequirement implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="卸货点",required=false)
     private BigDecimal requirementUnloadUnitId;
 
+    /**
+     * 货位或月台(REQUIREMENT_PLATFORM_ID ,DECIMAL,0)
+     */
+    @ApiModelProperty(value="货位或月台",required=false)
+    private BigDecimal requirementPlatformId;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -328,6 +335,14 @@ public class AmstruckInwardRequirement implements IBasePO<BigDecimal> {
         this.requirementUnloadUnitId = requirementUnloadUnitId;
     }
 
+    public BigDecimal getRequirementPlatformId() {
+        return requirementPlatformId;
+    }
+
+    public void setRequirementPlatformId(BigDecimal requirementPlatformId) {
+        this.requirementPlatformId = requirementPlatformId;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -356,6 +371,7 @@ public class AmstruckInwardRequirement implements IBasePO<BigDecimal> {
         sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
         sb.append(", deleted=").append(deleted);
         sb.append(", requirementUnloadUnitId=").append(requirementUnloadUnitId);
+        sb.append(", requirementPlatformId=").append(requirementPlatformId);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 16 - 12
src/main/java/com/steerinfo/dil/service/impl/AmstruckInwardRequirementServiceImpl.java

@@ -60,16 +60,17 @@ public class AmstruckInwardRequirementServiceImpl extends BaseServiceImpl<Amstru
         Integer requiremntUnitId = (Integer) mapValue.get("requiremntUnitId");
         Integer requirementUnloadUnitId = (Integer) mapValue.get("requirementUnloadUnitId");
         String requirementOverlimit = (String) mapValue.get("requirementOverlimit");
-        String materialWeight = (String) mapValue.get("materialWeight");
-        String materialCount = (String) mapValue.get("materialNumber");
+        BigDecimal materialWeight = DataChange.dataToBigDecimal(mapValue.get("materialWeight"));
+        BigDecimal materialCount = DataChange.dataToBigDecimal(mapValue.get("materialNumber"));
         AmstruckInwardRequirement amstruckInwardRequirement = new AmstruckInwardRequirement();
         //设置主键
         BigDecimal requirementId = amstruckInwardRequirementMapper.selectOtherId();
         amstruckInwardRequirement.setRequirementId(requirementId);
-        DataChange dataChange=new DataChange();
-        amstruckInwardRequirement.setRequirementNumber(dataChange.generateEightDigitsNumber("YSXQ",amstruckInwardRequirementMapper.selectOtherId().intValue()));
+        amstruckInwardRequirement.setRequirementNumber(DataChange.generateEightDigitsNumber("YSXQ",amstruckInwardRequirementMapper.selectOtherId().intValue()));
         amstruckInwardRequirement.setRequirementStatus(new BigDecimal(0));
-        amstruckInwardRequirement.setPurchaseOrderId(new BigDecimal(purchaseOrderId));
+        if(purchaseOrderId != null){
+            amstruckInwardRequirement.setPurchaseOrderId(new BigDecimal(purchaseOrderId));
+        }
         amstruckInwardRequirement.setRequirementType(requirementType);
         amstruckInwardRequirement.setCapacityTypeId(new BigDecimal(capacityTypeId));
         amstruckInwardRequirement.setRequirementTruckTime(requirementTruckTime);
@@ -81,6 +82,7 @@ public class AmstruckInwardRequirementServiceImpl extends BaseServiceImpl<Amstru
         amstruckInwardRequirement.setRequirementOverlimit(requirementOverlimit);
         amstruckInwardRequirement.setRequirementShipperId(new BigDecimal(requirementShipperId));
         amstruckInwardRequirement.setRequirementUnloadUnitId(new BigDecimal(requirementUnloadUnitId));
+        amstruckInwardRequirement.setRequirementPlatformId(DataChange.dataToBigDecimal(mapValue.get("requirementPlatformId")));
         // 设置常规字段
         amstruckInwardRequirement.setInsertTime(new Date());
         amstruckInwardRequirement.setInsertUsername("admin");
@@ -89,19 +91,21 @@ public class AmstruckInwardRequirementServiceImpl extends BaseServiceImpl<Amstru
         int result = 0;
         result += amstruckInwardRequirementMapper.insertSelective(amstruckInwardRequirement);
         // 物资中间表
-        BigDecimal materialId = amstruckInwardRequirementMapper.getMaterialId(new BigDecimal(purchaseOrderId));
+        BigDecimal materialId = DataChange.dataToBigDecimal(mapValue.get("materialId"));
+        if(materialId.intValue() == 0)
+            if(purchaseOrderId != null)
+                materialId = amstruckInwardRequirementMapper.getMaterialId(new BigDecimal(purchaseOrderId));
         AmstruckRequirementMaterial amstruckRequirementMaterial = new AmstruckRequirementMaterial();
-        BigDecimal requirementMaterialId = amstruckRequirementMaterialMapper.selectRequirementMaterialId();
-        amstruckRequirementMaterial.setRequirementMaterialId(requirementMaterialId);
+        amstruckRequirementMaterial.setRequirementMaterialId(amstruckRequirementMaterialMapper.selectRequirementMaterialId());
         amstruckRequirementMaterial.setRequirementId(requirementId);
-        amstruckRequirementMaterial.setMaterialCount(new BigDecimal(materialCount));
-        amstruckRequirementMaterial.setMaterialWeight(new BigDecimal(materialWeight));
+        if(materialCount.intValue() != 0)
+            amstruckRequirementMaterial.setMaterialCount(materialCount);
+        if(materialWeight.intValue() != 0)
+            amstruckRequirementMaterial.setMaterialWeight(materialWeight);
         amstruckRequirementMaterial.setMaterialId(materialId);
         amstruckRequirementMaterial.setInsertTime(new Date());
         amstruckRequirementMaterial.setInsertUsername("admin");
         amstruckRequirementMaterial.setInsertUpdateRemark("无");
-        amstruckRequirementMaterial.setUpdateTime(new Date());
-        amstruckRequirementMaterial.setUpdateUsername("admin");
         result += amstruckRequirementMaterialMapper.insertSelective(amstruckRequirementMaterial);
         return result;
     }

+ 2 - 0
src/main/java/com/steerinfo/dil/util/DataChange.java

@@ -45,6 +45,8 @@ public class DataChange {
         if (data != null){
             if(data instanceof String){
                 String data1 = (String) data;
+                if(data1.length() == 0)
+                    return new BigDecimal(0);
                 return new BigDecimal(data1);
             }
             if(data instanceof Integer){

+ 2 - 2
src/main/resources/com/steerinfo/dil/mapper/AmsRailOffsetDayplanMapper.xml

@@ -617,9 +617,9 @@
         SELECT *
         FROM (SELECT AROD.DAYPLAN_ID AS "dayPlanId",
         AROD.DAYPLAN_NO AS "dayplanNo",
-        AROD.DAYPLAN_DATE AS "dayplanDate",
+        to_char(AROD.DAYPLAN_DATE, 'yyyy-mm-dd') AS "dayplanDate",
         RS.SHIPPER_NAME AS "shipperName",
-        AROD.DAYPLAN_DELIVERY_DATE AS "dayplanDeliveryDate",
+        to_char(AROD.DAYPLAN_DELIVERY_DATE, 'yyyy-mm-dd') AS "dayplanDeliveryDate",
         RAS.TRANSFER_UNIT AS "transferUnit",
         AROD.DAYPLAN_OWN_CARS_AMOUT AS "dayplanOwnCarsAmout",
         AROD.DAYPLAN_WAGON_NUMBER AS "dayplanWagonNumber",

+ 13 - 7
src/main/resources/com/steerinfo/dil/mapper/AmsSalePlanMapper.xml

@@ -440,12 +440,18 @@
 
 <!-- 查询所有钢材物资 -->
   <select id="getAllSteelMaterialMes"  parameterType="java.util.Map" resultType="java.util.Map">
-    SELECT
-      RM.MATERIAL_ID "materialId",
-      RM.MATERIAL_CODE "materialCode",
-      RM.MATERIAL_NAME "materialName",
-      CONCAT(CONCAT(RM.MATERIAL_SPECIFICATION, '('),  CONCAT(RM.MATERIAL_MODEL, ')')) "Specification"
-    FROM RMS_MATERIAL RM
-    WHERE RM.MATERIAL_CODE LIKE '0801%'
+    select *
+    from (
+           SELECT RM.MATERIAL_ID                                                                 "materialId",
+                  RM.MATERIAL_CODE                                                               "materialCode",
+                  RM.MATERIAL_NAME                                                               "materialName",
+                  CONCAT(CONCAT(RM.MATERIAL_SPECIFICATION, '('), CONCAT(RM.MATERIAL_MODEL, ')')) "Specification"
+           FROM RMS_MATERIAL RM
+           WHERE RM.MATERIAL_CODE LIKE '0801%'
+         ) t
+    <if test="con != null">
+      where t."materialName" LIKE #{con}
+    </if>
+    order by "materialCode"
   </select>
 </mapper>

+ 1 - 1
src/main/resources/com/steerinfo/dil/mapper/AmstruckInwardPlanMapper.xml

@@ -460,7 +460,7 @@
         LEFT JOIN DIL_BATCH DB
         ON APO.BATCH_ID = DB.BATCH_ID
         LEFT JOIN RMS_MATERIAL RM
-        ON RM.MATERIAL_ID = DB.MATERIAL_ID
+        ON RM.MATERIAL_ID = ARM.MATERIAL_ID
         LEFT JOIN RMS_WAREHOUSE RW
         ON RW.WAREHOUSE_ID = AIR.REQUIREMNT_UNIT_ID
         LEFT JOIN RMS_CARRIER RCA

+ 138 - 115
src/main/resources/com/steerinfo/dil/mapper/AmstruckInwardRequirementMapper.xml

@@ -2,53 +2,50 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.steerinfo.dil.mapper.AmstruckInwardRequirementMapper">
     <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmstruckInwardRequirement">
-        <id column="REQUIREMENT_ID" jdbcType="DECIMAL" property="requirementId"/>
-        <result column="PURCHASE_ORDER_ID" jdbcType="DECIMAL" property="purchaseOrderId"/>
-        <result column="REQUIREMENT_NUMBER" jdbcType="VARCHAR" property="requirementNumber"/>
-        <result column="REQUIREMENT_TYPE" jdbcType="VARCHAR" property="requirementType"/>
-        <result column="CAPACITY_TYPE_ID" jdbcType="DECIMAL" property="capacityTypeId"/>
-        <result column="REQUIREMENT_TRUCK_TIME" jdbcType="TIMESTAMP" property="requirementTruckTime"/>
-        <result column="REQUIREMENT_SHIPPER_ID" jdbcType="DECIMAL" property="requirementShipperId"/>
-        <result column="REQUIREMENT_WORK_TYPE" jdbcType="DECIMAL" property="requirementWorkType"/>
-        <result column="REQUIREMENT_WORK_CONTENT" jdbcType="VARCHAR" property="requirementWorkContent"/>
-        <result column="LINE_ID" jdbcType="DECIMAL" property="lineId"/>
-        <result column="REQUIREMENT_WORK_ENVIRONMENT" jdbcType="VARCHAR" property="requirementWorkEnvironment"/>
-        <result column="REQUIREMENT_ESTIMATED_DURATION" jdbcType="DECIMAL" property="requirementEstimatedDuration"/>
-        <result column="REQUIREMENT_OVERLIMIT" jdbcType="VARCHAR" property="requirementOverlimit"/>
-        <result column="REQUIREMNT_UNIT_ID" jdbcType="DECIMAL" property="requiremntUnitId"/>
-        <result column="REQUIREMENT_STATUS" jdbcType="DECIMAL" property="requirementStatus"/>
-        <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername"/>
-        <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime"/>
-        <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername"/>
-        <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
-        <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark"/>
-        <result column="DELETED" jdbcType="DECIMAL" property="deleted"/>
-        <result column="REQUIREMENT_UNLOAD_UNIT_ID" jdbcType="DECIMAL" property="requirementUnloadUnitId"/>
+        <id column="REQUIREMENT_ID" jdbcType="DECIMAL" property="requirementId" />
+        <result column="PURCHASE_ORDER_ID" jdbcType="DECIMAL" property="purchaseOrderId" />
+        <result column="REQUIREMENT_NUMBER" jdbcType="VARCHAR" property="requirementNumber" />
+        <result column="REQUIREMENT_TYPE" jdbcType="VARCHAR" property="requirementType" />
+        <result column="CAPACITY_TYPE_ID" jdbcType="DECIMAL" property="capacityTypeId" />
+        <result column="REQUIREMENT_TRUCK_TIME" jdbcType="TIMESTAMP" property="requirementTruckTime" />
+        <result column="REQUIREMENT_SHIPPER_ID" jdbcType="DECIMAL" property="requirementShipperId" />
+        <result column="REQUIREMENT_WORK_TYPE" jdbcType="DECIMAL" property="requirementWorkType" />
+        <result column="REQUIREMENT_WORK_CONTENT" jdbcType="VARCHAR" property="requirementWorkContent" />
+        <result column="LINE_ID" jdbcType="DECIMAL" property="lineId" />
+        <result column="REQUIREMENT_WORK_ENVIRONMENT" jdbcType="VARCHAR" property="requirementWorkEnvironment" />
+        <result column="REQUIREMENT_ESTIMATED_DURATION" jdbcType="DECIMAL" property="requirementEstimatedDuration" />
+        <result column="REQUIREMENT_OVERLIMIT" jdbcType="VARCHAR" property="requirementOverlimit" />
+        <result column="REQUIREMNT_UNIT_ID" jdbcType="DECIMAL" property="requiremntUnitId" />
+        <result column="REQUIREMENT_STATUS" jdbcType="DECIMAL" property="requirementStatus" />
+        <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+        <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+        <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+        <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+        <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+        <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
+        <result column="REQUIREMENT_UNLOAD_UNIT_ID" jdbcType="DECIMAL" property="requirementUnloadUnitId" />
+        <result column="REQUIREMENT_PLATFORM_ID " jdbcType="DECIMAL" property="requirementPlatformId" />
     </resultMap>
     <sql id="columns">
-        REQUIREMENT_ID, PURCHASE_ORDER_ID, REQUIREMENT_NUMBER, REQUIREMENT_TYPE, CAPACITY_TYPE_ID,
-    REQUIREMENT_TRUCK_TIME, REQUIREMENT_SHIPPER_ID, REQUIREMENT_WORK_TYPE, REQUIREMENT_WORK_CONTENT,
-    LINE_ID, REQUIREMENT_WORK_ENVIRONMENT, REQUIREMENT_ESTIMATED_DURATION, REQUIREMENT_OVERLIMIT,
-    REQUIREMNT_UNIT_ID, REQUIREMENT_STATUS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
-    UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, REQUIREMENT_UNLOAD_UNIT_ID
+        REQUIREMENT_ID, PURCHASE_ORDER_ID, REQUIREMENT_NUMBER, REQUIREMENT_TYPE, CAPACITY_TYPE_ID, 
+    REQUIREMENT_TRUCK_TIME, REQUIREMENT_SHIPPER_ID, REQUIREMENT_WORK_TYPE, REQUIREMENT_WORK_CONTENT, 
+    LINE_ID, REQUIREMENT_WORK_ENVIRONMENT, REQUIREMENT_ESTIMATED_DURATION, REQUIREMENT_OVERLIMIT, 
+    REQUIREMNT_UNIT_ID, REQUIREMENT_STATUS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+    UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, REQUIREMENT_UNLOAD_UNIT_ID, "REQUIREMENT_PLATFORM_ID "
     </sql>
     <sql id="columns_alias">
-        t.REQUIREMENT_ID, t.PURCHASE_ORDER_ID, t.REQUIREMENT_NUMBER, t.REQUIREMENT_TYPE,
-    t.CAPACITY_TYPE_ID, t.REQUIREMENT_TRUCK_TIME, t.REQUIREMENT_SHIPPER_ID, t.REQUIREMENT_WORK_TYPE,
-    t.REQUIREMENT_WORK_CONTENT, t.LINE_ID, t.REQUIREMENT_WORK_ENVIRONMENT, t.REQUIREMENT_ESTIMATED_DURATION,
-    t.REQUIREMENT_OVERLIMIT, t.REQUIREMNT_UNIT_ID, t.REQUIREMENT_STATUS, t.INSERT_USERNAME,
-    t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED,
-    t.REQUIREMENT_UNLOAD_UNIT_ID
+        t.REQUIREMENT_ID, t.PURCHASE_ORDER_ID, t.REQUIREMENT_NUMBER, t.REQUIREMENT_TYPE, 
+    t.CAPACITY_TYPE_ID, t.REQUIREMENT_TRUCK_TIME, t.REQUIREMENT_SHIPPER_ID, t.REQUIREMENT_WORK_TYPE, 
+    t.REQUIREMENT_WORK_CONTENT, t.LINE_ID, t.REQUIREMENT_WORK_ENVIRONMENT, t.REQUIREMENT_ESTIMATED_DURATION, 
+    t.REQUIREMENT_OVERLIMIT, t.REQUIREMNT_UNIT_ID, t.REQUIREMENT_STATUS, t.INSERT_USERNAME, 
+    t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, 
+    t.REQUIREMENT_UNLOAD_UNIT_ID, t."REQUIREMENT_PLATFORM_ID "
     </sql>
     <sql id="select">
-        SELECT
-        <include refid="columns"/>
-        FROM AMSTRUCK_INWARD_REQUIREMENT
+        SELECT <include refid="columns" /> FROM AMSTRUCK_INWARD_REQUIREMENT
     </sql>
     <sql id="select_alias">
-        SELECT
-        <include refid="columns_alias"/>
-        FROM AMSTRUCK_INWARD_REQUIREMENT t
+        SELECT <include refid="columns_alias" /> FROM AMSTRUCK_INWARD_REQUIREMENT t
     </sql>
     <sql id="where">
         <where>
@@ -118,6 +115,9 @@
             <if test="requirementUnloadUnitId != null">
                 and REQUIREMENT_UNLOAD_UNIT_ID = #{requirementUnloadUnitId}
             </if>
+            <if test="requirementPlatformId != null">
+                and REQUIREMENT_PLATFORM_ID  = #{requirementPlatformId}
+            </if>
         </where>
     </sql>
     <sql id="whereLike">
@@ -188,11 +188,13 @@
             <if test="requirementUnloadUnitId != null">
                 and REQUIREMENT_UNLOAD_UNIT_ID = #{requirementUnloadUnitId}
             </if>
+            <if test="requirementPlatformId != null">
+                and REQUIREMENT_PLATFORM_ID  = #{requirementPlatformId}
+            </if>
         </where>
     </sql>
     <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
-        delete
-        from AMSTRUCK_INWARD_REQUIREMENT
+        delete from AMSTRUCK_INWARD_REQUIREMENT
         where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
     </delete>
     <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
@@ -261,6 +263,9 @@
         <if test="requirementUnloadUnitId != null">
             or REQUIREMENT_UNLOAD_UNIT_ID = #{requirementUnloadUnitId}
         </if>
+        <if test="requirementPlatformId != null">
+            or REQUIREMENT_PLATFORM_ID  = #{requirementPlatformId}
+        </if>
     </delete>
     <insert id="insert" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
         insert into AMSTRUCK_INWARD_REQUIREMENT (REQUIREMENT_ID, PURCHASE_ORDER_ID, REQUIREMENT_NUMBER,
@@ -270,20 +275,17 @@
                                                  REQUIREMENT_ESTIMATED_DURATION, REQUIREMENT_OVERLIMIT,
                                                  REQUIREMNT_UNIT_ID, REQUIREMENT_STATUS, INSERT_USERNAME,
                                                  INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
-                                                 INSERT_UPDATE_REMARK, DELETED, REQUIREMENT_UNLOAD_UNIT_ID)
-        values (#{requirementId,jdbcType=DECIMAL}, #{purchaseOrderId,jdbcType=DECIMAL},
-                #{requirementNumber,jdbcType=VARCHAR},
-                #{requirementType,jdbcType=VARCHAR}, #{capacityTypeId,jdbcType=DECIMAL},
-                #{requirementTruckTime,jdbcType=TIMESTAMP},
+                                                 INSERT_UPDATE_REMARK, DELETED, REQUIREMENT_UNLOAD_UNIT_ID,
+                                                 "REQUIREMENT_PLATFORM_ID ")
+        values (#{requirementId,jdbcType=DECIMAL}, #{purchaseOrderId,jdbcType=DECIMAL}, #{requirementNumber,jdbcType=VARCHAR},
+                #{requirementType,jdbcType=VARCHAR}, #{capacityTypeId,jdbcType=DECIMAL}, #{requirementTruckTime,jdbcType=TIMESTAMP},
                 #{requirementShipperId,jdbcType=DECIMAL}, #{requirementWorkType,jdbcType=DECIMAL},
-                #{requirementWorkContent,jdbcType=VARCHAR}, #{lineId,jdbcType=DECIMAL},
-                #{requirementWorkEnvironment,jdbcType=VARCHAR},
+                #{requirementWorkContent,jdbcType=VARCHAR}, #{lineId,jdbcType=DECIMAL}, #{requirementWorkEnvironment,jdbcType=VARCHAR},
                 #{requirementEstimatedDuration,jdbcType=DECIMAL}, #{requirementOverlimit,jdbcType=VARCHAR},
-                #{requiremntUnitId,jdbcType=DECIMAL}, #{requirementStatus,jdbcType=DECIMAL},
-                #{insertUsername,jdbcType=VARCHAR},
+                #{requiremntUnitId,jdbcType=DECIMAL}, #{requirementStatus,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR},
                 #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
-                #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
-                #{requirementUnloadUnitId,jdbcType=DECIMAL})
+                #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}, #{requirementUnloadUnitId,jdbcType=DECIMAL},
+                #{requirementPlatformId,jdbcType=DECIMAL})
     </insert>
     <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
         insert into AMSTRUCK_INWARD_REQUIREMENT
@@ -354,6 +356,9 @@
             <if test="requirementUnloadUnitId != null">
                 REQUIREMENT_UNLOAD_UNIT_ID,
             </if>
+            <if test="requirementPlatformId != null">
+                "REQUIREMENT_PLATFORM_ID ",
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="requirementId != null">
@@ -422,31 +427,35 @@
             <if test="requirementUnloadUnitId != null">
                 #{requirementUnloadUnitId,jdbcType=DECIMAL},
             </if>
+            <if test="requirementPlatformId != null">
+                #{requirementPlatformId,jdbcType=DECIMAL},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
         update AMSTRUCK_INWARD_REQUIREMENT
-        set PURCHASE_ORDER_ID              = #{purchaseOrderId,jdbcType=DECIMAL},
-            REQUIREMENT_NUMBER             = #{requirementNumber,jdbcType=VARCHAR},
-            REQUIREMENT_TYPE               = #{requirementType,jdbcType=VARCHAR},
-            CAPACITY_TYPE_ID               = #{capacityTypeId,jdbcType=DECIMAL},
-            REQUIREMENT_TRUCK_TIME         = #{requirementTruckTime,jdbcType=TIMESTAMP},
-            REQUIREMENT_SHIPPER_ID         = #{requirementShipperId,jdbcType=DECIMAL},
-            REQUIREMENT_WORK_TYPE          = #{requirementWorkType,jdbcType=DECIMAL},
-            REQUIREMENT_WORK_CONTENT       = #{requirementWorkContent,jdbcType=VARCHAR},
-            LINE_ID                        = #{lineId,jdbcType=DECIMAL},
-            REQUIREMENT_WORK_ENVIRONMENT   = #{requirementWorkEnvironment,jdbcType=VARCHAR},
+        set PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
+            REQUIREMENT_NUMBER = #{requirementNumber,jdbcType=VARCHAR},
+            REQUIREMENT_TYPE = #{requirementType,jdbcType=VARCHAR},
+            CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
+            REQUIREMENT_TRUCK_TIME = #{requirementTruckTime,jdbcType=TIMESTAMP},
+            REQUIREMENT_SHIPPER_ID = #{requirementShipperId,jdbcType=DECIMAL},
+            REQUIREMENT_WORK_TYPE = #{requirementWorkType,jdbcType=DECIMAL},
+            REQUIREMENT_WORK_CONTENT = #{requirementWorkContent,jdbcType=VARCHAR},
+            LINE_ID = #{lineId,jdbcType=DECIMAL},
+            REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment,jdbcType=VARCHAR},
             REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration,jdbcType=DECIMAL},
-            REQUIREMENT_OVERLIMIT          = #{requirementOverlimit,jdbcType=VARCHAR},
-            REQUIREMNT_UNIT_ID             = #{requiremntUnitId,jdbcType=DECIMAL},
-            REQUIREMENT_STATUS             = #{requirementStatus,jdbcType=DECIMAL},
-            INSERT_USERNAME                = #{insertUsername,jdbcType=VARCHAR},
-            INSERT_TIME                    = #{insertTime,jdbcType=TIMESTAMP},
-            UPDATE_USERNAME                = #{updateUsername,jdbcType=VARCHAR},
-            UPDATE_TIME                    = #{updateTime,jdbcType=TIMESTAMP},
-            INSERT_UPDATE_REMARK           = #{insertUpdateRemark,jdbcType=VARCHAR},
-            DELETED                        = #{deleted,jdbcType=DECIMAL},
-            REQUIREMENT_UNLOAD_UNIT_ID     = #{requirementUnloadUnitId,jdbcType=DECIMAL}
+            REQUIREMENT_OVERLIMIT = #{requirementOverlimit,jdbcType=VARCHAR},
+            REQUIREMNT_UNIT_ID = #{requiremntUnitId,jdbcType=DECIMAL},
+            REQUIREMENT_STATUS = #{requirementStatus,jdbcType=DECIMAL},
+            INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+            INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+            UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+            UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+            INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+            DELETED = #{deleted,jdbcType=DECIMAL},
+            REQUIREMENT_UNLOAD_UNIT_ID = #{requirementUnloadUnitId,jdbcType=DECIMAL},
+            "REQUIREMENT_PLATFORM_ID " = #{requirementPlatformId,jdbcType=DECIMAL}
         where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
     </update>
     <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
@@ -515,20 +524,23 @@
             <if test="requirementUnloadUnitId != null">
                 REQUIREMENT_UNLOAD_UNIT_ID = #{requirementUnloadUnitId,jdbcType=DECIMAL},
             </if>
+            <if test="requirementPlatformId != null">
+                "REQUIREMENT_PLATFORM_ID " = #{requirementPlatformId,jdbcType=DECIMAL},
+            </if>
         </set>
         where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
     </update>
     <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
-        <include refid="select"/>
+        <include refid="select" />
         where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
     </select>
     <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-        <include refid="select"/>
-        <include refid="where"/>
+        <include refid="select" />
+        <include refid="where" />
     </select>
     <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-        <include refid="select"/>
-        <include refid="whereLike"/>
+        <include refid="select" />
+        <include refid="whereLike" />
     </select>
     <insert id="batchInsert" parameterType="java.util.List">
         insert into AMSTRUCK_INWARD_REQUIREMENT
@@ -543,7 +555,8 @@
         INSERT_USERNAME, INSERT_TIME,
         UPDATE_USERNAME, UPDATE_TIME,
         INSERT_UPDATE_REMARK, DELETED,
-        REQUIREMENT_UNLOAD_UNIT_ID)
+        REQUIREMENT_UNLOAD_UNIT_ID, "REQUIREMENT_PLATFORM_ID "
+        )
         ( <foreach collection="list" item="item" separator="union all">
         select
         #{item.requirementId,jdbcType=DECIMAL},
@@ -557,109 +570,114 @@
         #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
         #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
         #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL},
-        #{item.requirementUnloadUnitId,jdbcType=DECIMAL} from dual
+        #{item.requirementUnloadUnitId,jdbcType=DECIMAL}, #{item.requirementPlatformId,jdbcType=DECIMAL}
+        from dual
     </foreach> )
     </insert>
     <update id="batchUpdate" parameterType="java.util.List">
         update AMSTRUCK_INWARD_REQUIREMENT
         set
         REQUIREMENT_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementId,jdbcType=DECIMAL}
         </foreach>
         ,PURCHASE_ORDER_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.purchaseOrderId,jdbcType=DECIMAL}
         </foreach>
         ,REQUIREMENT_NUMBER=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementNumber,jdbcType=VARCHAR}
         </foreach>
         ,REQUIREMENT_TYPE=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementType,jdbcType=VARCHAR}
         </foreach>
         ,CAPACITY_TYPE_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.capacityTypeId,jdbcType=DECIMAL}
         </foreach>
         ,REQUIREMENT_TRUCK_TIME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementTruckTime,jdbcType=TIMESTAMP}
         </foreach>
         ,REQUIREMENT_SHIPPER_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementShipperId,jdbcType=DECIMAL}
         </foreach>
         ,REQUIREMENT_WORK_TYPE=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementWorkType,jdbcType=DECIMAL}
         </foreach>
         ,REQUIREMENT_WORK_CONTENT=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementWorkContent,jdbcType=VARCHAR}
         </foreach>
         ,LINE_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.lineId,jdbcType=DECIMAL}
         </foreach>
         ,REQUIREMENT_WORK_ENVIRONMENT=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementWorkEnvironment,jdbcType=VARCHAR}
         </foreach>
         ,REQUIREMENT_ESTIMATED_DURATION=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementEstimatedDuration,jdbcType=DECIMAL}
         </foreach>
         ,REQUIREMENT_OVERLIMIT=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementOverlimit,jdbcType=VARCHAR}
         </foreach>
         ,REQUIREMNT_UNIT_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.requiremntUnitId,jdbcType=DECIMAL}
         </foreach>
         ,REQUIREMENT_STATUS=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementStatus,jdbcType=DECIMAL}
         </foreach>
         ,INSERT_USERNAME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
         </foreach>
         ,INSERT_TIME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
         </foreach>
         ,UPDATE_USERNAME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
         </foreach>
         ,UPDATE_TIME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
         </foreach>
         ,INSERT_UPDATE_REMARK=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
         </foreach>
         ,DELETED=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
         </foreach>
         ,REQUIREMENT_UNLOAD_UNIT_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
             when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementUnloadUnitId,jdbcType=DECIMAL}
         </foreach>
+        ,"REQUIREMENT_PLATFORM_ID "=
+        <foreach close="end" collection="list" index="index" item="item" open="case REQUIREMENT_ID" separator=" ">
+            when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementPlatformId,jdbcType=DECIMAL}
+        </foreach>
         where REQUIREMENT_ID in
-        <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+        <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
             #{item.requirementId,jdbcType=DECIMAL}
         </foreach>
     </update>
     <delete id="batchDelete" parameterType="java.util.List">
         delete from AMSTRUCK_INWARD_REQUIREMENT
         where REQUIREMENT_ID in
-        <foreach collection="list" item="id" open="(" close=")" separator=",">
+        <foreach close=")" collection="list" item="id" open="(" separator=",">
             #{id}
         </foreach>
     </delete>
@@ -686,22 +704,26 @@
         AIR.INSERT_USERNAME AS "insertUsername",
         AIR.REQUIREMENT_ID AS "requirementId",
         ARM.MATERIAL_COUNT AS "materialNumber",
+        ARM.MATERIAL_WEIGHT "materialWeight",
         RW.WAREHOUSE_NAME AS "wareHouseName"
         FROM AMSTRUCK_INWARD_REQUIREMENT AIR
         LEFT JOIN AMS_PURCHASE_ORDER APO
-        ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
-        LEFT JOIN RMS_WAREHOUSE RW
-        ON RW.WAREHOUSE_ID = AIR.REQUIREMNT_UNIT_ID
+            ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
         LEFT JOIN DIL_BATCH DB
-        ON DB.BATCH_ID = APO.BATCH_ID
-        LEFT JOIN RMS_MATERIAL RM
-        ON RM.MATERIAL_ID = DB.MATERIAL_ID
-        LEFT JOIN RMS_CAPACITY_TYPE RCT ON AIR.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
-        LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
+            ON DB.BATCH_ID = APO.BATCH_ID
+        LEFT JOIN RMS_WAREHOUSE RW
+            ON RW.WAREHOUSE_ID = AIR.REQUIREMNT_UNIT_ID
+        LEFT JOIN RMS_CAPACITY_TYPE RCT
+            ON AIR.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
+        LEFT JOIN RMS_SHIPPER RS
+            ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
         LEFT JOIN AMSTRUCK_REQUIREMENT_MATERIAL ARM
-        ON ARM.REQUIREMENT_ID = AIR.REQUIREMENT_ID
+            ON ARM.REQUIREMENT_ID = AIR.REQUIREMENT_ID
+        LEFT JOIN RMS_MATERIAL RM
+            ON RM.MATERIAL_ID = ARM.MATERIAL_ID
         WHERE AIR.REQUIREMENT_STATUS = #{requirementStatus}
-        AND AIR.DELETED = 0)
+        AND AIR.DELETED = 0
+        )
         <where>
             <if test="purchaseOrderNo != null">
                 and
@@ -845,12 +867,13 @@
         ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
         LEFT JOIN DIL_BATCH DB
         ON DB.BATCH_ID = APO.BATCH_ID
-        LEFT JOIN RMS_MATERIAL RM
-        ON RM.MATERIAL_ID = DB.MATERIAL_ID
+
         LEFT JOIN RMS_CAPACITY_TYPE RCT ON AIR.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
         LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
         LEFT JOIN AMSTRUCK_REQUIREMENT_MATERIAL ARM
         ON ARM.REQUIREMENT_ID = AIR.REQUIREMENT_ID
+        LEFT JOIN RMS_MATERIAL RM
+        ON RM.MATERIAL_ID = ARM.MATERIAL_ID
         LEFT JOIN RMS_WAREHOUSE RW
         ON RW.WAREHOUSE_ID = AIR.REQUIREMNT_UNIT_ID
         WHERE AIR.REQUIREMENT_STATUS = #{requirementStatus}

+ 1 - 1
src/main/resources/com/steerinfo/dil/mapper/AmstruckPurplanMapper.xml

@@ -494,7 +494,7 @@
             RC.CARRIER_NAME "carrierName",
             AP.MATERIAL_TOTAL_WEIGHT "materialTotalWeight",
             to_char(AP.PLAN_TRUCK_TIME, 'yyyy-mm-dd') "planTruckTime",
-            to_char(AP.PLAN_INCOMING_TIME. 'yyyy-mm-dd') "planIncomingTime"
+            to_char(AP.PLAN_INCOMING_TIME, 'yyyy-mm-dd') "planIncomingTime"
         from AMSTRUCK_PURPLAN AP
         left join AMS_PURCHASE_ORDER APO
         on AP.BATCH_ID = APO.BATCH_ID