liyg 2 年之前
父节点
当前提交
27022b9759

+ 6 - 0
src/main/java/com/steerinfo/dil/controller/ShipDynamicsController.java

@@ -269,4 +269,10 @@ public class ShipDynamicsController extends BaseRESTfulController {
     public RESTfulResult getUnloadData(@RequestBody(required = false)Map<String,Object> mapVal){
         return success(iShipDynamicsService.getUnloadData(mapVal));
     }
+
+    @ApiOperation(value="下游港口船舶动态表")
+    @PostMapping("/getDownShipDynamaics")
+    public RESTfulResult getDownShipDynamaics(@RequestBody(required = false)Map<String,Object> mapVal){
+        return success(iShipDynamicsService.getDownShipDynamaics(mapVal));
+    }
 }

+ 2 - 0
src/main/java/com/steerinfo/dil/mapper/ShipDynamicsMapper.java

@@ -15,4 +15,6 @@ public interface ShipDynamicsMapper {
     List<Map<String, Object>> getLoadData(Map<String,Object> map);
 
     List<Map<String, Object>> getUnloadData(Map<String,Object> map);
+
+    List<Map<String, Object>> getDownShipDynamaics(Map<String,Object> map);
 }

+ 23 - 8
src/main/java/com/steerinfo/dil/model/OmsshipInstructionsCapacity.java

