liyg 2 роки тому
батько
коміт
e3db653551

+ 29 - 0
src/main/java/com/steerinfo/dil/model/BmsshipContractPrice.java

@@ -74,6 +74,18 @@ public class BmsshipContractPrice implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="记录创建或修改备注",required=false)
     private String insertUpdateRemark;
 
+    /**
+     * 港口id(RESULT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="港口id",required=false)
+    private BigDecimal portId;
+
+    /**
+     * 船舶长度(RESULT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="船舶长度",required=false)
+    private BigDecimal shipLength;
+
     /**
      * 是否删除 ( 0:未删除 1:已删除)(DELETED,DECIMAL,9)
      */
@@ -188,6 +200,22 @@ public class BmsshipContractPrice implements IBasePO<BigDecimal> {
         this.deleted = deleted;
     }
 
+    public BigDecimal getPortId() {
+        return portId;
+    }
+
+    public void setPortId(BigDecimal portId) {
+        this.portId = portId;
+    }
+
+    public BigDecimal getShipLength() {
+        return shipLength;
+    }
+
+    public void setShipLength(BigDecimal shipLength) {
+        this.shipLength = shipLength;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -205,6 +233,7 @@ public class BmsshipContractPrice implements IBasePO<BigDecimal> {
         sb.append(", updateUsername=").append(updateUsername);
         sb.append(", updateTime=").append(updateTime);
         sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", portId=").append(portId);
         sb.append(", deleted=").append(deleted);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");

+ 6 - 0
src/main/java/com/steerinfo/dil/service/impl/BmsshipContractPriceServiceImpl.java

@@ -43,6 +43,7 @@ public class BmsshipContractPriceServiceImpl  implements IBmsshipContractPriceSe
         String personnelName = rmsPersonnelMapper.getPersonnelNameByUserId(userId);
         String remark =(String) mapValue.get("remark");
         String contractNo =(String) mapValue.get("contractNo");
+        BigDecimal portId=DataChange.dataToBigDecimal(mapValue.get("portId"));
         //判断是否存在相同的合同号
         BigDecimal conpareNo = bmsshipContractPriceMapper.contractNoCompare(contractNo);
         if (conpareNo!=null){
@@ -59,6 +60,7 @@ public class BmsshipContractPriceServiceImpl  implements IBmsshipContractPriceSe
         bmsshipContractPrice.setStartTime(new Date(startTime));
         bmsshipContractPrice.setEndTime(new Date(endTime));
         bmsshipContractPrice.setInsertTime(new Date());
+        bmsshipContractPrice.setPortId(portId);
         bmsshipContractPrice.setDeleted(new BigDecimal(0));
         if (personnelName!=null){
             bmsshipContractPrice.setInsertUsername(personnelName);
@@ -83,6 +85,7 @@ public class BmsshipContractPriceServiceImpl  implements IBmsshipContractPriceSe
         String userId =(String) mapValue.get("userId");
         String remark =(String) mapValue.get("remark");
         String contractNo =(String) mapValue.get("contractNo");
+        BigDecimal portId=DataChange.dataToBigDecimal(mapValue.get("portId"));
         //判断是否存在相同的合同号
         BigDecimal conpareNo = bmsshipContractPriceMapper.contractNoCompare(contractNo);
         if (conpareNo!=null&&!conpareNo.equals(resultId)){
@@ -104,6 +107,9 @@ public class BmsshipContractPriceServiceImpl  implements IBmsshipContractPriceSe
         bmsshipContractPrice.setEndTime(new Date(endTime));
         bmsshipContractPrice.setContractNo(contractNo);
         bmsshipContractPrice.setInsertUpdateRemark(remark);
+        if(portId!=null && portId.intValue()!=0){
+            bmsshipContractPrice.setPortId(portId);
+        }
         bmsshipContractPrice.setUnitPrice(unitPrice);
         return bmsshipContractPriceMapper.updateByPrimaryKeySelective(bmsshipContractPrice);
     }

+ 67 - 12
src/main/resources/com/steerinfo/dil/mapper/BmsshipContractPriceMapper.xml

@@ -13,15 +13,19 @@
     <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="PORT_ID" jdbcType="DECIMAL" property="portId" />
+    <result column="SHIP_LENGTH" jdbcType="DECIMAL" property="shipLength" />
     <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
   </resultMap>
   <sql id="columns">
     RESULT_ID, CONTRACT_NO, UNIT_PRICE, BATCH_ID, START_TIME, END_TIME, INSERT_USERNAME,
-    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED
+    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, PORT_ID, SHIP_LENGTH,
+    DELETED
   </sql>
   <sql id="columns_alias">
     t.RESULT_ID, t.CONTRACT_NO, t.UNIT_PRICE, t.BATCH_ID, t.START_TIME, t.END_TIME, t.INSERT_USERNAME,
-    t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED
+    t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.PORT_ID,
+    t.SHIP_LENGTH, t.DELETED
   </sql>
   <sql id="select">
     SELECT <include refid="columns" /> FROM BMSSHIP_CONTRACT_PRICE
@@ -64,6 +68,12 @@
       <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
         and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
       </if>
+      <if test="portId != null">
+        and PORT_ID = #{portId}
+      </if>
+      <if test="shipLength != null">
+        and SHIP_LENGTH = #{shipLength}
+      </if>
       <if test="deleted != null">
         and DELETED = #{deleted}
       </if>
@@ -104,6 +114,12 @@
       <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
         and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
       </if>
+      <if test="portId != null">
+        and PORT_ID = #{portId}
+      </if>
+      <if test="shipLength != null">
+        and SHIP_LENGTH = #{shipLength}
+      </if>
       <if test="deleted != null">
         and DELETED = #{deleted}
       </if>
@@ -146,6 +162,12 @@
     <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
       or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
     </if>
+    <if test="portId != null">
+      or PORT_ID = #{portId}
+    </if>
+    <if test="shipLength != null">
+      or SHIP_LENGTH = #{shipLength}
+    </if>
     <if test="deleted != null">
       or DELETED = #{deleted}
     </if>
@@ -154,13 +176,13 @@
     insert into BMSSHIP_CONTRACT_PRICE (RESULT_ID, CONTRACT_NO, UNIT_PRICE,
                                         BATCH_ID, START_TIME, END_TIME,
                                         INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
-                                        UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED
-    )
+                                        UPDATE_TIME, INSERT_UPDATE_REMARK, PORT_ID,
+                                        SHIP_LENGTH, DELETED)
     values (#{resultId,jdbcType=DECIMAL}, #{contractNo,jdbcType=VARCHAR}, #{unitPrice,jdbcType=DECIMAL},
             #{batchId,jdbcType=DECIMAL}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
             #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
-            #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}
-           )
+            #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{portId,jdbcType=DECIMAL},
+            #{shipLength,jdbcType=DECIMAL}, #{deleted,jdbcType=DECIMAL})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.BmsshipContractPrice">
     insert into BMSSHIP_CONTRACT_PRICE
@@ -198,6 +220,12 @@
       <if test="insertUpdateRemark != null">
         INSERT_UPDATE_REMARK,
       </if>
+      <if test="portId != null">
+        PORT_ID,
+      </if>
+      <if test="shipLength != null">
+        SHIP_LENGTH,
+      </if>
       <if test="deleted != null">
         DELETED,
       </if>
@@ -236,6 +264,12 @@
       <if test="insertUpdateRemark != null">
         #{insertUpdateRemark,jdbcType=VARCHAR},
       </if>
+      <if test="portId != null">
+        #{portId,jdbcType=DECIMAL},
+      </if>
+      <if test="shipLength != null">
+        #{shipLength,jdbcType=DECIMAL},
+      </if>
       <if test="deleted != null">
         #{deleted,jdbcType=DECIMAL},
       </if>
@@ -253,6 +287,8 @@
         UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
         UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
         INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+        PORT_ID = #{portId,jdbcType=DECIMAL},
+        SHIP_LENGTH = #{shipLength,jdbcType=DECIMAL},
         DELETED = #{deleted,jdbcType=DECIMAL}
     where RESULT_ID = #{resultId,jdbcType=DECIMAL}
   </update>
@@ -289,6 +325,12 @@
       <if test="insertUpdateRemark != null">
         INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
       </if>
+      <if test="portId != null">
+        PORT_ID = #{portId,jdbcType=DECIMAL},
+      </if>
+      <if test="shipLength != null">
+        SHIP_LENGTH = #{shipLength,jdbcType=DECIMAL},
+      </if>
       <if test="deleted != null">
         DELETED = #{deleted,jdbcType=DECIMAL},
       </if>
@@ -314,7 +356,8 @@
     START_TIME, END_TIME, INSERT_USERNAME,
     INSERT_TIME, UPDATE_USERNAME,
     UPDATE_TIME, INSERT_UPDATE_REMARK,
-    DELETED)
+    PORT_ID, SHIP_LENGTH, DELETED
+    )
     ( <foreach collection="list" item="item" separator="union all">
     select
     #{item.resultId,jdbcType=DECIMAL},
@@ -322,7 +365,8 @@
     #{item.startTime,jdbcType=TIMESTAMP}, #{item.endTime,jdbcType=TIMESTAMP}, #{item.insertUsername,jdbcType=VARCHAR},
     #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
     #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
-    #{item.deleted,jdbcType=DECIMAL} from dual
+    #{item.portId,jdbcType=DECIMAL}, #{item.shipLength,jdbcType=DECIMAL}, #{item.deleted,jdbcType=DECIMAL}
+    from dual
   </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
@@ -372,6 +416,14 @@
     <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
     </foreach>
+    ,PORT_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.portId,jdbcType=DECIMAL}
+    </foreach>
+    ,SHIP_LENGTH=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.shipLength,jdbcType=DECIMAL}
+    </foreach>
     ,DELETED=
     <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
@@ -404,11 +456,14 @@
     BCP.CONTRACT_NO "contractNo",
     BCP.START_TIME "startTime",
     BCP.END_TIME "endTime",
-    BCP.UNIT_PRICE "unitPrice"
+    BCP.UNIT_PRICE "unitPrice",
+    RP.PORT_NAME "portName"
     from BMSSHIP_CONTRACT_PRICE BCP
+    left join RMS_PORT RP
+    on BCP.PORT_ID=RP.PORT_ID
     where  BCP.DELETED=0
     <if test="con!=null">
-     AND instr(BCP.CONTRACT_NO,#{con}) > 0
+      AND instr(BCP.CONTRACT_NO,#{con}) > 0
     </if>
     <if test="startDate != null">
       and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=   BCP.END_TIME
@@ -420,9 +475,9 @@
             BCP.START_TIME "startTime",
             BCP.END_TIME "endTime",
             BCP.UNIT_PRICE "unitPrice",
-            BCP.RESULT_ID "resultId"
+            BCP.RESULT_ID "resultId",
+            BCP.PORT_ID "portID"
     from BMSSHIP_CONTRACT_PRICE BCP
     WHERE  BCP.RESULT_ID =#{resultId}
   </select>
-
 </mapper>