@@ -94,10 +94,16 @@ public class OmsshipInstructionsCapacity implements IBasePO<BigDecimal> {
     private Date instructionEsarrivalTime;
 
     /**
-     * 装船指令状态(INSTRUCTIONS_STATUS,VARCHAR,20)
+     * 船舶动态(SHIP_DYNAMIC,VARCHAR,100)
      */
-    @ApiModelProperty(value="装船指令状态",required=false)
-    private String instructionsStatus;
+    @ApiModelProperty(value="船舶动态",required=false)
+    private String shipDynamic;
+
+    /**
+     * 装船详情(LOAD_DETAILS,VARCHAR,100)
+     */
+    @ApiModelProperty(value="装船详情",required=false)
+    private String loadDetails;
 
     private static final long serialVersionUID = 1L;
 
@@ -223,12 +229,20 @@ public class OmsshipInstructionsCapacity implements IBasePO<BigDecimal> {
         this.instructionEsarrivalTime = instructionEsarrivalTime;
     }
 
-    public String getInstructionsStatus() {
-        return instructionsStatus;
+    public String getShipDynamic() {
+        return shipDynamic;
+    }
+
+    public void setShipDynamic(String shipDynamic) {
+        this.shipDynamic = shipDynamic == null ? null : shipDynamic.trim();
+    }
+
+    public String getLoadDetails() {
+        return loadDetails;
     }
 
-    public void setInstructionsStatus(String instructionsStatus) {
-        this.instructionsStatus = instructionsStatus == null ? null : instructionsStatus.trim();
+    public void setLoadDetails(String loadDetails) {
+        this.loadDetails = loadDetails == null ? null : loadDetails.trim();
     }
 
     @Override
@@ -251,7 +265,8 @@ public class OmsshipInstructionsCapacity implements IBasePO<BigDecimal> {
         sb.append(", instructionsCapacityStatus=").append(instructionsCapacityStatus);
         sb.append(", deleted=").append(deleted);
         sb.append(", instructionEsarrivalTime=").append(instructionEsarrivalTime);
-        sb.append(", instructionsStatus=").append(instructionsStatus);
+        sb.append(", shipDynamic=").append(shipDynamic);
+        sb.append(", loadDetails=").append(loadDetails);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 1 - 0
src/main/java/com/steerinfo/dil/service/IShipDynamicsService.java

@@ -14,5 +14,6 @@ public interface IShipDynamicsService {
 
     List<Map<String, Object>> getUnloadData(Map<String,Object> map);
 
+    List<Map<String, Object>> getDownShipDynamaics(Map<String,Object> map);
 
 }

+ 8 - 0
src/main/java/com/steerinfo/dil/service/impl/ShipDynamicsServiceImpl.java

@@ -40,4 +40,12 @@ public class ShipDynamicsServiceImpl implements IShipDynamicsService {
     public List<Map<String, Object>> getUnloadData(Map<String,Object> map){
         return shipDynamicsMapper.getUnloadData(map);
     }
+
+    @Override
+    public List<Map<String, Object>> getDownShipDynamaics(Map<String,Object> map){
+        String startTime=map.get("startTime")+"";
+        String endTime=map.get("endTime")+"";
+        DataChange.queryDataByDateTime(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
+        return shipDynamicsMapper.getDownShipDynamaics(map);
+    }
 }

+ 109 - 59
src/main/resources/com/steerinfo/dil/mapper/OmsshipInstructionsCapacityMapper.xml

@@ -16,24 +16,26 @@
     <result column="INSTRUCTIONS_CAPACITY_STATUS" jdbcType="VARCHAR" property="instructionsCapacityStatus" />
     <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
     <result column="INSTRUCTION_ESARRIVAL_TIME" jdbcType="TIMESTAMP" property="instructionEsarrivalTime" />
+    <result column="SHIP_DYNAMIC" jdbcType="VARCHAR" property="shipDynamic" />
+    <result column="LOAD_DETAILS" jdbcType="VARCHAR" property="loadDetails" />
   </resultMap>
   <sql id="columns">
-    INSTRUCTIONS_CAPACITY_ID, INSTRUCTIONS_ID, CAPACITY_ID, INSTRUCTION_PLANNED_LOADING,
-    INSTRUCTIONS_SHIP_POSITION, INSTRUCTION_CONTACT_INF, INSERT_USERNAME, INSERT_TIME,
-    UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, INSTRUCTIONS_CAPACITY_STATUS,
-    DELETED, INSTRUCTION_ESARRIVAL_TIME
+    INSTRUCTIONS_CAPACITY_ID, INSTRUCTIONS_ID, CAPACITY_ID, INSTRUCTION_PLANNED_LOADING, 
+    INSTRUCTIONS_SHIP_POSITION, INSTRUCTION_CONTACT_INF, INSERT_USERNAME, INSERT_TIME, 
+    UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, INSTRUCTIONS_CAPACITY_STATUS, 
+    DELETED, INSTRUCTION_ESARRIVAL_TIME, SHIP_DYNAMIC, LOAD_DETAILS
   </sql>
   <sql id="columns_alias">
-    t.INSTRUCTIONS_CAPACITY_ID, t.INSTRUCTIONS_ID, t.CAPACITY_ID, t.INSTRUCTION_PLANNED_LOADING,
-    t.INSTRUCTIONS_SHIP_POSITION, t.INSTRUCTION_CONTACT_INF, t.INSERT_USERNAME, t.INSERT_TIME,
-    t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.INSTRUCTIONS_CAPACITY_STATUS,
-    t.DELETED, t.INSTRUCTION_ESARRIVAL_TIME
+    t.INSTRUCTIONS_CAPACITY_ID, t.INSTRUCTIONS_ID, t.CAPACITY_ID, t.INSTRUCTION_PLANNED_LOADING, 
+    t.INSTRUCTIONS_SHIP_POSITION, t.INSTRUCTION_CONTACT_INF, t.INSERT_USERNAME, t.INSERT_TIME, 
+    t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.INSTRUCTIONS_CAPACITY_STATUS, 
+    t.DELETED, t.INSTRUCTION_ESARRIVAL_TIME, t.SHIP_DYNAMIC, t.LOAD_DETAILS
   </sql>
   <sql id="select">
-    SELECT <include refid="columns"/> FROM OMSSHIP_INSTRUCTIONS_CAPACITY
+    SELECT <include refid="columns" /> FROM OMSSHIP_INSTRUCTIONS_CAPACITY
   </sql>
   <sql id="select_alias">
-    SELECT <include refid="columns_alias"/> FROM OMSSHIP_INSTRUCTIONS_CAPACITY t
+    SELECT <include refid="columns_alias" /> FROM OMSSHIP_INSTRUCTIONS_CAPACITY t
   </sql>
   <sql id="where">
     <where>
@@ -79,6 +81,12 @@
       <if test="instructionEsarrivalTime != null">
         and TO_CHAR(INSTRUCTION_ESARRIVAL_TIME,'yyyy-MM-dd') = #{instructionEsarrivalTime}
       </if>
+      <if test="shipDynamic != null and shipDynamic != ''">
+        and SHIP_DYNAMIC = #{shipDynamic}
+      </if>
+      <if test="loadDetails != null and loadDetails != ''">
+        and LOAD_DETAILS = #{loadDetails}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
@@ -125,9 +133,15 @@
       <if test="instructionEsarrivalTime != null">
         and TO_CHAR(INSTRUCTION_ESARRIVAL_TIME,'yyyy-MM-dd') = #{instructionEsarrivalTime}
       </if>
+      <if test="shipDynamic != null and shipDynamic != ''">
+        and SHIP_DYNAMIC LIKE '%${shipDynamic}%'
+      </if>
+      <if test="loadDetails != null and loadDetails != ''">
+        and LOAD_DETAILS LIKE '%${loadDetails}%'
+      </if>
     </where>
   </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
     delete from OMSSHIP_INSTRUCTIONS_CAPACITY
     where INSTRUCTIONS_CAPACITY_ID = #{instructionsCapacityId,jdbcType=DECIMAL}
   </delete>
@@ -173,20 +187,28 @@
     <if test="instructionEsarrivalTime != null">
       or TO_CHAR(INSTRUCTION_ESARRIVAL_TIME,'yyyy-MM-dd') = '#{instructionEsarrivalTime}'
     </if>
+    <if test="shipDynamic != null and shipDynamic != ''">
+      or SHIP_DYNAMIC = #{shipDynamic}
+    </if>
+    <if test="loadDetails != null and loadDetails != ''">
+      or LOAD_DETAILS = #{loadDetails}
+    </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.dil.model.OmsshipInstructionsCapacity">
     insert into OMSSHIP_INSTRUCTIONS_CAPACITY (INSTRUCTIONS_CAPACITY_ID, INSTRUCTIONS_ID,
-      CAPACITY_ID, INSTRUCTION_PLANNED_LOADING,
-      INSTRUCTIONS_SHIP_POSITION, INSTRUCTION_CONTACT_INF,
-      INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
-      UPDATE_TIME, INSERT_UPDATE_REMARK, INSTRUCTIONS_CAPACITY_STATUS,
-      DELETED, INSTRUCTION_ESARRIVAL_TIME)
+                                               CAPACITY_ID, INSTRUCTION_PLANNED_LOADING,
+                                               INSTRUCTIONS_SHIP_POSITION, INSTRUCTION_CONTACT_INF,
+                                               INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
+                                               UPDATE_TIME, INSERT_UPDATE_REMARK, INSTRUCTIONS_CAPACITY_STATUS,
+                                               DELETED, INSTRUCTION_ESARRIVAL_TIME, SHIP_DYNAMIC,
+                                               LOAD_DETAILS)
     values (#{instructionsCapacityId,jdbcType=DECIMAL}, #{instructionsId,jdbcType=DECIMAL},
-      #{capacityId,jdbcType=DECIMAL}, #{instructionPlannedLoading,jdbcType=DECIMAL},
-      #{instructionsShipPosition,jdbcType=VARCHAR}, #{instructionContactInf,jdbcType=VARCHAR},
-      #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
-      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{instructionsCapacityStatus,jdbcType=VARCHAR},
-      #{deleted,jdbcType=DECIMAL}, #{instructionEsarrivalTime,jdbcType=TIMESTAMP})
+            #{capacityId,jdbcType=DECIMAL}, #{instructionPlannedLoading,jdbcType=DECIMAL},
+            #{instructionsShipPosition,jdbcType=VARCHAR}, #{instructionContactInf,jdbcType=VARCHAR},
+            #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
+            #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{instructionsCapacityStatus,jdbcType=VARCHAR},
+            #{deleted,jdbcType=DECIMAL}, #{instructionEsarrivalTime,jdbcType=TIMESTAMP}, #{shipDynamic,jdbcType=VARCHAR},
+            #{loadDetails,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.OmsshipInstructionsCapacity">
     insert into OMSSHIP_INSTRUCTIONS_CAPACITY
@@ -233,6 +255,12 @@
       <if test="instructionEsarrivalTime != null">
         INSTRUCTION_ESARRIVAL_TIME,
       </if>
+      <if test="shipDynamic != null">
+        SHIP_DYNAMIC,
+      </if>
+      <if test="loadDetails != null">
+        LOAD_DETAILS,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="instructionsCapacityId != null">
@@ -277,23 +305,31 @@
       <if test="instructionEsarrivalTime != null">
         #{instructionEsarrivalTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="shipDynamic != null">
+        #{shipDynamic,jdbcType=VARCHAR},
+      </if>
+      <if test="loadDetails != null">
+        #{loadDetails,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.OmsshipInstructionsCapacity">
     update OMSSHIP_INSTRUCTIONS_CAPACITY
     set INSTRUCTIONS_ID = #{instructionsId,jdbcType=DECIMAL},
-      CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
-      INSTRUCTION_PLANNED_LOADING = #{instructionPlannedLoading,jdbcType=DECIMAL},
-      INSTRUCTIONS_SHIP_POSITION = #{instructionsShipPosition,jdbcType=VARCHAR},
-      INSTRUCTION_CONTACT_INF = #{instructionContactInf,jdbcType=VARCHAR},
-      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},
-      INSTRUCTIONS_CAPACITY_STATUS = #{instructionsCapacityStatus,jdbcType=VARCHAR},
-      DELETED = #{deleted,jdbcType=DECIMAL},
-      INSTRUCTION_ESARRIVAL_TIME = #{instructionEsarrivalTime,jdbcType=TIMESTAMP}
+        CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
+        INSTRUCTION_PLANNED_LOADING = #{instructionPlannedLoading,jdbcType=DECIMAL},
+        INSTRUCTIONS_SHIP_POSITION = #{instructionsShipPosition,jdbcType=VARCHAR},
+        INSTRUCTION_CONTACT_INF = #{instructionContactInf,jdbcType=VARCHAR},
+        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},
+        INSTRUCTIONS_CAPACITY_STATUS = #{instructionsCapacityStatus,jdbcType=VARCHAR},
+        DELETED = #{deleted,jdbcType=DECIMAL},
+        INSTRUCTION_ESARRIVAL_TIME = #{instructionEsarrivalTime,jdbcType=TIMESTAMP},
+        SHIP_DYNAMIC = #{shipDynamic,jdbcType=VARCHAR},
+        LOAD_DETAILS = #{loadDetails,jdbcType=VARCHAR}
     where INSTRUCTIONS_CAPACITY_ID = #{instructionsCapacityId,jdbcType=DECIMAL}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.OmsshipInstructionsCapacity">
@@ -338,20 +374,26 @@
       <if test="instructionEsarrivalTime != null">
         INSTRUCTION_ESARRIVAL_TIME = #{instructionEsarrivalTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="shipDynamic != null">
+        SHIP_DYNAMIC = #{shipDynamic,jdbcType=VARCHAR},
+      </if>
+      <if test="loadDetails != null">
+        LOAD_DETAILS = #{loadDetails,jdbcType=VARCHAR},
+      </if>
     </set>
     where INSTRUCTIONS_CAPACITY_ID = #{instructionsCapacityId,jdbcType=DECIMAL}
   </update>
-  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
-    <include refid="select"/>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+    <include refid="select" />
     where INSTRUCTIONS_CAPACITY_ID = #{instructionsCapacityId,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 OMSSHIP_INSTRUCTIONS_CAPACITY
@@ -361,8 +403,8 @@
     INSERT_USERNAME, INSERT_TIME,
     UPDATE_USERNAME, UPDATE_TIME,
     INSERT_UPDATE_REMARK, INSTRUCTIONS_CAPACITY_STATUS,
-    DELETED, INSTRUCTION_ESARRIVAL_TIME
-    )
+    DELETED, INSTRUCTION_ESARRIVAL_TIME,
+    SHIP_DYNAMIC, LOAD_DETAILS)
     ( <foreach collection="list" item="item" separator="union all">
     select
     #{item.instructionsCapacityId,jdbcType=DECIMAL},
@@ -371,78 +413,86 @@
     #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
     #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
     #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.instructionsCapacityStatus,jdbcType=VARCHAR},
-    #{item.deleted,jdbcType=DECIMAL}, #{item.instructionEsarrivalTime,jdbcType=TIMESTAMP}
-    from dual
+    #{item.deleted,jdbcType=DECIMAL}, #{item.instructionEsarrivalTime,jdbcType=TIMESTAMP},
+    #{item.shipDynamic,jdbcType=VARCHAR}, #{item.loadDetails,jdbcType=VARCHAR} from dual
   </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
     update OMSSHIP_INSTRUCTIONS_CAPACITY
     set
     INSTRUCTIONS_CAPACITY_ID=
-    <foreach collection="list" item="item" index="index" separator=" " open="case INSTRUCTIONS_CAPACITY_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
       when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.instructionsCapacityId,jdbcType=DECIMAL}
     </foreach>
     ,INSTRUCTIONS_ID=
-    <foreach collection="list" item="item" index="index" separator=" " open="case INSTRUCTIONS_CAPACITY_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
       when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.instructionsId,jdbcType=DECIMAL}
     </foreach>
     ,CAPACITY_ID=
-    <foreach collection="list" item="item" index="index" separator=" " open="case INSTRUCTIONS_CAPACITY_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
       when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.capacityId,jdbcType=DECIMAL}
     </foreach>
     ,INSTRUCTION_PLANNED_LOADING=
-    <foreach collection="list" item="item" index="index" separator=" " open="case INSTRUCTIONS_CAPACITY_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
       when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.instructionPlannedLoading,jdbcType=DECIMAL}
     </foreach>
     ,INSTRUCTIONS_SHIP_POSITION=
-    <foreach collection="list" item="item" index="index" separator=" " open="case INSTRUCTIONS_CAPACITY_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
       when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.instructionsShipPosition,jdbcType=VARCHAR}
     </foreach>
     ,INSTRUCTION_CONTACT_INF=
-    <foreach collection="list" item="item" index="index" separator=" " open="case INSTRUCTIONS_CAPACITY_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
       when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.instructionContactInf,jdbcType=VARCHAR}
     </foreach>
     ,INSERT_USERNAME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case INSTRUCTIONS_CAPACITY_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
       when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
     </foreach>
     ,INSERT_TIME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case INSTRUCTIONS_CAPACITY_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
       when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
     </foreach>
     ,UPDATE_USERNAME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case INSTRUCTIONS_CAPACITY_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
       when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
     </foreach>
     ,UPDATE_TIME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case INSTRUCTIONS_CAPACITY_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
       when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
     </foreach>
     ,INSERT_UPDATE_REMARK=
-    <foreach collection="list" item="item" index="index" separator=" " open="case INSTRUCTIONS_CAPACITY_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
       when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
     </foreach>
     ,INSTRUCTIONS_CAPACITY_STATUS=
-    <foreach collection="list" item="item" index="index" separator=" " open="case INSTRUCTIONS_CAPACITY_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
       when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.instructionsCapacityStatus,jdbcType=VARCHAR}
     </foreach>
     ,DELETED=
-    <foreach collection="list" item="item" index="index" separator=" " open="case INSTRUCTIONS_CAPACITY_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
       when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
     </foreach>
     ,INSTRUCTION_ESARRIVAL_TIME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case INSTRUCTIONS_CAPACITY_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
       when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.instructionEsarrivalTime,jdbcType=TIMESTAMP}
     </foreach>
+    ,SHIP_DYNAMIC=
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
+      when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.shipDynamic,jdbcType=VARCHAR}
+    </foreach>
+    ,LOAD_DETAILS=
+    <foreach close="end" collection="list" index="index" item="item" open="case INSTRUCTIONS_CAPACITY_ID" separator=" ">
+      when #{item.instructionsCapacityId,jdbcType=DECIMAL} then #{item.loadDetails,jdbcType=VARCHAR}
+    </foreach>
     where INSTRUCTIONS_CAPACITY_ID in
-    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+    <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
       #{item.instructionsCapacityId,jdbcType=DECIMAL}
     </foreach>
   </update>
   <delete id="batchDelete" parameterType="java.util.List">
     delete from OMSSHIP_INSTRUCTIONS_CAPACITY
     where INSTRUCTIONS_CAPACITY_ID in
-    <foreach collection="list" item="id" open="(" close=")" separator=",">
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
       #{id}
     </foreach>
   </delete>

+ 43 - 0
src/main/resources/com/steerinfo/dil/mapper/ShipDynamicsMapper.xml

@@ -108,6 +108,7 @@
             </if>
         </where>
         GROUP BY rm.MATERIAL_NAME,DB.RESULT_FOREIGN_SHIP_NAME
+        ORDER BY rm.MATERIAL_NAME
     </select>
     <select id="getUnloadData" resultType="java.util.Map">
         --卸船明细
@@ -123,4 +124,46 @@
         WHERE TUSR.DELETED=0
         GROUP BY TTR.SHIP_STATUS
     </select>
+
+    <select id="getDownShipDynamaics" resultType="java.util.Map">
+        select
+        OSI.SHIPMENT_INSTRUCTIONS_ID "instructionsId",
+        OIC.INSTRUCTIONS_CAPACITY_ID "instructionsCapacityId",
+        RP.PORT_NAME "portName",
+        RM.MATERIAL_NAME || '(' || DB.RESULT_FOREIGN_SHIP_NAME || ')' || ADN.RESULT_NUMBER_OF_LOANS || '吨,' || TO_CHAR(ADN.NOTICE_DELIVERY_TIME,'YYYY-MM-DD') ||'放货' "productName",
+        WGM.GM_TONNAGE "gmTonnage",
+        RC.CAPACITY_NUMBER "capacityNumber",
+        oic.INSTRUCTION_PLANNED_LOADING "instructPlannedLoading",
+        oic.SHIP_DYNAMIC "shipDynamic",
+        oic.LOAD_DETAILS "loadDetails",
+        ADN.NOTICE_DELIVERY_TIME "noticeDeliveryTime"
+        from AMSSHIP_DELIVERY_NOTICE ADN
+             LEFT JOIN RMS_PORT RP
+                       ON RP.PORT_ID = ADN.PORT_ID
+             LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS OSI
+                       ON OSI.BATCH_ID = ADN.BATCH_ID
+             LEFT JOIN OMSSHIP_INSTRUCTIONS_CAPACITY OIC
+                       ON OIC.INSTRUCTIONS_ID = OSI.SHIPMENT_INSTRUCTIONS_ID
+             LEFT JOIN RMS_CAPACITY RC
+                       ON RC.CAPACITY_ID =OIC.CAPACITY_ID
+             LEFT JOIN DIL_BATCH_INFACOTRY DBI
+                       ON DBI.BATCH_INFACOTRY_ID = ADN.BATCH_ID
+             LEFT JOIN DIL_BATCH DB
+                       ON DB.BATCH_ID = DBI.BATCH_ID
+             left join RMS_MATERIAL RM
+                       ON RM.MATERIAL_ID = DB.MATERIAL_ID
+             LEFT JOIN WMSH_GRID_MATERIAL WGM
+                       ON WGM.BATCH_ID = DB.BATCH_ID
+        <where>
+            ADN.DELETED=0
+            <if test="input !=null and input.toString()!=''">
+                and  RC.CAPACITY_NUMBER || RP.PORT_NAME || DB.RESULT_FOREIGN_SHIP_NAME || rm.MATERIAL_NAME like concat('%',concat(#{input},'%'))
+            </if>
+            <if test="startDate != null">
+                and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=  ADN.NOTICE_DELIVERY_TIME
+                and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= ADN.NOTICE_DELIVERY_TIME
+            </if>
+        </where>
+        ORDER BY RP.PORT_NAME,ADN.NOTICE_DELIVERY_TIME DESC
+    </select>
 </mapper>