瀏覽代碼

转移承运单位字段

liyg 3 年之前
父節點
當前提交
f0ef3a8c4f

+ 2 - 6
pom.xml

@@ -111,12 +111,8 @@
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-<<<<<<< HEAD
-                        <param>RMS_CAPACITY</param>
-=======
-                        <param>TMSSHIP_WATER_QUALITY_RESULT</param>
-                        <param></param>
->>>>>>> 42f2b387e811a0965c1c2783a5628f720bf8a7b5
+                        <param>AMSSHIP_DELIVERY_ATTORNEY</param>
+                        <param>AMSSHIP_DELIVERY_NOTICE</param>
                     </tables>
                 </configuration>
                 <executions>

+ 30 - 0
src/main/java/com/steerinfo/dil/model/AmsshipDeliveryAttorney.java

@@ -21,6 +21,18 @@ public class AmsshipDeliveryAttorney implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="批次ID",required=false)
     private BigDecimal batchId;
 
+    /**
+     * 委托单位ID(REQUESTER_GROUP_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="委托单位ID",required=false)
+    private BigDecimal requesterGroupId;
+
+    /**
+     * 承运单位ID(CARRIER_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="承运单位ID",required=false)
+    private BigDecimal carrierId;
+
     /**
      * 物流流向即到站港(PORT_ID,DECIMAL,0)
      */
@@ -135,6 +147,22 @@ public class AmsshipDeliveryAttorney implements IBasePO<BigDecimal> {
         this.batchId = batchId;
     }
 
+    public BigDecimal getRequesterGroupId() {
+        return requesterGroupId;
+    }
+
+    public void setRequesterGroupId(BigDecimal requesterGroupId) {
+        this.requesterGroupId = requesterGroupId;
+    }
+
+    public BigDecimal getCarrierId() {
+        return carrierId;
+    }
+
+    public void setCarrierId(BigDecimal carrierId) {
+        this.carrierId = carrierId;
+    }
+
     public BigDecimal getPortId() {
         return portId;
     }
@@ -271,6 +299,8 @@ public class AmsshipDeliveryAttorney implements IBasePO<BigDecimal> {
         sb.append("Hash = ").append(hashCode());
         sb.append(", attorneyId=").append(attorneyId);
         sb.append(", batchId=").append(batchId);
+        sb.append(", requesterGroupId=").append(requesterGroupId);
+        sb.append(", carrierId=").append(carrierId);
         sb.append(", portId=").append(portId);
         sb.append(", downSwimPortId=").append(downSwimPortId);
         sb.append(", attorneyPickupContactPerson=").append(attorneyPickupContactPerson);

+ 0 - 28
src/main/java/com/steerinfo/dil/model/AmsshipDeliveryNotice.java

@@ -15,17 +15,6 @@ public class AmsshipDeliveryNotice implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="放货通知单ID",required=true)
     private BigDecimal noticeId;
 
-    /**
-     * 委托单位ID(REQUESTER_GROUP_ID,DECIMAL,0)
-     */
-    @ApiModelProperty(value="委托单位ID",required=false)
-    private BigDecimal requesterGroupId;
-
-    /**
-     * 承运单位ID(CARRIER_ID,DECIMAL,0)
-     */
-    @ApiModelProperty(value="承运单位ID",required=false)
-    private BigDecimal carrierId;
 
     /**
      * 贸易方式(NOTICE_COMMERCE_METHOD,VARCHAR,20)
@@ -257,21 +246,6 @@ public class AmsshipDeliveryNotice implements IBasePO<BigDecimal> {
         this.noticeId = noticeId;
     }
 
-    public BigDecimal getRequesterGroupId() {
-        return requesterGroupId;
-    }
-
-    public void setRequesterGroupId(BigDecimal requesterGroupId) {
-        this.requesterGroupId = requesterGroupId;
-    }
-
-    public BigDecimal getCarrierId() {
-        return carrierId;
-    }
-
-    public void setCarrierId(BigDecimal carrierId) {
-        this.carrierId = carrierId;
-    }
 
     public String getNoticeCommerceMethod() {
         return noticeCommerceMethod;
@@ -560,8 +534,6 @@ public class AmsshipDeliveryNotice implements IBasePO<BigDecimal> {
         sb.append(" [");
         sb.append("Hash = ").append(hashCode());
         sb.append(", noticeId=").append(noticeId);
-        sb.append(", requesterGroupId=").append(requesterGroupId);
-        sb.append(", carrierId=").append(carrierId);
         sb.append(", noticeCommerceMethod=").append(noticeCommerceMethod);
         sb.append(", noticeHandoverMethod=").append(noticeHandoverMethod);
         sb.append(", portId=").append(portId);

+ 11 - 0
src/main/java/com/steerinfo/dil/service/impl/AmsshipDeliveryAttorneyServiceImpl.java

@@ -54,6 +54,13 @@ public class AmsshipDeliveryAttorneyServiceImpl implements IAmsshipDeliveryAttor
         if (userId!=null){
              userName = amsshipCargoTransferResultMapper.getUserNameByUserId(userId);
         }
+        //新增承运商
+        if (map.get("carrierId")!=null) {
+            amsshipDeliveryAttorney.setCarrierId(DataChange.dataToBigDecimal(map.get("carrierId")));
+        }
+        if (map.get("requesterGroupId")!=null) {
+            amsshipDeliveryAttorney.setRequesterGroupId(DataChange.dataToBigDecimal(map.get("requesterGroupId")));
+        }
         amsshipDeliveryAttorney.setAttorenyPickupIdcard((String) map.get("attorenyPickupIdcard"));
         amsshipDeliveryAttorney.setAttorneyContactTelephone((String) map.get("attorneyContactTelephone"));
         amsshipDeliveryAttorney.setBatchId(DataChange.dataToBigDecimal(map.get("batchId")));
@@ -150,6 +157,8 @@ public class AmsshipDeliveryAttorneyServiceImpl implements IAmsshipDeliveryAttor
     @Override
     public int modifyDeliveryAttroney(Map<String, Object> amsshipDeliveryAttorney) {
         BigDecimal resultId = DataChange.dataToBigDecimal(amsshipDeliveryAttorney.get("resultId"));
+        BigDecimal requesterGroupId =DataChange.dataToBigDecimal(amsshipDeliveryAttorney.get("requesterGroupId"));
+        BigDecimal carrierId =DataChange.dataToBigDecimal(amsshipDeliveryAttorney.get("carrierId"));
         BigDecimal portId = DataChange.dataToBigDecimal(amsshipDeliveryAttorney.get("portId"));
         String attorneyContactTelephone = (String)amsshipDeliveryAttorney.get("attorneyContactTelephone");
         String attorenyPickupIdcard =(String) amsshipDeliveryAttorney.get("attorenyPickupIdcard");
@@ -158,6 +167,8 @@ public class AmsshipDeliveryAttorneyServiceImpl implements IAmsshipDeliveryAttor
         long attorneyTime = (long)amsshipDeliveryAttorney.get("attorneyTime");
         AmsshipDeliveryAttorney amsshipDeliveryAttorney1=new AmsshipDeliveryAttorney();
         amsshipDeliveryAttorney1.setAttorneyId(resultId);
+        amsshipDeliveryAttorney1.setRequesterGroupId(requesterGroupId);
+        amsshipDeliveryAttorney1.setCarrierId(carrierId);
         amsshipDeliveryAttorney1.setPortId(portId);
         amsshipDeliveryAttorney1.setAttorneyContactTelephone(attorneyContactTelephone);
         amsshipDeliveryAttorney1.setAttorneyPickupContactPerson(attorneyPickupContactPerson);

+ 2 - 15
src/main/java/com/steerinfo/dil/service/impl/AmsshipDeliveryNoticeServiceImpl.java

@@ -69,13 +69,7 @@ public class AmsshipDeliveryNoticeServiceImpl implements IAmsshipDeliveryNoticeS
         }
         BigDecimal noticeId = amsshipDeliveryNoticeMapper.selectNoticeId();
         amsshipDeliveryNotice.setNoticeId(noticeId);
-        //新增承运商
-        if (map.get("carrierId")!=null) {
-            amsshipDeliveryNotice.setCarrierId(DataChange.dataToBigDecimal(map.get("carrierId")));
-        }
-        if (map.get("requesterGroupId")!=null) {
-            amsshipDeliveryNotice.setRequesterGroupId(DataChange.dataToBigDecimal(map.get("requesterGroupId")));
-        }
+
         amsshipDeliveryNotice.setNoticeCommerceMethod((String) map.get("noticeCommerceMethod"));
         amsshipDeliveryNotice.setNoticeHandoverMethod((String) map.get("noticeHandoverMethod"));
         if (map.get("portId")!=null) {
@@ -222,14 +216,7 @@ public class AmsshipDeliveryNoticeServiceImpl implements IAmsshipDeliveryNoticeS
         if (map.get("noticeId")!=null) {
             amsshipDeliveryNotice.setNoticeId(noticeId);
         }
-        BigDecimal carrierId =DataChange.dataToBigDecimal(map.get("carrierId"));
-        if (map.get("carrierId")!=null) {
-            amsshipDeliveryNotice.setCarrierId(carrierId);
-        }
-        BigDecimal requesterGroupId =DataChange.dataToBigDecimal(map.get("requesterGroupId"));
-        if (map.get("requesterGroupId")!=null) {
-            amsshipDeliveryNotice.setRequesterGroupId(requesterGroupId);
-        }
+
         //贸易方式
         if (map.get("noticeCommerceMethod")!=null) {
             amsshipDeliveryNotice.setNoticeHandoverMethod((String) map.get("noticeCommerceMethod"));

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

@@ -146,6 +146,7 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
         tmsshipEntryWharyResult.setResultPortDeclarationName((String) map.get("resultOutWharyName"));
         tmsshipLoadShipResult.setResultActualInstallations(resultActualInstallations);
         tmsshipLoadShipResult.setResultNumber(resultNumber);
+        tmsshipLoadShipResult.setInsertUpdateRemark(resultMemo);
         // 设置常规字段
         tmsshipLoadShipResult.setInsertTime(new Date());
         tmsshipLoadShipResult.setInsertUsername(userId);

+ 2 - 2
src/main/resources/application-dev.yml

@@ -11,9 +11,9 @@ spring:
 
 openfeign:
   WmshboundFeign:
-    url: ${WMSHBOUNDFEIGN_URL:172.16.33.166:8070}
+    url: ${WMSHBOUNDFEIGN_URL:172.16.33.161:8070}
   ColumnDataFeign:
-    url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
+    url: ${COLUMNDATAFEIGN_URL:172.16.33.161:8083}
 
 server:
   port: 8003

+ 2 - 2
src/main/resources/application-prod.yml

@@ -24,9 +24,9 @@ spring:
 
 openfeign:
   WmshboundFeign:
-    url: ${WMSHBOUNDFEIGN_URL:172.16.33.166:8070}
+    url: ${WMSHBOUNDFEIGN_URL:172.16.33.161:8070}
   ColumnDataFeign:
-    url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
+    url: ${COLUMNDATAFEIGN_URL:172.16.33.161:8083}
 
 server:
   port: 8090

+ 747 - 695
src/main/resources/com/steerinfo/dil/mapper/AmsshipDeliveryAttorneyMapper.xml

@@ -1,707 +1,759 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.steerinfo.dil.mapper.AmsshipDeliveryAttorneyMapper">
-    <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmsshipDeliveryAttorney">
-        <id column="ATTORNEY_ID" jdbcType="DECIMAL" property="attorneyId" />
-        <result column="BATCH_ID" jdbcType="DECIMAL" property="batchId" />
-        <result column="PORT_ID" jdbcType="DECIMAL" property="portId" />
-        <result column="DOWN_SWIM_PORT_ID" jdbcType="DECIMAL" property="downSwimPortId" />
-        <result column="ATTORNEY_PICKUP_CONTACT_PERSON" jdbcType="VARCHAR" property="attorneyPickupContactPerson" />
-        <result column="ATTORENY_PICKUP_IDCARD" jdbcType="VARCHAR" property="attorenyPickupIdcard" />
-        <result column="ATTORNEY_CONTACT_TELEPHONE" jdbcType="VARCHAR" property="attorneyContactTelephone" />
-        <result column="ATTORNEY_TIME" jdbcType="TIMESTAMP" property="attorneyTime" />
-        <result column="ATTORNEY_PDFFILE" jdbcType="VARCHAR" property="attorneyPdffile" />
-        <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
-        <result column="DELETE_TIME" jdbcType="VARCHAR" property="deleteTime" />
-        <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="ATTORNEY_DISTRIBUTION_STATUS" jdbcType="DECIMAL" property="attorneyDistributionStatus" />
-    </resultMap>
-    <sql id="columns">
-        ATTORNEY_ID, BATCH_ID, PORT_ID, DOWN_SWIM_PORT_ID, ATTORNEY_PICKUP_CONTACT_PERSON, 
-    ATTORENY_PICKUP_IDCARD, ATTORNEY_CONTACT_TELEPHONE, ATTORNEY_TIME, ATTORNEY_PDFFILE, 
-    DELETE_NAME, DELETE_TIME, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, 
-    INSERT_UPDATE_REMARK, DELETED, ATTORNEY_DISTRIBUTION_STATUS
-    </sql>
-    <sql id="columns_alias">
-        t.ATTORNEY_ID, t.BATCH_ID, t.PORT_ID, t.DOWN_SWIM_PORT_ID, t.ATTORNEY_PICKUP_CONTACT_PERSON, 
-    t.ATTORENY_PICKUP_IDCARD, t.ATTORNEY_CONTACT_TELEPHONE, t.ATTORNEY_TIME, t.ATTORNEY_PDFFILE, 
-    t.DELETE_NAME, t.DELETE_TIME, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, 
-    t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.ATTORNEY_DISTRIBUTION_STATUS
-    </sql>
-    <sql id="select">
-        SELECT <include refid="columns" /> FROM AMSSHIP_DELIVERY_ATTORNEY
-    </sql>
-    <sql id="select_alias">
-        SELECT <include refid="columns_alias" /> FROM AMSSHIP_DELIVERY_ATTORNEY t
-    </sql>
-    <sql id="where">
-        <where>
-            <if test="attorneyId != null">
-                and ATTORNEY_ID = #{attorneyId}
-            </if>
-            <if test="batchId != null">
-                and BATCH_ID = #{batchId}
-            </if>
-            <if test="portId != null">
-                and PORT_ID = #{portId}
-            </if>
-            <if test="downSwimPortId != null">
-                and DOWN_SWIM_PORT_ID = #{downSwimPortId}
-            </if>
-            <if test="attorneyPickupContactPerson != null and attorneyPickupContactPerson != ''">
-                and ATTORNEY_PICKUP_CONTACT_PERSON = #{attorneyPickupContactPerson}
-            </if>
-            <if test="attorenyPickupIdcard != null and attorenyPickupIdcard != ''">
-                and ATTORENY_PICKUP_IDCARD = #{attorenyPickupIdcard}
-            </if>
-            <if test="attorneyContactTelephone != null and attorneyContactTelephone != ''">
-                and ATTORNEY_CONTACT_TELEPHONE = #{attorneyContactTelephone}
-            </if>
-            <if test="attorneyTime != null">
-                and TO_CHAR(ATTORNEY_TIME,'yyyy-MM-dd') = #{attorneyTime}
-            </if>
-            <if test="attorneyPdffile != null and attorneyPdffile != ''">
-                and ATTORNEY_PDFFILE = #{attorneyPdffile}
-            </if>
-            <if test="deleteName != null and deleteName != ''">
-                and DELETE_NAME = #{deleteName}
-            </if>
-            <if test="deleteTime != null and deleteTime != ''">
-                and DELETE_TIME = #{deleteTime}
-            </if>
-            <if test="insertUsername != null and insertUsername != ''">
-                and INSERT_USERNAME = #{insertUsername}
-            </if>
-            <if test="insertTime != null">
-                and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
-            </if>
-            <if test="updateUsername != null and updateUsername != ''">
-                and UPDATE_USERNAME = #{updateUsername}
-            </if>
-            <if test="updateTime != null">
-                and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
-            </if>
-            <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
-                and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
-            </if>
-            <if test="deleted != null">
-                and DELETED = #{deleted}
-            </if>
-            <if test="attorneyDistributionStatus != null">
-                and ATTORNEY_DISTRIBUTION_STATUS = #{attorneyDistributionStatus}
-            </if>
-        </where>
-    </sql>
-    <sql id="whereLike">
-        <where>
-            <if test="attorneyId != null">
-                and ATTORNEY_ID = #{attorneyId}
-            </if>
-            <if test="batchId != null">
-                and BATCH_ID = #{batchId}
-            </if>
-            <if test="portId != null">
-                and PORT_ID = #{portId}
-            </if>
-            <if test="downSwimPortId != null">
-                and DOWN_SWIM_PORT_ID = #{downSwimPortId}
-            </if>
-            <if test="attorneyPickupContactPerson != null and attorneyPickupContactPerson != ''">
-                and ATTORNEY_PICKUP_CONTACT_PERSON LIKE '%${attorneyPickupContactPerson}%'
-            </if>
-            <if test="attorenyPickupIdcard != null and attorenyPickupIdcard != ''">
-                and ATTORENY_PICKUP_IDCARD LIKE '%${attorenyPickupIdcard}%'
-            </if>
-            <if test="attorneyContactTelephone != null and attorneyContactTelephone != ''">
-                and ATTORNEY_CONTACT_TELEPHONE LIKE '%${attorneyContactTelephone}%'
-            </if>
-            <if test="attorneyTime != null">
-                and TO_CHAR(ATTORNEY_TIME,'yyyy-MM-dd') = #{attorneyTime}
-            </if>
-            <if test="attorneyPdffile != null and attorneyPdffile != ''">
-                and ATTORNEY_PDFFILE LIKE '%${attorneyPdffile}%'
-            </if>
-            <if test="deleteName != null and deleteName != ''">
-                and DELETE_NAME LIKE '%${deleteName}%'
-            </if>
-            <if test="deleteTime != null and deleteTime != ''">
-                and DELETE_TIME LIKE '%${deleteTime}%'
-            </if>
-            <if test="insertUsername != null and insertUsername != ''">
-                and INSERT_USERNAME LIKE '%${insertUsername}%'
-            </if>
-            <if test="insertTime != null">
-                and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
-            </if>
-            <if test="updateUsername != null and updateUsername != ''">
-                and UPDATE_USERNAME LIKE '%${updateUsername}%'
-            </if>
-            <if test="updateTime != null">
-                and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
-            </if>
-            <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
-                and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
-            </if>
-            <if test="deleted != null">
-                and DELETED = #{deleted}
-            </if>
-            <if test="attorneyDistributionStatus != null">
-                and ATTORNEY_DISTRIBUTION_STATUS = #{attorneyDistributionStatus}
-            </if>
-        </where>
-    </sql>
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
-        delete from AMSSHIP_DELIVERY_ATTORNEY
-        where ATTORNEY_ID = #{attorneyId,jdbcType=DECIMAL}
-    </delete>
-    <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
-        delete from AMSSHIP_DELIVERY_ATTORNEY
-        where 1!=1
-        <if test="batchId != null">
-            or BATCH_ID = #{batchId}
-        </if>
-        <if test="portId != null">
-            or PORT_ID = #{portId}
-        </if>
-        <if test="downSwimPortId != null">
-            or DOWN_SWIM_PORT_ID = #{downSwimPortId}
-        </if>
-        <if test="attorneyPickupContactPerson != null and attorneyPickupContactPerson != ''">
-            or ATTORNEY_PICKUP_CONTACT_PERSON = #{attorneyPickupContactPerson}
-        </if>
-        <if test="attorenyPickupIdcard != null and attorenyPickupIdcard != ''">
-            or ATTORENY_PICKUP_IDCARD = #{attorenyPickupIdcard}
-        </if>
-        <if test="attorneyContactTelephone != null and attorneyContactTelephone != ''">
-            or ATTORNEY_CONTACT_TELEPHONE = #{attorneyContactTelephone}
-        </if>
-        <if test="attorneyTime != null">
-            or TO_CHAR(ATTORNEY_TIME,'yyyy-MM-dd') = '#{attorneyTime}'
-        </if>
-        <if test="attorneyPdffile != null and attorneyPdffile != ''">
-            or ATTORNEY_PDFFILE = #{attorneyPdffile}
-        </if>
-        <if test="deleteName != null and deleteName != ''">
-            or DELETE_NAME = #{deleteName}
-        </if>
-        <if test="deleteTime != null and deleteTime != ''">
-            or DELETE_TIME = #{deleteTime}
-        </if>
-        <if test="insertUsername != null and insertUsername != ''">
-            or INSERT_USERNAME = #{insertUsername}
-        </if>
-        <if test="insertTime != null">
-            or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
-        </if>
-        <if test="updateUsername != null and updateUsername != ''">
-            or UPDATE_USERNAME = #{updateUsername}
-        </if>
-        <if test="updateTime != null">
-            or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
-        </if>
-        <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
-            or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
-        </if>
-        <if test="deleted != null">
-            or DELETED = #{deleted}
-        </if>
-        <if test="attorneyDistributionStatus != null">
-            or ATTORNEY_DISTRIBUTION_STATUS = #{attorneyDistributionStatus}
-        </if>
-    </delete>
-    <insert id="insert" parameterType="com.steerinfo.dil.model.AmsshipDeliveryAttorney">
-        insert into AMSSHIP_DELIVERY_ATTORNEY (ATTORNEY_ID, BATCH_ID, PORT_ID,
-                                               DOWN_SWIM_PORT_ID, ATTORNEY_PICKUP_CONTACT_PERSON,
-                                               ATTORENY_PICKUP_IDCARD, ATTORNEY_CONTACT_TELEPHONE,
-                                               ATTORNEY_TIME, ATTORNEY_PDFFILE, DELETE_NAME,
-                                               DELETE_TIME, INSERT_USERNAME, INSERT_TIME,
-                                               UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
-                                               DELETED, ATTORNEY_DISTRIBUTION_STATUS)
-        values (#{attorneyId,jdbcType=DECIMAL}, #{batchId,jdbcType=DECIMAL}, #{portId,jdbcType=DECIMAL},
-                #{downSwimPortId,jdbcType=DECIMAL}, #{attorneyPickupContactPerson,jdbcType=VARCHAR},
-                #{attorenyPickupIdcard,jdbcType=VARCHAR}, #{attorneyContactTelephone,jdbcType=VARCHAR},
-                #{attorneyTime,jdbcType=TIMESTAMP}, #{attorneyPdffile,jdbcType=VARCHAR}, #{deleteName,jdbcType=VARCHAR},
-                #{deleteTime,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
-                #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
-                #{deleted,jdbcType=DECIMAL}, #{attorneyDistributionStatus,jdbcType=DECIMAL})
-    </insert>
-    <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsshipDeliveryAttorney">
-        insert into AMSSHIP_DELIVERY_ATTORNEY
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="attorneyId != null">
-                ATTORNEY_ID,
-            </if>
-            <if test="batchId != null">
-                BATCH_ID,
-            </if>
-            <if test="portId != null">
-                PORT_ID,
-            </if>
-            <if test="downSwimPortId != null">
-                DOWN_SWIM_PORT_ID,
-            </if>
-            <if test="attorneyPickupContactPerson != null">
-                ATTORNEY_PICKUP_CONTACT_PERSON,
-            </if>
-            <if test="attorenyPickupIdcard != null">
-                ATTORENY_PICKUP_IDCARD,
-            </if>
-            <if test="attorneyContactTelephone != null">
-                ATTORNEY_CONTACT_TELEPHONE,
-            </if>
-            <if test="attorneyTime != null">
-                ATTORNEY_TIME,
-            </if>
-            <if test="attorneyPdffile != null">
-                ATTORNEY_PDFFILE,
-            </if>
-            <if test="deleteName != null">
-                DELETE_NAME,
-            </if>
-            <if test="deleteTime != null">
-                DELETE_TIME,
-            </if>
-            <if test="insertUsername != null">
-                INSERT_USERNAME,
-            </if>
-            <if test="insertTime != null">
-                INSERT_TIME,
-            </if>
-            <if test="updateUsername != null">
-                UPDATE_USERNAME,
-            </if>
-            <if test="updateTime != null">
-                UPDATE_TIME,
-            </if>
-            <if test="insertUpdateRemark != null">
-                INSERT_UPDATE_REMARK,
-            </if>
-            <if test="deleted != null">
-                DELETED,
-            </if>
-            <if test="attorneyDistributionStatus != null">
-                ATTORNEY_DISTRIBUTION_STATUS,
-            </if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="attorneyId != null">
-                #{attorneyId,jdbcType=DECIMAL},
-            </if>
-            <if test="batchId != null">
-                #{batchId,jdbcType=DECIMAL},
-            </if>
-            <if test="portId != null">
-                #{portId,jdbcType=DECIMAL},
-            </if>
-            <if test="downSwimPortId != null">
-                #{downSwimPortId,jdbcType=DECIMAL},
-            </if>
-            <if test="attorneyPickupContactPerson != null">
-                #{attorneyPickupContactPerson,jdbcType=VARCHAR},
-            </if>
-            <if test="attorenyPickupIdcard != null">
-                #{attorenyPickupIdcard,jdbcType=VARCHAR},
-            </if>
-            <if test="attorneyContactTelephone != null">
-                #{attorneyContactTelephone,jdbcType=VARCHAR},
-            </if>
-            <if test="attorneyTime != null">
-                #{attorneyTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="attorneyPdffile != null">
-                #{attorneyPdffile,jdbcType=VARCHAR},
-            </if>
-            <if test="deleteName != null">
-                #{deleteName,jdbcType=VARCHAR},
-            </if>
-            <if test="deleteTime != null">
-                #{deleteTime,jdbcType=VARCHAR},
-            </if>
-            <if test="insertUsername != null">
-                #{insertUsername,jdbcType=VARCHAR},
-            </if>
-            <if test="insertTime != null">
-                #{insertTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="updateUsername != null">
-                #{updateUsername,jdbcType=VARCHAR},
-            </if>
-            <if test="updateTime != null">
-                #{updateTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="insertUpdateRemark != null">
-                #{insertUpdateRemark,jdbcType=VARCHAR},
-            </if>
-            <if test="deleted != null">
-                #{deleted,jdbcType=DECIMAL},
-            </if>
-            <if test="attorneyDistributionStatus != null">
-                #{attorneyDistributionStatus,jdbcType=DECIMAL},
-            </if>
-        </trim>
-    </insert>
-    <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsshipDeliveryAttorney">
-        update AMSSHIP_DELIVERY_ATTORNEY
-        set BATCH_ID = #{batchId,jdbcType=DECIMAL},
-            PORT_ID = #{portId,jdbcType=DECIMAL},
-            DOWN_SWIM_PORT_ID = #{downSwimPortId,jdbcType=DECIMAL},
-            ATTORNEY_PICKUP_CONTACT_PERSON = #{attorneyPickupContactPerson,jdbcType=VARCHAR},
-            ATTORENY_PICKUP_IDCARD = #{attorenyPickupIdcard,jdbcType=VARCHAR},
-            ATTORNEY_CONTACT_TELEPHONE = #{attorneyContactTelephone,jdbcType=VARCHAR},
-            ATTORNEY_TIME = #{attorneyTime,jdbcType=TIMESTAMP},
-            ATTORNEY_PDFFILE = #{attorneyPdffile,jdbcType=VARCHAR},
-            DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
-            DELETE_TIME = #{deleteTime,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},
-            DELETED = #{deleted,jdbcType=DECIMAL},
-            ATTORNEY_DISTRIBUTION_STATUS = #{attorneyDistributionStatus,jdbcType=DECIMAL}
-        where ATTORNEY_ID = #{attorneyId,jdbcType=DECIMAL}
-    </update>
-    <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsshipDeliveryAttorney">
-        update AMSSHIP_DELIVERY_ATTORNEY
-        <set>
-            <if test="batchId != null">
-                BATCH_ID = #{batchId,jdbcType=DECIMAL},
-            </if>
-            <if test="portId != null">
-                PORT_ID = #{portId,jdbcType=DECIMAL},
-            </if>
-            <if test="downSwimPortId != null">
-                DOWN_SWIM_PORT_ID = #{downSwimPortId,jdbcType=DECIMAL},
-            </if>
-            <if test="attorneyPickupContactPerson != null">
-                ATTORNEY_PICKUP_CONTACT_PERSON = #{attorneyPickupContactPerson,jdbcType=VARCHAR},
-            </if>
-            <if test="attorenyPickupIdcard != null">
-                ATTORENY_PICKUP_IDCARD = #{attorenyPickupIdcard,jdbcType=VARCHAR},
-            </if>
-            <if test="attorneyContactTelephone != null">
-                ATTORNEY_CONTACT_TELEPHONE = #{attorneyContactTelephone,jdbcType=VARCHAR},
-            </if>
-            <if test="attorneyTime != null">
-                ATTORNEY_TIME = #{attorneyTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="attorneyPdffile != null">
-                ATTORNEY_PDFFILE = #{attorneyPdffile,jdbcType=VARCHAR},
-            </if>
-            <if test="deleteName != null">
-                DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
-            </if>
-            <if test="deleteTime != null">
-                DELETE_TIME = #{deleteTime,jdbcType=VARCHAR},
-            </if>
-            <if test="insertUsername != null">
-                INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
-            </if>
-            <if test="insertTime != null">
-                INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="updateUsername != null">
-                UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
-            </if>
-            <if test="updateTime != null">
-                UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="insertUpdateRemark != null">
-                INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
-            </if>
-            <if test="deleted != null">
-                DELETED = #{deleted,jdbcType=DECIMAL},
-            </if>
-            <if test="attorneyDistributionStatus != null">
-                ATTORNEY_DISTRIBUTION_STATUS = #{attorneyDistributionStatus,jdbcType=DECIMAL},
-            </if>
-        </set>
-        where ATTORNEY_ID = #{attorneyId,jdbcType=DECIMAL}
-    </update>
-    <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
-        <include refid="select" />
-        where ATTORNEY_ID = #{attorneyId,jdbcType=DECIMAL}
-    </select>
-    <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-        <include refid="select" />
-        <include refid="where" />
-    </select>
-    <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-        <include refid="select" />
-        <include refid="whereLike" />
-    </select>
-    <insert id="batchInsert" parameterType="java.util.List">
-        insert into AMSSHIP_DELIVERY_ATTORNEY
-        (ATTORNEY_ID,
-        BATCH_ID, PORT_ID, DOWN_SWIM_PORT_ID,
-        ATTORNEY_PICKUP_CONTACT_PERSON, ATTORENY_PICKUP_IDCARD,
-        ATTORNEY_CONTACT_TELEPHONE, ATTORNEY_TIME,
-        ATTORNEY_PDFFILE, DELETE_NAME,
-        DELETE_TIME, INSERT_USERNAME, INSERT_TIME,
-        UPDATE_USERNAME, UPDATE_TIME,
-        INSERT_UPDATE_REMARK, DELETED,
-        ATTORNEY_DISTRIBUTION_STATUS)
-        ( <foreach collection="list" item="item" separator="union all">
-        select
-        #{item.attorneyId,jdbcType=DECIMAL},
-        #{item.batchId,jdbcType=DECIMAL}, #{item.portId,jdbcType=DECIMAL}, #{item.downSwimPortId,jdbcType=DECIMAL},
-        #{item.attorneyPickupContactPerson,jdbcType=VARCHAR}, #{item.attorenyPickupIdcard,jdbcType=VARCHAR},
-        #{item.attorneyContactTelephone,jdbcType=VARCHAR}, #{item.attorneyTime,jdbcType=TIMESTAMP},
-        #{item.attorneyPdffile,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR},
-        #{item.deleteTime,jdbcType=VARCHAR}, #{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.attorneyDistributionStatus,jdbcType=DECIMAL} from dual
-    </foreach> )
-    </insert>
-    <update id="batchUpdate" parameterType="java.util.List">
-        update AMSSHIP_DELIVERY_ATTORNEY
-        set
-        ATTORNEY_ID=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyId,jdbcType=DECIMAL}
-        </foreach>
-        ,BATCH_ID=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
-        </foreach>
-        ,PORT_ID=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.portId,jdbcType=DECIMAL}
-        </foreach>
-        ,DOWN_SWIM_PORT_ID=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.downSwimPortId,jdbcType=DECIMAL}
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmsshipDeliveryAttorney">
+    <id column="ATTORNEY_ID" jdbcType="DECIMAL" property="attorneyId" />
+    <result column="BATCH_ID" jdbcType="DECIMAL" property="batchId" />
+    <result column="REQUESTER_GROUP_ID" jdbcType="DECIMAL" property="requesterGroupId" />
+    <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
+    <result column="PORT_ID" jdbcType="DECIMAL" property="portId" />
+    <result column="DOWN_SWIM_PORT_ID" jdbcType="DECIMAL" property="downSwimPortId" />
+    <result column="ATTORNEY_PICKUP_CONTACT_PERSON" jdbcType="VARCHAR" property="attorneyPickupContactPerson" />
+    <result column="ATTORENY_PICKUP_IDCARD" jdbcType="VARCHAR" property="attorenyPickupIdcard" />
+    <result column="ATTORNEY_CONTACT_TELEPHONE" jdbcType="VARCHAR" property="attorneyContactTelephone" />
+    <result column="ATTORNEY_TIME" jdbcType="TIMESTAMP" property="attorneyTime" />
+    <result column="ATTORNEY_PDFFILE" jdbcType="VARCHAR" property="attorneyPdffile" />
+    <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
+    <result column="DELETE_TIME" jdbcType="VARCHAR" property="deleteTime" />
+    <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="ATTORNEY_DISTRIBUTION_STATUS" jdbcType="DECIMAL" property="attorneyDistributionStatus" />
+  </resultMap>
+  <sql id="columns">
+    ATTORNEY_ID, BATCH_ID, REQUESTER_GROUP_ID, CARRIER_ID, PORT_ID, DOWN_SWIM_PORT_ID, 
+    ATTORNEY_PICKUP_CONTACT_PERSON, ATTORENY_PICKUP_IDCARD, ATTORNEY_CONTACT_TELEPHONE, 
+    ATTORNEY_TIME, ATTORNEY_PDFFILE, DELETE_NAME, DELETE_TIME, INSERT_USERNAME, INSERT_TIME, 
+    UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, ATTORNEY_DISTRIBUTION_STATUS
+  </sql>
+  <sql id="columns_alias">
+    t.ATTORNEY_ID, t.BATCH_ID, t.REQUESTER_GROUP_ID, t.CARRIER_ID, t.PORT_ID, t.DOWN_SWIM_PORT_ID, 
+    t.ATTORNEY_PICKUP_CONTACT_PERSON, t.ATTORENY_PICKUP_IDCARD, t.ATTORNEY_CONTACT_TELEPHONE, 
+    t.ATTORNEY_TIME, t.ATTORNEY_PDFFILE, t.DELETE_NAME, t.DELETE_TIME, t.INSERT_USERNAME, 
+    t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, 
+    t.ATTORNEY_DISTRIBUTION_STATUS
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM AMSSHIP_DELIVERY_ATTORNEY
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM AMSSHIP_DELIVERY_ATTORNEY t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="attorneyId != null">
+        and ATTORNEY_ID = #{attorneyId}
+      </if>
+      <if test="batchId != null">
+        and BATCH_ID = #{batchId}
+      </if>
+      <if test="requesterGroupId != null">
+        and REQUESTER_GROUP_ID = #{requesterGroupId}
+      </if>
+      <if test="carrierId != null">
+        and CARRIER_ID = #{carrierId}
+      </if>
+      <if test="portId != null">
+        and PORT_ID = #{portId}
+      </if>
+      <if test="downSwimPortId != null">
+        and DOWN_SWIM_PORT_ID = #{downSwimPortId}
+      </if>
+      <if test="attorneyPickupContactPerson != null and attorneyPickupContactPerson != ''">
+        and ATTORNEY_PICKUP_CONTACT_PERSON = #{attorneyPickupContactPerson}
+      </if>
+      <if test="attorenyPickupIdcard != null and attorenyPickupIdcard != ''">
+        and ATTORENY_PICKUP_IDCARD = #{attorenyPickupIdcard}
+      </if>
+      <if test="attorneyContactTelephone != null and attorneyContactTelephone != ''">
+        and ATTORNEY_CONTACT_TELEPHONE = #{attorneyContactTelephone}
+      </if>
+      <if test="attorneyTime != null">
+        and TO_CHAR(ATTORNEY_TIME,'yyyy-MM-dd') = #{attorneyTime}
+      </if>
+      <if test="attorneyPdffile != null and attorneyPdffile != ''">
+        and ATTORNEY_PDFFILE = #{attorneyPdffile}
+      </if>
+      <if test="deleteName != null and deleteName != ''">
+        and DELETE_NAME = #{deleteName}
+      </if>
+      <if test="deleteTime != null and deleteTime != ''">
+        and DELETE_TIME = #{deleteTime}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+      <if test="attorneyDistributionStatus != null">
+        and ATTORNEY_DISTRIBUTION_STATUS = #{attorneyDistributionStatus}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="attorneyId != null">
+        and ATTORNEY_ID = #{attorneyId}
+      </if>
+      <if test="batchId != null">
+        and BATCH_ID = #{batchId}
+      </if>
+      <if test="requesterGroupId != null">
+        and REQUESTER_GROUP_ID = #{requesterGroupId}
+      </if>
+      <if test="carrierId != null">
+        and CARRIER_ID = #{carrierId}
+      </if>
+      <if test="portId != null">
+        and PORT_ID = #{portId}
+      </if>
+      <if test="downSwimPortId != null">
+        and DOWN_SWIM_PORT_ID = #{downSwimPortId}
+      </if>
+      <if test="attorneyPickupContactPerson != null and attorneyPickupContactPerson != ''">
+        and ATTORNEY_PICKUP_CONTACT_PERSON LIKE '%${attorneyPickupContactPerson}%'
+      </if>
+      <if test="attorenyPickupIdcard != null and attorenyPickupIdcard != ''">
+        and ATTORENY_PICKUP_IDCARD LIKE '%${attorenyPickupIdcard}%'
+      </if>
+      <if test="attorneyContactTelephone != null and attorneyContactTelephone != ''">
+        and ATTORNEY_CONTACT_TELEPHONE LIKE '%${attorneyContactTelephone}%'
+      </if>
+      <if test="attorneyTime != null">
+        and TO_CHAR(ATTORNEY_TIME,'yyyy-MM-dd') = #{attorneyTime}
+      </if>
+      <if test="attorneyPdffile != null and attorneyPdffile != ''">
+        and ATTORNEY_PDFFILE LIKE '%${attorneyPdffile}%'
+      </if>
+      <if test="deleteName != null and deleteName != ''">
+        and DELETE_NAME LIKE '%${deleteName}%'
+      </if>
+      <if test="deleteTime != null and deleteTime != ''">
+        and DELETE_TIME LIKE '%${deleteTime}%'
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+      <if test="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+      <if test="attorneyDistributionStatus != null">
+        and ATTORNEY_DISTRIBUTION_STATUS = #{attorneyDistributionStatus}
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
+    delete from AMSSHIP_DELIVERY_ATTORNEY
+    where ATTORNEY_ID = #{attorneyId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from AMSSHIP_DELIVERY_ATTORNEY
+    where 1!=1 
+      <if test="batchId != null">
+        or BATCH_ID = #{batchId}
+      </if>
+      <if test="requesterGroupId != null">
+        or REQUESTER_GROUP_ID = #{requesterGroupId}
+      </if>
+      <if test="carrierId != null">
+        or CARRIER_ID = #{carrierId}
+      </if>
+      <if test="portId != null">
+        or PORT_ID = #{portId}
+      </if>
+      <if test="downSwimPortId != null">
+        or DOWN_SWIM_PORT_ID = #{downSwimPortId}
+      </if>
+      <if test="attorneyPickupContactPerson != null and attorneyPickupContactPerson != ''">
+        or ATTORNEY_PICKUP_CONTACT_PERSON = #{attorneyPickupContactPerson}
+      </if>
+      <if test="attorenyPickupIdcard != null and attorenyPickupIdcard != ''">
+        or ATTORENY_PICKUP_IDCARD = #{attorenyPickupIdcard}
+      </if>
+      <if test="attorneyContactTelephone != null and attorneyContactTelephone != ''">
+        or ATTORNEY_CONTACT_TELEPHONE = #{attorneyContactTelephone}
+      </if>
+      <if test="attorneyTime != null">
+        or TO_CHAR(ATTORNEY_TIME,'yyyy-MM-dd') = '#{attorneyTime}'
+      </if>
+      <if test="attorneyPdffile != null and attorneyPdffile != ''">
+        or ATTORNEY_PDFFILE = #{attorneyPdffile}
+      </if>
+      <if test="deleteName != null and deleteName != ''">
+        or DELETE_NAME = #{deleteName}
+      </if>
+      <if test="deleteTime != null and deleteTime != ''">
+        or DELETE_TIME = #{deleteTime}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        or INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        or UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="deleted != null">
+        or DELETED = #{deleted}
+      </if>
+      <if test="attorneyDistributionStatus != null">
+        or ATTORNEY_DISTRIBUTION_STATUS = #{attorneyDistributionStatus}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.AmsshipDeliveryAttorney">
+    insert into AMSSHIP_DELIVERY_ATTORNEY (ATTORNEY_ID, BATCH_ID, REQUESTER_GROUP_ID, 
+      CARRIER_ID, PORT_ID, DOWN_SWIM_PORT_ID, 
+      ATTORNEY_PICKUP_CONTACT_PERSON, ATTORENY_PICKUP_IDCARD, 
+      ATTORNEY_CONTACT_TELEPHONE, ATTORNEY_TIME, 
+      ATTORNEY_PDFFILE, DELETE_NAME, DELETE_TIME, 
+      INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, 
+      ATTORNEY_DISTRIBUTION_STATUS)
+    values (#{attorneyId,jdbcType=DECIMAL}, #{batchId,jdbcType=DECIMAL}, #{requesterGroupId,jdbcType=DECIMAL}, 
+      #{carrierId,jdbcType=DECIMAL}, #{portId,jdbcType=DECIMAL}, #{downSwimPortId,jdbcType=DECIMAL}, 
+      #{attorneyPickupContactPerson,jdbcType=VARCHAR}, #{attorenyPickupIdcard,jdbcType=VARCHAR}, 
+      #{attorneyContactTelephone,jdbcType=VARCHAR}, #{attorneyTime,jdbcType=TIMESTAMP}, 
+      #{attorneyPdffile,jdbcType=VARCHAR}, #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=VARCHAR}, 
+      #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}, 
+      #{attorneyDistributionStatus,jdbcType=DECIMAL})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsshipDeliveryAttorney">
+    insert into AMSSHIP_DELIVERY_ATTORNEY
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="attorneyId != null">
+        ATTORNEY_ID,
+      </if>
+      <if test="batchId != null">
+        BATCH_ID,
+      </if>
+      <if test="requesterGroupId != null">
+        REQUESTER_GROUP_ID,
+      </if>
+      <if test="carrierId != null">
+        CARRIER_ID,
+      </if>
+      <if test="portId != null">
+        PORT_ID,
+      </if>
+      <if test="downSwimPortId != null">
+        DOWN_SWIM_PORT_ID,
+      </if>
+      <if test="attorneyPickupContactPerson != null">
+        ATTORNEY_PICKUP_CONTACT_PERSON,
+      </if>
+      <if test="attorenyPickupIdcard != null">
+        ATTORENY_PICKUP_IDCARD,
+      </if>
+      <if test="attorneyContactTelephone != null">
+        ATTORNEY_CONTACT_TELEPHONE,
+      </if>
+      <if test="attorneyTime != null">
+        ATTORNEY_TIME,
+      </if>
+      <if test="attorneyPdffile != null">
+        ATTORNEY_PDFFILE,
+      </if>
+      <if test="deleteName != null">
+        DELETE_NAME,
+      </if>
+      <if test="deleteTime != null">
+        DELETE_TIME,
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
+      </if>
+      <if test="deleted != null">
+        DELETED,
+      </if>
+      <if test="attorneyDistributionStatus != null">
+        ATTORNEY_DISTRIBUTION_STATUS,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="attorneyId != null">
+        #{attorneyId,jdbcType=DECIMAL},
+      </if>
+      <if test="batchId != null">
+        #{batchId,jdbcType=DECIMAL},
+      </if>
+      <if test="requesterGroupId != null">
+        #{requesterGroupId,jdbcType=DECIMAL},
+      </if>
+      <if test="carrierId != null">
+        #{carrierId,jdbcType=DECIMAL},
+      </if>
+      <if test="portId != null">
+        #{portId,jdbcType=DECIMAL},
+      </if>
+      <if test="downSwimPortId != null">
+        #{downSwimPortId,jdbcType=DECIMAL},
+      </if>
+      <if test="attorneyPickupContactPerson != null">
+        #{attorneyPickupContactPerson,jdbcType=VARCHAR},
+      </if>
+      <if test="attorenyPickupIdcard != null">
+        #{attorenyPickupIdcard,jdbcType=VARCHAR},
+      </if>
+      <if test="attorneyContactTelephone != null">
+        #{attorneyContactTelephone,jdbcType=VARCHAR},
+      </if>
+      <if test="attorneyTime != null">
+        #{attorneyTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="attorneyPdffile != null">
+        #{attorneyPdffile,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteName != null">
+        #{deleteName,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteTime != null">
+        #{deleteTime,jdbcType=VARCHAR},
+      </if>
+      <if test="insertUsername != null">
+        #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="deleted != null">
+        #{deleted,jdbcType=DECIMAL},
+      </if>
+      <if test="attorneyDistributionStatus != null">
+        #{attorneyDistributionStatus,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsshipDeliveryAttorney">
+    update AMSSHIP_DELIVERY_ATTORNEY
+    set BATCH_ID = #{batchId,jdbcType=DECIMAL},
+      REQUESTER_GROUP_ID = #{requesterGroupId,jdbcType=DECIMAL},
+      CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
+      PORT_ID = #{portId,jdbcType=DECIMAL},
+      DOWN_SWIM_PORT_ID = #{downSwimPortId,jdbcType=DECIMAL},
+      ATTORNEY_PICKUP_CONTACT_PERSON = #{attorneyPickupContactPerson,jdbcType=VARCHAR},
+      ATTORENY_PICKUP_IDCARD = #{attorenyPickupIdcard,jdbcType=VARCHAR},
+      ATTORNEY_CONTACT_TELEPHONE = #{attorneyContactTelephone,jdbcType=VARCHAR},
+      ATTORNEY_TIME = #{attorneyTime,jdbcType=TIMESTAMP},
+      ATTORNEY_PDFFILE = #{attorneyPdffile,jdbcType=VARCHAR},
+      DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
+      DELETE_TIME = #{deleteTime,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},
+      DELETED = #{deleted,jdbcType=DECIMAL},
+      ATTORNEY_DISTRIBUTION_STATUS = #{attorneyDistributionStatus,jdbcType=DECIMAL}
+    where ATTORNEY_ID = #{attorneyId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsshipDeliveryAttorney">
+    update AMSSHIP_DELIVERY_ATTORNEY
+    <set>
+      <if test="batchId != null">
+        BATCH_ID = #{batchId,jdbcType=DECIMAL},
+      </if>
+      <if test="requesterGroupId != null">
+        REQUESTER_GROUP_ID = #{requesterGroupId,jdbcType=DECIMAL},
+      </if>
+      <if test="carrierId != null">
+        CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
+      </if>
+      <if test="portId != null">
+        PORT_ID = #{portId,jdbcType=DECIMAL},
+      </if>
+      <if test="downSwimPortId != null">
+        DOWN_SWIM_PORT_ID = #{downSwimPortId,jdbcType=DECIMAL},
+      </if>
+      <if test="attorneyPickupContactPerson != null">
+        ATTORNEY_PICKUP_CONTACT_PERSON = #{attorneyPickupContactPerson,jdbcType=VARCHAR},
+      </if>
+      <if test="attorenyPickupIdcard != null">
+        ATTORENY_PICKUP_IDCARD = #{attorenyPickupIdcard,jdbcType=VARCHAR},
+      </if>
+      <if test="attorneyContactTelephone != null">
+        ATTORNEY_CONTACT_TELEPHONE = #{attorneyContactTelephone,jdbcType=VARCHAR},
+      </if>
+      <if test="attorneyTime != null">
+        ATTORNEY_TIME = #{attorneyTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="attorneyPdffile != null">
+        ATTORNEY_PDFFILE = #{attorneyPdffile,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteName != null">
+        DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteTime != null">
+        DELETE_TIME = #{deleteTime,jdbcType=VARCHAR},
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="deleted != null">
+        DELETED = #{deleted,jdbcType=DECIMAL},
+      </if>
+      <if test="attorneyDistributionStatus != null">
+        ATTORNEY_DISTRIBUTION_STATUS = #{attorneyDistributionStatus,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where ATTORNEY_ID = #{attorneyId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+    <include refid="select" />
+    where ATTORNEY_ID = #{attorneyId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="where" />
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="whereLike" />
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into AMSSHIP_DELIVERY_ATTORNEY 
+      (ATTORNEY_ID, 
+      BATCH_ID, REQUESTER_GROUP_ID, CARRIER_ID, 
+      PORT_ID, DOWN_SWIM_PORT_ID, ATTORNEY_PICKUP_CONTACT_PERSON, 
+      ATTORENY_PICKUP_IDCARD, ATTORNEY_CONTACT_TELEPHONE, 
+      ATTORNEY_TIME, ATTORNEY_PDFFILE, 
+      DELETE_NAME, DELETE_TIME, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, 
+      DELETED, ATTORNEY_DISTRIBUTION_STATUS
+      )
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.attorneyId,jdbcType=DECIMAL}, 
+      #{item.batchId,jdbcType=DECIMAL}, #{item.requesterGroupId,jdbcType=DECIMAL}, #{item.carrierId,jdbcType=DECIMAL}, 
+      #{item.portId,jdbcType=DECIMAL}, #{item.downSwimPortId,jdbcType=DECIMAL}, #{item.attorneyPickupContactPerson,jdbcType=VARCHAR}, 
+      #{item.attorenyPickupIdcard,jdbcType=VARCHAR}, #{item.attorneyContactTelephone,jdbcType=VARCHAR}, 
+      #{item.attorneyTime,jdbcType=TIMESTAMP}, #{item.attorneyPdffile,jdbcType=VARCHAR}, 
+      #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=VARCHAR}, #{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.attorneyDistributionStatus,jdbcType=DECIMAL}
+       from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update AMSSHIP_DELIVERY_ATTORNEY
+     set
+       ATTORNEY_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyId,jdbcType=DECIMAL}
+       </foreach>
+       ,BATCH_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
+       </foreach>
+       ,REQUESTER_GROUP_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.requesterGroupId,jdbcType=DECIMAL}
+       </foreach>
+       ,CARRIER_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
+       </foreach>
+       ,PORT_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.portId,jdbcType=DECIMAL}
+       </foreach>
+       ,DOWN_SWIM_PORT_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.downSwimPortId,jdbcType=DECIMAL}
+       </foreach>
+       ,ATTORNEY_PICKUP_CONTACT_PERSON=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyPickupContactPerson,jdbcType=VARCHAR}
+       </foreach>
+       ,ATTORENY_PICKUP_IDCARD=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorenyPickupIdcard,jdbcType=VARCHAR}
+       </foreach>
+       ,ATTORNEY_CONTACT_TELEPHONE=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyContactTelephone,jdbcType=VARCHAR}
+       </foreach>
+       ,ATTORNEY_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,ATTORNEY_PDFFILE=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyPdffile,jdbcType=VARCHAR}
+       </foreach>
+       ,DELETE_NAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
+       </foreach>
+       ,DELETE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+       ,DELETED=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+       </foreach>
+       ,ATTORNEY_DISTRIBUTION_STATUS=
+       <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
+          when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyDistributionStatus,jdbcType=DECIMAL}
+       </foreach>
+     where ATTORNEY_ID in 
+     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+    #{item.attorneyId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from AMSSHIP_DELIVERY_ATTORNEY
+    where ATTORNEY_ID in 
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  <!--展示提货委托列表-->
+  <select id="selectdeliveryAttorney" resultType="java.util.Map">
+    select DISTINCT
+    t3.SHIPPER_NAME "shipperName",
+    RP.PORT_NAME "carrierName",
+    dbi.INFACTORY_SHIP_NAME as "infactoryShipName",--进厂船名
+    t6.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
+    t8.MATERIAL_NAME "materialName",
+    RP2.PORT_NAME "portName",
+    t5.PORT_NAME "portName1",
+    t1.ATTORNEY_PICKUP_CONTACT_PERSON "attorneyPickupContactPerson",
+    t1.ATTORENY_PICKUP_IDCARD "attorneyPickupIdcard",
+    t1.ATTORNEY_CONTACT_TELEPHONE "attorneyContactTelephone",
+    t1.ATTORNEY_TIME "attorneyTime",
+    t2.RESULT_NUMBER_OF_LOANS "purchaseOrderMaterialNum",
+    T1.CARRIER_ID "carrierId",
+    t1.REQUESTER_GROUP_ID "groupId",
+    t1.ATTORNEY_ID "attorneyId",
+    dbi.BATCH_INFACOTRY_ID "batchId",
+    t1.INSERT_TIME "insertTime"
+    from AMSSHIP_DELIVERY_ATTORNEY t1
+    left join AMSSHIP_DELIVERY_NOTICE t2
+    on t1.BATCH_ID=t2.BATCH_ID
+    left join RMS_SHIPPER t3
+    on t1.REQUESTER_GROUP_ID=t3.SHIPPER_ID
+    LEFT JOIN RMS_PORT RP
+    ON RP.PORT_ID=T1.CARRIER_ID
+    left join RMS_PORT t5
+    on t1.PORT_ID=t5.PORT_ID
+    LEFT JOIN RMS_PORT RP2
+    ON RP2.PORT_ID=T1.DOWN_SWIM_PORT_ID
+    left join DIL_BATCH_INFACOTRY dbi --批次中间表
+    on t1.BATCH_ID=dbi.BATCH_INFACOTRY_ID
+    left join DIL_BATCH t6
+    on dbi.BATCH_ID=t6.BATCH_ID
+    left join RMS_MATERIAL t8
+    on t6.MATERIAL_ID=t8.MATERIAL_ID
+    where t1.deleted = 0 and t1.ATTORNEY_DISTRIBUTION_STATUS=#{status}
+    <where>
+      <if test="shipperName!= null">
+        and t3.SHIPPER_NAME in
+        <foreach close=")" collection="shipperName" item="item" open="(" separator=",">
+          #{item}
         </foreach>
-        ,ATTORNEY_PICKUP_CONTACT_PERSON=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyPickupContactPerson,jdbcType=VARCHAR}
-        </foreach>
-        ,ATTORENY_PICKUP_IDCARD=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorenyPickupIdcard,jdbcType=VARCHAR}
-        </foreach>
-        ,ATTORNEY_CONTACT_TELEPHONE=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyContactTelephone,jdbcType=VARCHAR}
-        </foreach>
-        ,ATTORNEY_TIME=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyTime,jdbcType=TIMESTAMP}
-        </foreach>
-        ,ATTORNEY_PDFFILE=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyPdffile,jdbcType=VARCHAR}
-        </foreach>
-        ,DELETE_NAME=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
-        </foreach>
-        ,DELETE_TIME=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=VARCHAR}
-        </foreach>
-        ,INSERT_USERNAME=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
-        </foreach>
-        ,INSERT_TIME=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
-        </foreach>
-        ,UPDATE_USERNAME=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
-        </foreach>
-        ,UPDATE_TIME=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
-        </foreach>
-        ,INSERT_UPDATE_REMARK=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
-        </foreach>
-        ,DELETED=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
-        </foreach>
-        ,ATTORNEY_DISTRIBUTION_STATUS=
-        <foreach close="end" collection="list" index="index" item="item" open="case ATTORNEY_ID" separator=" ">
-            when #{item.attorneyId,jdbcType=DECIMAL} then #{item.attorneyDistributionStatus,jdbcType=DECIMAL}
+      </if>
+      <where>
+        <if test="carrierName!= null">
+          and   RP.PORT_NAME in
+          <foreach close=")" collection="resultNumber" item="item" open="(" separator=",">
+            #{item}
+          </foreach>
+        </if>
+      </where>
+      <if test="materialName!= null">
+        and t8.MATERIAL_NAME in
+        <foreach close=")" collection="materialName" item="item" open="(" separator=",">
+          #{item}
         </foreach>
-        where ATTORNEY_ID in
-        <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
-            #{item.attorneyId,jdbcType=DECIMAL}
+      </if>
+      <if test="portName!= null">
+        and t5.PORT_NAME in
+        <foreach close=")" collection="portName" item="item" open="(" separator=",">
+          #{item}
         </foreach>
-    </update>
-    <delete id="batchDelete" parameterType="java.util.List">
-        delete from AMSSHIP_DELIVERY_ATTORNEY
-        where ATTORNEY_ID in
-        <foreach close=")" collection="list" item="id" open="(" separator=",">
-            #{id}
+      </if>
+      <if test="portName1!= null">
+        and t5.PORT_NAME in
+        <foreach close=")" collection="portName1" item="item" open="(" separator=",">
+          #{item}
         </foreach>
-    </delete>
-
-    <!-- 友情提示!!!-->
-    <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-    <!--展示提货委托列表-->
-    <select id="selectdeliveryAttorney" resultType="java.util.Map">
-        select DISTINCT
-        t3.SHIPPER_NAME "shipperName",
-        RP.PORT_NAME "carrierName",
-        dbi.INFACTORY_SHIP_NAME as "infactoryShipName",--进厂船名
-        t6.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
-        t8.MATERIAL_NAME "materialName",
-        RP2.PORT_NAME "portName",
-        t5.PORT_NAME "portName1",
-        t1.ATTORNEY_PICKUP_CONTACT_PERSON "attorneyPickupContactPerson",
-        t1.ATTORENY_PICKUP_IDCARD "attorneyPickupIdcard",
-        t1.ATTORNEY_CONTACT_TELEPHONE "attorneyContactTelephone",
-        t1.ATTORNEY_TIME "attorneyTime",
-        t2.RESULT_NUMBER_OF_LOANS "purchaseOrderMaterialNum",
-        T2.CARRIER_ID "carrierId",
-        t2.REQUESTER_GROUP_ID "groupId",
-        t1.ATTORNEY_ID "attorneyId",
-        dbi.BATCH_INFACOTRY_ID "batchId",
-        t1.INSERT_TIME "insertTime"
-        from AMSSHIP_DELIVERY_ATTORNEY t1
-        left join AMSSHIP_DELIVERY_NOTICE t2
-        on t1.BATCH_ID=t2.BATCH_ID
-        left join RMS_SHIPPER t3
-        on t2.REQUESTER_GROUP_ID=t3.SHIPPER_ID
-        LEFT JOIN RMS_PORT RP
-        ON RP.PORT_ID=T2.CARRIER_ID
-        left join RMS_PORT t5
-        on t1.PORT_ID=t5.PORT_ID
-        LEFT JOIN RMS_PORT RP2
-        ON RP2.PORT_ID=T1.DOWN_SWIM_PORT_ID
-        left join DIL_BATCH_INFACOTRY dbi --批次中间表
-        on t1.BATCH_ID=dbi.BATCH_INFACOTRY_ID
-        left join DIL_BATCH t6
-        on dbi.BATCH_ID=t6.BATCH_ID
-        left join RMS_MATERIAL t8
-        on t6.MATERIAL_ID=t8.MATERIAL_ID
-        where t1.deleted = 0 and t1.ATTORNEY_DISTRIBUTION_STATUS=#{status}
-        <where>
-            <if test="shipperName!= null">
-                and t3.SHIPPER_NAME in
-                <foreach close=")" collection="shipperName" item="item" open="(" separator=",">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="carrierName!= null">
-                and t4.PORT_NAME in
-                <foreach close=")" collection="carrierName" item="item" open="(" separator=",">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="materialName!= null">
-                and t8.MATERIAL_NAME in
-                <foreach close=")" collection="materialName" item="item" open="(" separator=",">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="portName!= null">
-                and t5.PORT_NAME in
-                <foreach close=")" collection="portName" item="item" open="(" separator=",">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="portName1!= null">
-                and t5.PORT_NAME in
-                <foreach close=")" collection="portName1" item="item" open="(" separator=",">
-                    #{item}
-                </foreach>
-            </if>
-        </where>
-        <include refid="orderByInsertTime" />
-    </select>
-    <!--根据时间排序-->
-    <sql id="orderByInsertTime">
-        <if test="orderField != null and orderField != ''">
-            order by "${orderField}"
-            <if test="orderType != null and orderType != ''">
-                ${orderType}
-            </if>
-        </if>
-        <if test="orderField == null  ">
-            order by "insertTime" desc
-        </if>
-    </sql>
-
-    <!--  下拉框中获取收货人单位 -->
-    <select id="getPortName" resultType="java.util.LinkedHashMap">
-        select RP.PORT_ID   "id",
-               RP.PORT_ID   "value",
-               RP.PORT_NAME "label"
-        from RMS_PORT RP
-        WHERE RP.PORT_TYPE_ID = 2
-    </select>
-    <!--  下拉框中获取放货通知单id-->
-    <select id="getNoticeId" resultType="java.util.LinkedHashMap">
-        select ADN.NOTICE_ID "id",
-               ADN.NOTICE_ID "value",
-               ADN.NOTICE_ID "label"
-        from AMSSHIP_DELIVERY_NOTICE ADN
-    </select>
-    <!--  根据主键id进行查询-->
-    <select id="getDeliveryAttorneyId" resultType="java.util.Map">
-        select
-
-            (DB.RESULT_FOREIGN_SHIP_NAME || '-' || RM.MATERIAL_NAME || '-' || dbi.INFACTORY_SHIP_NAME) "batchId",
-               t1.PORT_ID                        "portId",
-               t1.DOWN_SWIM_PORT_ID              "downSwimPortId",
-               t1.ATTORNEY_PICKUP_CONTACT_PERSON "attorneyPickupContactPerson",
-               t1.ATTORENY_PICKUP_IDCARD         "attorenyPickupIdcard",
-               t1.ATTORNEY_CONTACT_TELEPHONE     "attorneyContactTelephone",
-               t1.ATTORNEY_TIME                  "attorneyTime",
-               dbi.INFACTORY_SHIP_NAME  "infactoryShipName",--进厂船名
-               dbi.BATCH_INFACOTRY_ID "batchInfactoryId"
---                t1.ATTORNEY_PDFFILE               "attorneyPdffile"
-
-        from AMSSHIP_DELIVERY_ATTORNEY t1
-        left join DIL_BATCH_INFACOTRY dbi --批次中间表
-        on dbi.BATCH_INFACOTRY_ID=T1.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
-        where t1.ATTORNEY_ID = #{attorneyId}
-    </select>
-    <!--得到提货通知单id-->
-    <select id="getAttorneyId" resultType="java.util.LinkedHashMap">
-        SELECT ada.ATTORNEY_ID                    "id",
-               ada.ATTORNEY_ID                    "value",
-               ada.ATTORNEY_PICKUP_CONTACT_PERSON "label"
-        FROM AMSSHIP_DELIVERY_ATTORNEY ada
-    </select>
+      </if>
+    </where>
+    <include refid="orderByInsertTime" />
+  </select>
+  <!--根据时间排序-->
+  <sql id="orderByInsertTime">
+    <if test="orderField != null and orderField != ''">
+      order by "${orderField}"
+      <if test="orderType != null and orderType != ''">
+        ${orderType}
+      </if>
+    </if>
+    <if test="orderField == null  ">
+      order by "insertTime" desc
+    </if>
+  </sql>
 
-    <!--得到发件人id(港口)-->
-    <select id="getPortId" resultType="java.util.LinkedHashMap">
-        SELECT rp.PORT_ID   "id",
-               rp.PORT_ID   "value",
-               rp.PORT_NAME "label"
-        FROM RMS_PORT rp
-    </select>
+  <!--  下拉框中获取收货人单位 -->
+  <select id="getPortName" resultType="java.util.LinkedHashMap">
+    select RP.PORT_ID   "id",
+           RP.PORT_ID   "value",
+           RP.PORT_NAME "label"
+    from RMS_PORT RP
+    WHERE RP.PORT_TYPE_ID = 2
+  </select>
+  <!--  下拉框中获取放货通知单id-->
+  <select id="getNoticeId" resultType="java.util.LinkedHashMap">
+    select ADN.NOTICE_ID "id",
+           ADN.NOTICE_ID "value",
+           ADN.NOTICE_ID "label"
+    from AMSSHIP_DELIVERY_NOTICE ADN
+  </select>
+  <!--  根据主键id进行查询,用于渲染表单-->
+  <select id="getDeliveryAttorneyId" resultType="java.util.Map">
+    select
+      (DB.RESULT_FOREIGN_SHIP_NAME || '-' || RM.MATERIAL_NAME || '-' || dbi.INFACTORY_SHIP_NAME) "batchId",
+      t1.PORT_ID                        "portId",
+      t1.REQUESTER_GROUP_ID "requesterGroupId",
+      t1.CARRIER_ID  "carrierId",
+      t1.DOWN_SWIM_PORT_ID              "downSwimPortId",
+      t1.ATTORNEY_PICKUP_CONTACT_PERSON "attorneyPickupContactPerson",
+      t1.ATTORENY_PICKUP_IDCARD         "attorenyPickupIdcard",
+      t1.ATTORNEY_CONTACT_TELEPHONE     "attorneyContactTelephone",
+      t1.ATTORNEY_TIME                  "attorneyTime",
+      dbi.INFACTORY_SHIP_NAME  "infactoryShipName",--进厂船名
+      dbi.BATCH_INFACOTRY_ID "batchInfactoryId"
+    from AMSSHIP_DELIVERY_ATTORNEY t1
+           left join DIL_BATCH_INFACOTRY dbi --批次中间表
+                     on dbi.BATCH_INFACOTRY_ID=T1.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
+    where t1.ATTORNEY_ID = #{attorneyId}
+  </select>
+  <!--得到提货通知单id-->
+  <select id="getAttorneyId" resultType="java.util.LinkedHashMap">
+    SELECT ada.ATTORNEY_ID                    "id",
+           ada.ATTORNEY_ID                    "value",
+           ada.ATTORNEY_PICKUP_CONTACT_PERSON "label"
+    FROM AMSSHIP_DELIVERY_ATTORNEY ada
+  </select>
 
-    <!--得到收件人id(下游码头)-->
-    <select id="getPierId" resultType="java.util.LinkedHashMap">
-        SELECT rp.PIER_ID   "id",
-               rp.PIER_ID   "value",
-               rp.PIER_NAME "label"
-        FROM RMS_PIER rp
-    </select>
+  <!--得到发件人id(港口)-->
+  <select id="getPortId" resultType="java.util.LinkedHashMap">
+    SELECT rp.PORT_ID   "id",
+           rp.PORT_ID   "value",
+           rp.PORT_NAME "label"
+    FROM RMS_PORT rp
+  </select>
 
-    <select id="getRmRawId" resultType="java.util.LinkedHashMap">
-        SELECT rrmr.GM_ID      "id",
-               rrmr.GM_ID      "value",
-               rrmr.GM_TONNAGE "label"
-        FROM WMSH_GRID_MATERIAL rrmr
-    </select>
+  <!--得到收件人id(下游码头)-->
+  <select id="getPierId" resultType="java.util.LinkedHashMap">
+    SELECT rp.PIER_ID   "id",
+           rp.PIER_ID   "value",
+           rp.PIER_NAME "label"
+    FROM RMS_PIER rp
+  </select>
 
+  <select id="getRmRawId" resultType="java.util.LinkedHashMap">
+    SELECT rrmr.GM_ID      "id",
+           rrmr.GM_ID      "value",
+           rrmr.GM_TONNAGE "label"
+    FROM WMSH_GRID_MATERIAL rrmr
+  </select>
 </mapper>

+ 380 - 461
src/main/resources/com/steerinfo/dil/mapper/AmsshipDeliveryNoticeMapper.xml

@@ -3,8 +3,6 @@
 <mapper namespace="com.steerinfo.dil.mapper.AmsshipDeliveryNoticeMapper">
   <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmsshipDeliveryNotice">
     <id column="NOTICE_ID" jdbcType="DECIMAL" property="noticeId" />
-    <result column="REQUESTER_GROUP_ID" jdbcType="DECIMAL" property="requesterGroupId" />
-    <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
     <result column="NOTICE_COMMERCE_METHOD" jdbcType="VARCHAR" property="noticeCommerceMethod" />
     <result column="NOTICE_HANDOVER_METHOD" jdbcType="VARCHAR" property="noticeHandoverMethod" />
     <result column="PORT_ID" jdbcType="DECIMAL" property="portId" />
@@ -42,25 +40,24 @@
     <result column="CARGO_IMAGE_URL" jdbcType="VARCHAR" property="cargoImageUrl" />
   </resultMap>
   <sql id="columns">
-    NOTICE_ID, REQUESTER_GROUP_ID, CARRIER_ID, NOTICE_COMMERCE_METHOD, NOTICE_HANDOVER_METHOD,
-    PORT_ID, NOTICE_PORT_CONSTRUCTION_FEE, NOTICE_DELIVERY_TIME, NOTICE_PILE_FREE_DAYS,
-    DELETE_NAME, DELETE_TIME, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
-    INSERT_UPDATE_REMARK, NOTICE_DISTRIBUTION_STATUS, DELETED, BATCH_ID, PURCHASE_CONTRACT_UNIT_PRICE,
-    PURCHASE_CONTRACT_MOISTURE, TFE_CONTENT, SILICA_CONTENT, ALUMINA_CONTENT, PHOSPHORUS_CONTENT,
-    MANGANESE_CONTENT, IS_NEED_PORT_FEE, IS_NEED_PORT_CHARGE, MATERIAL_TYPE_ID, RESULT_CONTACT_PERSON,
-    RESULT_TELEPHONE_FAX, GROUP_ID, RESULT_NUMBER_OF_LOANS, RESULT_FREIGHT_FORWARDING_INFO,
-    RESULT_MEMO, RESULT_DATE_OF_LOANS, CARGO_ID, CARGO_IMAGE_URL
+    NOTICE_ID, NOTICE_COMMERCE_METHOD, NOTICE_HANDOVER_METHOD, PORT_ID, NOTICE_PORT_CONSTRUCTION_FEE, 
+    NOTICE_DELIVERY_TIME, NOTICE_PILE_FREE_DAYS, DELETE_NAME, DELETE_TIME, INSERT_USERNAME, 
+    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, NOTICE_DISTRIBUTION_STATUS, 
+    DELETED, BATCH_ID, PURCHASE_CONTRACT_UNIT_PRICE, PURCHASE_CONTRACT_MOISTURE, TFE_CONTENT, 
+    SILICA_CONTENT, ALUMINA_CONTENT, PHOSPHORUS_CONTENT, MANGANESE_CONTENT, IS_NEED_PORT_FEE, 
+    IS_NEED_PORT_CHARGE, MATERIAL_TYPE_ID, RESULT_CONTACT_PERSON, RESULT_TELEPHONE_FAX, 
+    GROUP_ID, RESULT_NUMBER_OF_LOANS, RESULT_FREIGHT_FORWARDING_INFO, RESULT_MEMO, RESULT_DATE_OF_LOANS, 
+    CARGO_ID, CARGO_IMAGE_URL
   </sql>
   <sql id="columns_alias">
-    t.NOTICE_ID, t.REQUESTER_GROUP_ID, t.CARRIER_ID, t.NOTICE_COMMERCE_METHOD, t.NOTICE_HANDOVER_METHOD,
-    t.PORT_ID, t.NOTICE_PORT_CONSTRUCTION_FEE, t.NOTICE_DELIVERY_TIME, t.NOTICE_PILE_FREE_DAYS,
-    t.DELETE_NAME, t.DELETE_TIME, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
-    t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.NOTICE_DISTRIBUTION_STATUS, t.DELETED, t.BATCH_ID,
-    t.PURCHASE_CONTRACT_UNIT_PRICE, t.PURCHASE_CONTRACT_MOISTURE, t.TFE_CONTENT, t.SILICA_CONTENT,
-    t.ALUMINA_CONTENT, t.PHOSPHORUS_CONTENT, t.MANGANESE_CONTENT, t.IS_NEED_PORT_FEE,
-    t.IS_NEED_PORT_CHARGE, t.MATERIAL_TYPE_ID, t.RESULT_CONTACT_PERSON, t.RESULT_TELEPHONE_FAX,
-    t.GROUP_ID, t.RESULT_NUMBER_OF_LOANS, t.RESULT_FREIGHT_FORWARDING_INFO, t.RESULT_MEMO,
-    t.RESULT_DATE_OF_LOANS, t.CARGO_ID, t.CARGO_IMAGE_URL
+    t.NOTICE_ID, t.NOTICE_COMMERCE_METHOD, t.NOTICE_HANDOVER_METHOD, t.PORT_ID, t.NOTICE_PORT_CONSTRUCTION_FEE, 
+    t.NOTICE_DELIVERY_TIME, t.NOTICE_PILE_FREE_DAYS, t.DELETE_NAME, t.DELETE_TIME, t.INSERT_USERNAME, 
+    t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.NOTICE_DISTRIBUTION_STATUS, 
+    t.DELETED, t.BATCH_ID, t.PURCHASE_CONTRACT_UNIT_PRICE, t.PURCHASE_CONTRACT_MOISTURE, 
+    t.TFE_CONTENT, t.SILICA_CONTENT, t.ALUMINA_CONTENT, t.PHOSPHORUS_CONTENT, t.MANGANESE_CONTENT, 
+    t.IS_NEED_PORT_FEE, t.IS_NEED_PORT_CHARGE, t.MATERIAL_TYPE_ID, t.RESULT_CONTACT_PERSON, 
+    t.RESULT_TELEPHONE_FAX, t.GROUP_ID, t.RESULT_NUMBER_OF_LOANS, t.RESULT_FREIGHT_FORWARDING_INFO, 
+    t.RESULT_MEMO, t.RESULT_DATE_OF_LOANS, t.CARGO_ID, t.CARGO_IMAGE_URL
   </sql>
   <sql id="select">
     SELECT <include refid="columns" /> FROM AMSSHIP_DELIVERY_NOTICE
@@ -69,16 +66,10 @@
     SELECT <include refid="columns_alias" /> FROM AMSSHIP_DELIVERY_NOTICE t
   </sql>
   <sql id="where">
-    <where>
+    <where> 
       <if test="noticeId != null">
         and NOTICE_ID = #{noticeId}
       </if>
-      <if test="requesterGroupId != null">
-        and REQUESTER_GROUP_ID = #{requesterGroupId}
-      </if>
-      <if test="carrierId != null">
-        and CARRIER_ID = #{carrierId}
-      </if>
       <if test="noticeCommerceMethod != null and noticeCommerceMethod != ''">
         and NOTICE_COMMERCE_METHOD = #{noticeCommerceMethod}
       </if>
@@ -187,16 +178,10 @@
     </where>
   </sql>
   <sql id="whereLike">
-    <where>
+    <where> 
       <if test="noticeId != null">
         and NOTICE_ID = #{noticeId}
       </if>
-      <if test="requesterGroupId != null">
-        and REQUESTER_GROUP_ID = #{requesterGroupId}
-      </if>
-      <if test="carrierId != null">
-        and CARRIER_ID = #{carrierId}
-      </if>
       <if test="noticeCommerceMethod != null and noticeCommerceMethod != ''">
         and NOTICE_COMMERCE_METHOD LIKE '%${noticeCommerceMethod}%'
       </if>
@@ -310,148 +295,140 @@
   </delete>
   <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
     delete from AMSSHIP_DELIVERY_NOTICE
-    where 1!=1
-    <if test="requesterGroupId != null">
-      or REQUESTER_GROUP_ID = #{requesterGroupId}
-    </if>
-    <if test="carrierId != null">
-      or CARRIER_ID = #{carrierId}
-    </if>
-    <if test="noticeCommerceMethod != null and noticeCommerceMethod != ''">
-      or NOTICE_COMMERCE_METHOD = #{noticeCommerceMethod}
-    </if>
-    <if test="noticeHandoverMethod != null and noticeHandoverMethod != ''">
-      or NOTICE_HANDOVER_METHOD = #{noticeHandoverMethod}
-    </if>
-    <if test="portId != null">
-      or PORT_ID = #{portId}
-    </if>
-    <if test="noticePortConstructionFee != null">
-      or NOTICE_PORT_CONSTRUCTION_FEE = #{noticePortConstructionFee}
-    </if>
-    <if test="noticeDeliveryTime != null">
-      or TO_CHAR(NOTICE_DELIVERY_TIME,'yyyy-MM-dd') = '#{noticeDeliveryTime}'
-    </if>
-    <if test="noticePileFreeDays != null">
-      or NOTICE_PILE_FREE_DAYS = #{noticePileFreeDays}
-    </if>
-    <if test="deleteName != null and deleteName != ''">
-      or DELETE_NAME = #{deleteName}
-    </if>
-    <if test="deleteTime != null and deleteTime != ''">
-      or DELETE_TIME = #{deleteTime}
-    </if>
-    <if test="insertUsername != null and insertUsername != ''">
-      or INSERT_USERNAME = #{insertUsername}
-    </if>
-    <if test="insertTime != null">
-      or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
-    </if>
-    <if test="updateUsername != null and updateUsername != ''">
-      or UPDATE_USERNAME = #{updateUsername}
-    </if>
-    <if test="updateTime != null">
-      or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
-    </if>
-    <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
-      or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
-    </if>
-    <if test="noticeDistributionStatus != null">
-      or NOTICE_DISTRIBUTION_STATUS = #{noticeDistributionStatus}
-    </if>
-    <if test="deleted != null">
-      or DELETED = #{deleted}
-    </if>
-    <if test="batchId != null">
-      or BATCH_ID = #{batchId}
-    </if>
-    <if test="purchaseContractUnitPrice != null">
-      or PURCHASE_CONTRACT_UNIT_PRICE = #{purchaseContractUnitPrice}
-    </if>
-    <if test="purchaseContractMoisture != null and purchaseContractMoisture != ''">
-      or PURCHASE_CONTRACT_MOISTURE = #{purchaseContractMoisture}
-    </if>
-    <if test="tfeContent != null and tfeContent != ''">
-      or TFE_CONTENT = #{tfeContent}
-    </if>
-    <if test="silicaContent != null and silicaContent != ''">
-      or SILICA_CONTENT = #{silicaContent}
-    </if>
-    <if test="aluminaContent != null and aluminaContent != ''">
-      or ALUMINA_CONTENT = #{aluminaContent}
-    </if>
-    <if test="phosphorusContent != null and phosphorusContent != ''">
-      or PHOSPHORUS_CONTENT = #{phosphorusContent}
-    </if>
-    <if test="manganeseContent != null and manganeseContent != ''">
-      or MANGANESE_CONTENT = #{manganeseContent}
-    </if>
-    <if test="isNeedPortFee != null and isNeedPortFee != ''">
-      or IS_NEED_PORT_FEE = #{isNeedPortFee}
-    </if>
-    <if test="isNeedPortCharge != null and isNeedPortCharge != ''">
-      or IS_NEED_PORT_CHARGE = #{isNeedPortCharge}
-    </if>
-    <if test="materialTypeId != null">
-      or MATERIAL_TYPE_ID = #{materialTypeId}
-    </if>
-    <if test="resultContactPerson != null and resultContactPerson != ''">
-      or RESULT_CONTACT_PERSON = #{resultContactPerson}
-    </if>
-    <if test="resultTelephoneFax != null and resultTelephoneFax != ''">
-      or RESULT_TELEPHONE_FAX = #{resultTelephoneFax}
-    </if>
-    <if test="groupId != null">
-      or GROUP_ID = #{groupId}
-    </if>
-    <if test="resultNumberOfLoans != null">
-      or RESULT_NUMBER_OF_LOANS = #{resultNumberOfLoans}
-    </if>
-    <if test="resultFreightForwardingInfo != null and resultFreightForwardingInfo != ''">
-      or RESULT_FREIGHT_FORWARDING_INFO = #{resultFreightForwardingInfo}
-    </if>
-    <if test="resultMemo != null and resultMemo != ''">
-      or RESULT_MEMO = #{resultMemo}
-    </if>
-    <if test="resultDateOfLoans != null">
-      or TO_CHAR(RESULT_DATE_OF_LOANS,'yyyy-MM-dd') = '#{resultDateOfLoans}'
-    </if>
-    <if test="cargoId != null">
-      or CARGO_ID = #{cargoId}
-    </if>
-    <if test="cargoImageUrl != null and cargoImageUrl != ''">
-      or CARGO_IMAGE_URL = #{cargoImageUrl}
-    </if>
+    where 1!=1 
+      <if test="noticeCommerceMethod != null and noticeCommerceMethod != ''">
+        or NOTICE_COMMERCE_METHOD = #{noticeCommerceMethod}
+      </if>
+      <if test="noticeHandoverMethod != null and noticeHandoverMethod != ''">
+        or NOTICE_HANDOVER_METHOD = #{noticeHandoverMethod}
+      </if>
+      <if test="portId != null">
+        or PORT_ID = #{portId}
+      </if>
+      <if test="noticePortConstructionFee != null">
+        or NOTICE_PORT_CONSTRUCTION_FEE = #{noticePortConstructionFee}
+      </if>
+      <if test="noticeDeliveryTime != null">
+        or TO_CHAR(NOTICE_DELIVERY_TIME,'yyyy-MM-dd') = '#{noticeDeliveryTime}'
+      </if>
+      <if test="noticePileFreeDays != null">
+        or NOTICE_PILE_FREE_DAYS = #{noticePileFreeDays}
+      </if>
+      <if test="deleteName != null and deleteName != ''">
+        or DELETE_NAME = #{deleteName}
+      </if>
+      <if test="deleteTime != null and deleteTime != ''">
+        or DELETE_TIME = #{deleteTime}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        or INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        or UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="noticeDistributionStatus != null">
+        or NOTICE_DISTRIBUTION_STATUS = #{noticeDistributionStatus}
+      </if>
+      <if test="deleted != null">
+        or DELETED = #{deleted}
+      </if>
+      <if test="batchId != null">
+        or BATCH_ID = #{batchId}
+      </if>
+      <if test="purchaseContractUnitPrice != null">
+        or PURCHASE_CONTRACT_UNIT_PRICE = #{purchaseContractUnitPrice}
+      </if>
+      <if test="purchaseContractMoisture != null and purchaseContractMoisture != ''">
+        or PURCHASE_CONTRACT_MOISTURE = #{purchaseContractMoisture}
+      </if>
+      <if test="tfeContent != null and tfeContent != ''">
+        or TFE_CONTENT = #{tfeContent}
+      </if>
+      <if test="silicaContent != null and silicaContent != ''">
+        or SILICA_CONTENT = #{silicaContent}
+      </if>
+      <if test="aluminaContent != null and aluminaContent != ''">
+        or ALUMINA_CONTENT = #{aluminaContent}
+      </if>
+      <if test="phosphorusContent != null and phosphorusContent != ''">
+        or PHOSPHORUS_CONTENT = #{phosphorusContent}
+      </if>
+      <if test="manganeseContent != null and manganeseContent != ''">
+        or MANGANESE_CONTENT = #{manganeseContent}
+      </if>
+      <if test="isNeedPortFee != null and isNeedPortFee != ''">
+        or IS_NEED_PORT_FEE = #{isNeedPortFee}
+      </if>
+      <if test="isNeedPortCharge != null and isNeedPortCharge != ''">
+        or IS_NEED_PORT_CHARGE = #{isNeedPortCharge}
+      </if>
+      <if test="materialTypeId != null">
+        or MATERIAL_TYPE_ID = #{materialTypeId}
+      </if>
+      <if test="resultContactPerson != null and resultContactPerson != ''">
+        or RESULT_CONTACT_PERSON = #{resultContactPerson}
+      </if>
+      <if test="resultTelephoneFax != null and resultTelephoneFax != ''">
+        or RESULT_TELEPHONE_FAX = #{resultTelephoneFax}
+      </if>
+      <if test="groupId != null">
+        or GROUP_ID = #{groupId}
+      </if>
+      <if test="resultNumberOfLoans != null">
+        or RESULT_NUMBER_OF_LOANS = #{resultNumberOfLoans}
+      </if>
+      <if test="resultFreightForwardingInfo != null and resultFreightForwardingInfo != ''">
+        or RESULT_FREIGHT_FORWARDING_INFO = #{resultFreightForwardingInfo}
+      </if>
+      <if test="resultMemo != null and resultMemo != ''">
+        or RESULT_MEMO = #{resultMemo}
+      </if>
+      <if test="resultDateOfLoans != null">
+        or TO_CHAR(RESULT_DATE_OF_LOANS,'yyyy-MM-dd') = '#{resultDateOfLoans}'
+      </if>
+      <if test="cargoId != null">
+        or CARGO_ID = #{cargoId}
+      </if>
+      <if test="cargoImageUrl != null and cargoImageUrl != ''">
+        or CARGO_IMAGE_URL = #{cargoImageUrl}
+      </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.dil.model.AmsshipDeliveryNotice">
-    insert into AMSSHIP_DELIVERY_NOTICE (NOTICE_ID, REQUESTER_GROUP_ID, CARRIER_ID,
-                                         NOTICE_COMMERCE_METHOD, NOTICE_HANDOVER_METHOD,
-                                         PORT_ID, NOTICE_PORT_CONSTRUCTION_FEE, NOTICE_DELIVERY_TIME,
-                                         NOTICE_PILE_FREE_DAYS, DELETE_NAME, DELETE_TIME,
-                                         INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
-                                         UPDATE_TIME, INSERT_UPDATE_REMARK, NOTICE_DISTRIBUTION_STATUS,
-                                         DELETED, BATCH_ID, PURCHASE_CONTRACT_UNIT_PRICE,
-                                         PURCHASE_CONTRACT_MOISTURE, TFE_CONTENT, SILICA_CONTENT,
-                                         ALUMINA_CONTENT, PHOSPHORUS_CONTENT, MANGANESE_CONTENT,
-                                         IS_NEED_PORT_FEE, IS_NEED_PORT_CHARGE, MATERIAL_TYPE_ID,
-                                         RESULT_CONTACT_PERSON, RESULT_TELEPHONE_FAX,
-                                         GROUP_ID, RESULT_NUMBER_OF_LOANS, RESULT_FREIGHT_FORWARDING_INFO,
-                                         RESULT_MEMO, RESULT_DATE_OF_LOANS, CARGO_ID,
-                                         CARGO_IMAGE_URL)
-    values (#{noticeId,jdbcType=DECIMAL}, #{requesterGroupId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL},
-            #{noticeCommerceMethod,jdbcType=VARCHAR}, #{noticeHandoverMethod,jdbcType=VARCHAR},
-            #{portId,jdbcType=DECIMAL}, #{noticePortConstructionFee,jdbcType=DECIMAL}, #{noticeDeliveryTime,jdbcType=TIMESTAMP},
-            #{noticePileFreeDays,jdbcType=DECIMAL}, #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=VARCHAR},
-            #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
-            #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{noticeDistributionStatus,jdbcType=DECIMAL},
-            #{deleted,jdbcType=DECIMAL}, #{batchId,jdbcType=DECIMAL}, #{purchaseContractUnitPrice,jdbcType=DECIMAL},
-            #{purchaseContractMoisture,jdbcType=VARCHAR}, #{tfeContent,jdbcType=VARCHAR}, #{silicaContent,jdbcType=VARCHAR},
-            #{aluminaContent,jdbcType=VARCHAR}, #{phosphorusContent,jdbcType=VARCHAR}, #{manganeseContent,jdbcType=VARCHAR},
-            #{isNeedPortFee,jdbcType=VARCHAR}, #{isNeedPortCharge,jdbcType=VARCHAR}, #{materialTypeId,jdbcType=DECIMAL},
-            #{resultContactPerson,jdbcType=VARCHAR}, #{resultTelephoneFax,jdbcType=VARCHAR},
-            #{groupId,jdbcType=DECIMAL}, #{resultNumberOfLoans,jdbcType=DECIMAL}, #{resultFreightForwardingInfo,jdbcType=VARCHAR},
-            #{resultMemo,jdbcType=VARCHAR}, #{resultDateOfLoans,jdbcType=TIMESTAMP}, #{cargoId,jdbcType=DECIMAL},
-            #{cargoImageUrl,jdbcType=VARCHAR})
+    insert into AMSSHIP_DELIVERY_NOTICE (NOTICE_ID, NOTICE_COMMERCE_METHOD, NOTICE_HANDOVER_METHOD, 
+      PORT_ID, NOTICE_PORT_CONSTRUCTION_FEE, NOTICE_DELIVERY_TIME, 
+      NOTICE_PILE_FREE_DAYS, DELETE_NAME, DELETE_TIME, 
+      INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, NOTICE_DISTRIBUTION_STATUS, 
+      DELETED, BATCH_ID, PURCHASE_CONTRACT_UNIT_PRICE, 
+      PURCHASE_CONTRACT_MOISTURE, TFE_CONTENT, SILICA_CONTENT, 
+      ALUMINA_CONTENT, PHOSPHORUS_CONTENT, MANGANESE_CONTENT, 
+      IS_NEED_PORT_FEE, IS_NEED_PORT_CHARGE, MATERIAL_TYPE_ID, 
+      RESULT_CONTACT_PERSON, RESULT_TELEPHONE_FAX, 
+      GROUP_ID, RESULT_NUMBER_OF_LOANS, RESULT_FREIGHT_FORWARDING_INFO, 
+      RESULT_MEMO, RESULT_DATE_OF_LOANS, CARGO_ID, 
+      CARGO_IMAGE_URL)
+    values (#{noticeId,jdbcType=DECIMAL}, #{noticeCommerceMethod,jdbcType=VARCHAR}, #{noticeHandoverMethod,jdbcType=VARCHAR}, 
+      #{portId,jdbcType=DECIMAL}, #{noticePortConstructionFee,jdbcType=DECIMAL}, #{noticeDeliveryTime,jdbcType=TIMESTAMP}, 
+      #{noticePileFreeDays,jdbcType=DECIMAL}, #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=VARCHAR}, 
+      #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{noticeDistributionStatus,jdbcType=DECIMAL}, 
+      #{deleted,jdbcType=DECIMAL}, #{batchId,jdbcType=DECIMAL}, #{purchaseContractUnitPrice,jdbcType=DECIMAL}, 
+      #{purchaseContractMoisture,jdbcType=VARCHAR}, #{tfeContent,jdbcType=VARCHAR}, #{silicaContent,jdbcType=VARCHAR}, 
+      #{aluminaContent,jdbcType=VARCHAR}, #{phosphorusContent,jdbcType=VARCHAR}, #{manganeseContent,jdbcType=VARCHAR}, 
+      #{isNeedPortFee,jdbcType=VARCHAR}, #{isNeedPortCharge,jdbcType=VARCHAR}, #{materialTypeId,jdbcType=DECIMAL}, 
+      #{resultContactPerson,jdbcType=VARCHAR}, #{resultTelephoneFax,jdbcType=VARCHAR}, 
+      #{groupId,jdbcType=DECIMAL}, #{resultNumberOfLoans,jdbcType=DECIMAL}, #{resultFreightForwardingInfo,jdbcType=VARCHAR}, 
+      #{resultMemo,jdbcType=VARCHAR}, #{resultDateOfLoans,jdbcType=TIMESTAMP}, #{cargoId,jdbcType=DECIMAL}, 
+      #{cargoImageUrl,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsshipDeliveryNotice">
     insert into AMSSHIP_DELIVERY_NOTICE
@@ -459,12 +436,6 @@
       <if test="noticeId != null">
         NOTICE_ID,
       </if>
-      <if test="requesterGroupId != null">
-        REQUESTER_GROUP_ID,
-      </if>
-      <if test="carrierId != null">
-        CARRIER_ID,
-      </if>
       <if test="noticeCommerceMethod != null">
         NOTICE_COMMERCE_METHOD,
       </if>
@@ -575,12 +546,6 @@
       <if test="noticeId != null">
         #{noticeId,jdbcType=DECIMAL},
       </if>
-      <if test="requesterGroupId != null">
-        #{requesterGroupId,jdbcType=DECIMAL},
-      </if>
-      <if test="carrierId != null">
-        #{carrierId,jdbcType=DECIMAL},
-      </if>
       <if test="noticeCommerceMethod != null">
         #{noticeCommerceMethod,jdbcType=VARCHAR},
       </if>
@@ -690,54 +655,46 @@
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsshipDeliveryNotice">
     update AMSSHIP_DELIVERY_NOTICE
-    set REQUESTER_GROUP_ID = #{requesterGroupId,jdbcType=DECIMAL},
-        CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
-        NOTICE_COMMERCE_METHOD = #{noticeCommerceMethod,jdbcType=VARCHAR},
-        NOTICE_HANDOVER_METHOD = #{noticeHandoverMethod,jdbcType=VARCHAR},
-        PORT_ID = #{portId,jdbcType=DECIMAL},
-        NOTICE_PORT_CONSTRUCTION_FEE = #{noticePortConstructionFee,jdbcType=DECIMAL},
-        NOTICE_DELIVERY_TIME = #{noticeDeliveryTime,jdbcType=TIMESTAMP},
-        NOTICE_PILE_FREE_DAYS = #{noticePileFreeDays,jdbcType=DECIMAL},
-        DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
-        DELETE_TIME = #{deleteTime,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},
-        NOTICE_DISTRIBUTION_STATUS = #{noticeDistributionStatus,jdbcType=DECIMAL},
-        DELETED = #{deleted,jdbcType=DECIMAL},
-        BATCH_ID = #{batchId,jdbcType=DECIMAL},
-        PURCHASE_CONTRACT_UNIT_PRICE = #{purchaseContractUnitPrice,jdbcType=DECIMAL},
-        PURCHASE_CONTRACT_MOISTURE = #{purchaseContractMoisture,jdbcType=VARCHAR},
-        TFE_CONTENT = #{tfeContent,jdbcType=VARCHAR},
-        SILICA_CONTENT = #{silicaContent,jdbcType=VARCHAR},
-        ALUMINA_CONTENT = #{aluminaContent,jdbcType=VARCHAR},
-        PHOSPHORUS_CONTENT = #{phosphorusContent,jdbcType=VARCHAR},
-        MANGANESE_CONTENT = #{manganeseContent,jdbcType=VARCHAR},
-        IS_NEED_PORT_FEE = #{isNeedPortFee,jdbcType=VARCHAR},
-        IS_NEED_PORT_CHARGE = #{isNeedPortCharge,jdbcType=VARCHAR},
-        MATERIAL_TYPE_ID = #{materialTypeId,jdbcType=DECIMAL},
-        RESULT_CONTACT_PERSON = #{resultContactPerson,jdbcType=VARCHAR},
-        RESULT_TELEPHONE_FAX = #{resultTelephoneFax,jdbcType=VARCHAR},
-        GROUP_ID = #{groupId,jdbcType=DECIMAL},
-        RESULT_NUMBER_OF_LOANS = #{resultNumberOfLoans,jdbcType=DECIMAL},
-        RESULT_FREIGHT_FORWARDING_INFO = #{resultFreightForwardingInfo,jdbcType=VARCHAR},
-        RESULT_MEMO = #{resultMemo,jdbcType=VARCHAR},
-        RESULT_DATE_OF_LOANS = #{resultDateOfLoans,jdbcType=TIMESTAMP},
-        CARGO_ID = #{cargoId,jdbcType=DECIMAL},
-        CARGO_IMAGE_URL = #{cargoImageUrl,jdbcType=VARCHAR}
+    set NOTICE_COMMERCE_METHOD = #{noticeCommerceMethod,jdbcType=VARCHAR},
+      NOTICE_HANDOVER_METHOD = #{noticeHandoverMethod,jdbcType=VARCHAR},
+      PORT_ID = #{portId,jdbcType=DECIMAL},
+      NOTICE_PORT_CONSTRUCTION_FEE = #{noticePortConstructionFee,jdbcType=DECIMAL},
+      NOTICE_DELIVERY_TIME = #{noticeDeliveryTime,jdbcType=TIMESTAMP},
+      NOTICE_PILE_FREE_DAYS = #{noticePileFreeDays,jdbcType=DECIMAL},
+      DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
+      DELETE_TIME = #{deleteTime,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},
+      NOTICE_DISTRIBUTION_STATUS = #{noticeDistributionStatus,jdbcType=DECIMAL},
+      DELETED = #{deleted,jdbcType=DECIMAL},
+      BATCH_ID = #{batchId,jdbcType=DECIMAL},
+      PURCHASE_CONTRACT_UNIT_PRICE = #{purchaseContractUnitPrice,jdbcType=DECIMAL},
+      PURCHASE_CONTRACT_MOISTURE = #{purchaseContractMoisture,jdbcType=VARCHAR},
+      TFE_CONTENT = #{tfeContent,jdbcType=VARCHAR},
+      SILICA_CONTENT = #{silicaContent,jdbcType=VARCHAR},
+      ALUMINA_CONTENT = #{aluminaContent,jdbcType=VARCHAR},
+      PHOSPHORUS_CONTENT = #{phosphorusContent,jdbcType=VARCHAR},
+      MANGANESE_CONTENT = #{manganeseContent,jdbcType=VARCHAR},
+      IS_NEED_PORT_FEE = #{isNeedPortFee,jdbcType=VARCHAR},
+      IS_NEED_PORT_CHARGE = #{isNeedPortCharge,jdbcType=VARCHAR},
+      MATERIAL_TYPE_ID = #{materialTypeId,jdbcType=DECIMAL},
+      RESULT_CONTACT_PERSON = #{resultContactPerson,jdbcType=VARCHAR},
+      RESULT_TELEPHONE_FAX = #{resultTelephoneFax,jdbcType=VARCHAR},
+      GROUP_ID = #{groupId,jdbcType=DECIMAL},
+      RESULT_NUMBER_OF_LOANS = #{resultNumberOfLoans,jdbcType=DECIMAL},
+      RESULT_FREIGHT_FORWARDING_INFO = #{resultFreightForwardingInfo,jdbcType=VARCHAR},
+      RESULT_MEMO = #{resultMemo,jdbcType=VARCHAR},
+      RESULT_DATE_OF_LOANS = #{resultDateOfLoans,jdbcType=TIMESTAMP},
+      CARGO_ID = #{cargoId,jdbcType=DECIMAL},
+      CARGO_IMAGE_URL = #{cargoImageUrl,jdbcType=VARCHAR}
     where NOTICE_ID = #{noticeId,jdbcType=DECIMAL}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsshipDeliveryNotice">
     update AMSSHIP_DELIVERY_NOTICE
     <set>
-      <if test="requesterGroupId != null">
-        REQUESTER_GROUP_ID = #{requesterGroupId,jdbcType=DECIMAL},
-      </if>
-      <if test="carrierId != null">
-        CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
-      </if>
       <if test="noticeCommerceMethod != null">
         NOTICE_COMMERCE_METHOD = #{noticeCommerceMethod,jdbcType=VARCHAR},
       </if>
@@ -859,212 +816,202 @@
     <include refid="whereLike" />
   </select>
   <insert id="batchInsert" parameterType="java.util.List">
-    insert into AMSSHIP_DELIVERY_NOTICE
-    (NOTICE_ID,
-    REQUESTER_GROUP_ID, CARRIER_ID,
-    NOTICE_COMMERCE_METHOD, NOTICE_HANDOVER_METHOD,
-    PORT_ID, NOTICE_PORT_CONSTRUCTION_FEE,
-    NOTICE_DELIVERY_TIME, NOTICE_PILE_FREE_DAYS,
-    DELETE_NAME, DELETE_TIME, INSERT_USERNAME,
-    INSERT_TIME, UPDATE_USERNAME,
-    UPDATE_TIME, INSERT_UPDATE_REMARK,
-    NOTICE_DISTRIBUTION_STATUS, DELETED,
-    BATCH_ID, PURCHASE_CONTRACT_UNIT_PRICE,
-    PURCHASE_CONTRACT_MOISTURE, TFE_CONTENT,
-    SILICA_CONTENT, ALUMINA_CONTENT,
-    PHOSPHORUS_CONTENT, MANGANESE_CONTENT,
-    IS_NEED_PORT_FEE, IS_NEED_PORT_CHARGE,
-    MATERIAL_TYPE_ID, RESULT_CONTACT_PERSON,
-    RESULT_TELEPHONE_FAX, GROUP_ID,
-    RESULT_NUMBER_OF_LOANS, RESULT_FREIGHT_FORWARDING_INFO,
-    RESULT_MEMO, RESULT_DATE_OF_LOANS,
-    CARGO_ID, CARGO_IMAGE_URL)
-    ( <foreach collection="list" item="item" separator="union all">
-    select
-    #{item.noticeId,jdbcType=DECIMAL},
-    #{item.requesterGroupId,jdbcType=DECIMAL}, #{item.carrierId,jdbcType=DECIMAL},
-    #{item.noticeCommerceMethod,jdbcType=VARCHAR}, #{item.noticeHandoverMethod,jdbcType=VARCHAR},
-    #{item.portId,jdbcType=DECIMAL}, #{item.noticePortConstructionFee,jdbcType=DECIMAL},
-    #{item.noticeDeliveryTime,jdbcType=TIMESTAMP}, #{item.noticePileFreeDays,jdbcType=DECIMAL},
-    #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR},
-    #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
-    #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
-    #{item.noticeDistributionStatus,jdbcType=DECIMAL}, #{item.deleted,jdbcType=DECIMAL},
-    #{item.batchId,jdbcType=DECIMAL}, #{item.purchaseContractUnitPrice,jdbcType=DECIMAL},
-    #{item.purchaseContractMoisture,jdbcType=VARCHAR}, #{item.tfeContent,jdbcType=VARCHAR},
-    #{item.silicaContent,jdbcType=VARCHAR}, #{item.aluminaContent,jdbcType=VARCHAR},
-    #{item.phosphorusContent,jdbcType=VARCHAR}, #{item.manganeseContent,jdbcType=VARCHAR},
-    #{item.isNeedPortFee,jdbcType=VARCHAR}, #{item.isNeedPortCharge,jdbcType=VARCHAR},
-    #{item.materialTypeId,jdbcType=DECIMAL}, #{item.resultContactPerson,jdbcType=VARCHAR},
-    #{item.resultTelephoneFax,jdbcType=VARCHAR}, #{item.groupId,jdbcType=DECIMAL},
-    #{item.resultNumberOfLoans,jdbcType=DECIMAL}, #{item.resultFreightForwardingInfo,jdbcType=VARCHAR},
-    #{item.resultMemo,jdbcType=VARCHAR}, #{item.resultDateOfLoans,jdbcType=TIMESTAMP},
-    #{item.cargoId,jdbcType=DECIMAL}, #{item.cargoImageUrl,jdbcType=VARCHAR} from dual
-  </foreach> )
+    insert into AMSSHIP_DELIVERY_NOTICE 
+      (NOTICE_ID, 
+      NOTICE_COMMERCE_METHOD, NOTICE_HANDOVER_METHOD, 
+      PORT_ID, NOTICE_PORT_CONSTRUCTION_FEE, 
+      NOTICE_DELIVERY_TIME, NOTICE_PILE_FREE_DAYS, 
+      DELETE_NAME, DELETE_TIME, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, 
+      NOTICE_DISTRIBUTION_STATUS, DELETED, 
+      BATCH_ID, PURCHASE_CONTRACT_UNIT_PRICE, 
+      PURCHASE_CONTRACT_MOISTURE, TFE_CONTENT, 
+      SILICA_CONTENT, ALUMINA_CONTENT, 
+      PHOSPHORUS_CONTENT, MANGANESE_CONTENT, 
+      IS_NEED_PORT_FEE, IS_NEED_PORT_CHARGE, 
+      MATERIAL_TYPE_ID, RESULT_CONTACT_PERSON, 
+      RESULT_TELEPHONE_FAX, GROUP_ID, 
+      RESULT_NUMBER_OF_LOANS, RESULT_FREIGHT_FORWARDING_INFO, 
+      RESULT_MEMO, RESULT_DATE_OF_LOANS, 
+      CARGO_ID, CARGO_IMAGE_URL)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.noticeId,jdbcType=DECIMAL}, 
+      #{item.noticeCommerceMethod,jdbcType=VARCHAR}, #{item.noticeHandoverMethod,jdbcType=VARCHAR}, 
+      #{item.portId,jdbcType=DECIMAL}, #{item.noticePortConstructionFee,jdbcType=DECIMAL}, 
+      #{item.noticeDeliveryTime,jdbcType=TIMESTAMP}, #{item.noticePileFreeDays,jdbcType=DECIMAL}, 
+      #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR}, 
+      #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR}, 
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}, 
+      #{item.noticeDistributionStatus,jdbcType=DECIMAL}, #{item.deleted,jdbcType=DECIMAL}, 
+      #{item.batchId,jdbcType=DECIMAL}, #{item.purchaseContractUnitPrice,jdbcType=DECIMAL}, 
+      #{item.purchaseContractMoisture,jdbcType=VARCHAR}, #{item.tfeContent,jdbcType=VARCHAR}, 
+      #{item.silicaContent,jdbcType=VARCHAR}, #{item.aluminaContent,jdbcType=VARCHAR}, 
+      #{item.phosphorusContent,jdbcType=VARCHAR}, #{item.manganeseContent,jdbcType=VARCHAR}, 
+      #{item.isNeedPortFee,jdbcType=VARCHAR}, #{item.isNeedPortCharge,jdbcType=VARCHAR}, 
+      #{item.materialTypeId,jdbcType=DECIMAL}, #{item.resultContactPerson,jdbcType=VARCHAR}, 
+      #{item.resultTelephoneFax,jdbcType=VARCHAR}, #{item.groupId,jdbcType=DECIMAL}, 
+      #{item.resultNumberOfLoans,jdbcType=DECIMAL}, #{item.resultFreightForwardingInfo,jdbcType=VARCHAR}, 
+      #{item.resultMemo,jdbcType=VARCHAR}, #{item.resultDateOfLoans,jdbcType=TIMESTAMP}, 
+      #{item.cargoId,jdbcType=DECIMAL}, #{item.cargoImageUrl,jdbcType=VARCHAR} from dual  
+   </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
-    update AMSSHIP_DELIVERY_NOTICE
-    set
-    NOTICE_ID=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeId,jdbcType=DECIMAL}
-    </foreach>
-    ,REQUESTER_GROUP_ID=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.requesterGroupId,jdbcType=DECIMAL}
-    </foreach>
-    ,CARRIER_ID=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
-    </foreach>
-    ,NOTICE_COMMERCE_METHOD=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeCommerceMethod,jdbcType=VARCHAR}
-    </foreach>
-    ,NOTICE_HANDOVER_METHOD=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeHandoverMethod,jdbcType=VARCHAR}
-    </foreach>
-    ,PORT_ID=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.portId,jdbcType=DECIMAL}
-    </foreach>
-    ,NOTICE_PORT_CONSTRUCTION_FEE=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticePortConstructionFee,jdbcType=DECIMAL}
-    </foreach>
-    ,NOTICE_DELIVERY_TIME=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeDeliveryTime,jdbcType=TIMESTAMP}
-    </foreach>
-    ,NOTICE_PILE_FREE_DAYS=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticePileFreeDays,jdbcType=DECIMAL}
-    </foreach>
-    ,DELETE_NAME=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
-    </foreach>
-    ,DELETE_TIME=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=VARCHAR}
-    </foreach>
-    ,INSERT_USERNAME=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
-    </foreach>
-    ,INSERT_TIME=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
-    </foreach>
-    ,UPDATE_USERNAME=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
-    </foreach>
-    ,UPDATE_TIME=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
-    </foreach>
-    ,INSERT_UPDATE_REMARK=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
-    </foreach>
-    ,NOTICE_DISTRIBUTION_STATUS=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeDistributionStatus,jdbcType=DECIMAL}
-    </foreach>
-    ,DELETED=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
-    </foreach>
-    ,BATCH_ID=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
-    </foreach>
-    ,PURCHASE_CONTRACT_UNIT_PRICE=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.purchaseContractUnitPrice,jdbcType=DECIMAL}
-    </foreach>
-    ,PURCHASE_CONTRACT_MOISTURE=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.purchaseContractMoisture,jdbcType=VARCHAR}
-    </foreach>
-    ,TFE_CONTENT=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.tfeContent,jdbcType=VARCHAR}
-    </foreach>
-    ,SILICA_CONTENT=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.silicaContent,jdbcType=VARCHAR}
-    </foreach>
-    ,ALUMINA_CONTENT=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.aluminaContent,jdbcType=VARCHAR}
-    </foreach>
-    ,PHOSPHORUS_CONTENT=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.phosphorusContent,jdbcType=VARCHAR}
-    </foreach>
-    ,MANGANESE_CONTENT=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.manganeseContent,jdbcType=VARCHAR}
-    </foreach>
-    ,IS_NEED_PORT_FEE=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.isNeedPortFee,jdbcType=VARCHAR}
-    </foreach>
-    ,IS_NEED_PORT_CHARGE=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.isNeedPortCharge,jdbcType=VARCHAR}
-    </foreach>
-    ,MATERIAL_TYPE_ID=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.materialTypeId,jdbcType=DECIMAL}
-    </foreach>
-    ,RESULT_CONTACT_PERSON=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.resultContactPerson,jdbcType=VARCHAR}
-    </foreach>
-    ,RESULT_TELEPHONE_FAX=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.resultTelephoneFax,jdbcType=VARCHAR}
-    </foreach>
-    ,GROUP_ID=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.groupId,jdbcType=DECIMAL}
-    </foreach>
-    ,RESULT_NUMBER_OF_LOANS=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.resultNumberOfLoans,jdbcType=DECIMAL}
-    </foreach>
-    ,RESULT_FREIGHT_FORWARDING_INFO=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.resultFreightForwardingInfo,jdbcType=VARCHAR}
-    </foreach>
-    ,RESULT_MEMO=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.resultMemo,jdbcType=VARCHAR}
-    </foreach>
-    ,RESULT_DATE_OF_LOANS=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.resultDateOfLoans,jdbcType=TIMESTAMP}
-    </foreach>
-    ,CARGO_ID=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.cargoId,jdbcType=DECIMAL}
-    </foreach>
-    ,CARGO_IMAGE_URL=
-    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
-      when #{item.noticeId,jdbcType=DECIMAL} then #{item.cargoImageUrl,jdbcType=VARCHAR}
-    </foreach>
-    where NOTICE_ID in
-    <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
-      #{item.noticeId,jdbcType=DECIMAL}
-    </foreach>
+     update AMSSHIP_DELIVERY_NOTICE
+     set
+       NOTICE_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeId,jdbcType=DECIMAL}
+       </foreach>
+       ,NOTICE_COMMERCE_METHOD=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeCommerceMethod,jdbcType=VARCHAR}
+       </foreach>
+       ,NOTICE_HANDOVER_METHOD=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeHandoverMethod,jdbcType=VARCHAR}
+       </foreach>
+       ,PORT_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.portId,jdbcType=DECIMAL}
+       </foreach>
+       ,NOTICE_PORT_CONSTRUCTION_FEE=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticePortConstructionFee,jdbcType=DECIMAL}
+       </foreach>
+       ,NOTICE_DELIVERY_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeDeliveryTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,NOTICE_PILE_FREE_DAYS=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticePileFreeDays,jdbcType=DECIMAL}
+       </foreach>
+       ,DELETE_NAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
+       </foreach>
+       ,DELETE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+       ,NOTICE_DISTRIBUTION_STATUS=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeDistributionStatus,jdbcType=DECIMAL}
+       </foreach>
+       ,DELETED=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+       </foreach>
+       ,BATCH_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
+       </foreach>
+       ,PURCHASE_CONTRACT_UNIT_PRICE=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.purchaseContractUnitPrice,jdbcType=DECIMAL}
+       </foreach>
+       ,PURCHASE_CONTRACT_MOISTURE=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.purchaseContractMoisture,jdbcType=VARCHAR}
+       </foreach>
+       ,TFE_CONTENT=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.tfeContent,jdbcType=VARCHAR}
+       </foreach>
+       ,SILICA_CONTENT=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.silicaContent,jdbcType=VARCHAR}
+       </foreach>
+       ,ALUMINA_CONTENT=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.aluminaContent,jdbcType=VARCHAR}
+       </foreach>
+       ,PHOSPHORUS_CONTENT=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.phosphorusContent,jdbcType=VARCHAR}
+       </foreach>
+       ,MANGANESE_CONTENT=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.manganeseContent,jdbcType=VARCHAR}
+       </foreach>
+       ,IS_NEED_PORT_FEE=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.isNeedPortFee,jdbcType=VARCHAR}
+       </foreach>
+       ,IS_NEED_PORT_CHARGE=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.isNeedPortCharge,jdbcType=VARCHAR}
+       </foreach>
+       ,MATERIAL_TYPE_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.materialTypeId,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_CONTACT_PERSON=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.resultContactPerson,jdbcType=VARCHAR}
+       </foreach>
+       ,RESULT_TELEPHONE_FAX=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.resultTelephoneFax,jdbcType=VARCHAR}
+       </foreach>
+       ,GROUP_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.groupId,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_NUMBER_OF_LOANS=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.resultNumberOfLoans,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_FREIGHT_FORWARDING_INFO=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.resultFreightForwardingInfo,jdbcType=VARCHAR}
+       </foreach>
+       ,RESULT_MEMO=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.resultMemo,jdbcType=VARCHAR}
+       </foreach>
+       ,RESULT_DATE_OF_LOANS=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.resultDateOfLoans,jdbcType=TIMESTAMP}
+       </foreach>
+       ,CARGO_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.cargoId,jdbcType=DECIMAL}
+       </foreach>
+       ,CARGO_IMAGE_URL=
+       <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+          when #{item.noticeId,jdbcType=DECIMAL} then #{item.cargoImageUrl,jdbcType=VARCHAR}
+       </foreach>
+     where NOTICE_ID in 
+     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+    #{item.noticeId,jdbcType=DECIMAL}
+     </foreach> 
   </update>
   <delete id="batchDelete" parameterType="java.util.List">
     delete from AMSSHIP_DELIVERY_NOTICE
-    where NOTICE_ID in
+    where NOTICE_ID in 
     <foreach close=")" collection="list" item="id" open="(" separator=",">
       #{id}
     </foreach>
@@ -1077,8 +1024,6 @@
     from
     (
     select DISTINCT
-    t3.SHIPPER_NAME  "shipperName",
-    t4.PORT_NAME "carrierName",
     t1.NOTICE_COMMERCE_METHOD   "noticeCommerceMethod",
     t1.NOTICE_HANDOVER_METHOD   "noticeHandoverMethod",
     t1.NOTICE_PORT_CONSTRUCTION_FEE  "noticePortConstructionFee",
@@ -1094,8 +1039,7 @@
     t8.MATERIAL_NAME "materialName",
     t7.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
     t1.RESULT_NUMBER_OF_LOANS  "resultNumberOfLoans",
-
-    DBI.INFACTORY_SHIP_NAME "infactoryShipName",
+    DBI.INFACTORY_SHIP_NAME "infactoryShipName",--进厂船名
     t6.PORT_NAME "portName",
     t1.NOTICE_ID  "noticeId",
     t1.BATCH_ID "batchId",
@@ -1110,11 +1054,6 @@
     t1.RESULT_MEMO "resultMemo",
     RC.CARGO_CARRIER_NAME "cargoName"
     from  AMSSHIP_DELIVERY_NOTICE t1
-    left join RMS_SHIPPER t3
-    on t1.REQUESTER_GROUP_ID=t3.SHIPPER_ID
-    left join RMS_PORT t4
-    on t1.CARRIER_ID=t4.PORT_ID
-
     left join RMS_MATERIAL_TYPE RMT
     ON T1.MATERIAL_TYPE_ID =RMT.MATERIAL_TYPE_ID
     LEFT JOIN RMS_CARGODEP RC
@@ -1179,22 +1118,6 @@
         </foreach>
       </if>
     </where>
-    <where>
-      <if test="shipperName!= null">
-        and   t3.SHIPPER_NAME in
-        <foreach close=")" collection="resultNumber" item="item" open="(" separator=",">
-          #{item}
-        </foreach>
-      </if>
-    </where>
-    <where>
-      <if test="carrierName!= null">
-        and   t4.CARRIER_NAME in
-        <foreach close=")" collection="resultNumber" item="item" open="(" separator=",">
-          #{item}
-        </foreach>
-      </if>
-    </where>
     <where>
       <if test="resultNumberOfLoans!= null">
         and    t5.RESULT_NUMBER_OF_LOANS in
@@ -1260,8 +1183,6 @@
   <select id="selectByNoticeId" resultType="java.util.Map">
     select
       t1.BATCH_ID "batchId",
-      t1.REQUESTER_GROUP_ID "requesterGroupId",
-      t1.CARRIER_ID  "carrierId",
       t1.NOTICE_COMMERCE_METHOD "noticeCommerceMethod",
       t1.NOTICE_HANDOVER_METHOD "noticeHandoverMethod",
       t1.PORT_ID  "portId",
@@ -1311,10 +1232,8 @@
       t1.NOTICE_ID=#{noticeId}
   </select>
   <select id="getLoadDeliveryNotice" resultType="java.lang.String" parameterType="java.lang.Integer">
-   select  ADN.CARGO_IMAGE_URL "imageUrl"
-   from AMSSHIP_DELIVERY_NOTICE ADN
-   WHERE ADN.NOTICE_ID=#{noticeId}
+    select  ADN.CARGO_IMAGE_URL "imageUrl"
+    from AMSSHIP_DELIVERY_NOTICE ADN
+    WHERE ADN.NOTICE_ID=#{noticeId}
   </select>
-
-
 </mapper>

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

@@ -536,7 +536,7 @@
         left join RMS_MATERIAL rm
         on db.MATERIAL_ID = rm.MATERIAL_ID
         left join RMS_SHIPPER rs
-        on adn.REQUESTER_GROUP_ID=rs.SHIPPER_ID
+        on ada.REQUESTER_GROUP_ID=rs.SHIPPER_ID
         where osi.DELETED = 0 and osi.INSTRUCTION_ISSUE_STATUS=#{status}
         )
         <where>

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

@@ -487,7 +487,7 @@
            LEFT JOIN DIL_BATCH db
                      ON dbi.BATCH_ID = db.BATCH_ID
            LEFT JOIN AMSSHIP_DELIVERY_ATTORNEY ada
-                     ON ada.BATCH_ID=db.BATCH_ID
+                     ON ada.BATCH_ID=dbi.BATCH_INFACOTRY_ID
            LEFT JOIN RMS_MATERIAL rm
                      ON db.MATERIAL_ID = rm.MATERIAL_ID
            LEFT JOIN TMSSHIP_LOAD_SHIP_RESULT tlsr

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

@@ -435,7 +435,7 @@
         LEFT JOIN AMSSHIP_DELIVERY_NOTICE adn
         on adn.BATCH_ID = ada.BATCH_ID
         LEFT JOIN RMS_PORT rp
-        ON adn.CARRIER_ID = rp.PORT_ID
+        ON ada.CARRIER_ID = rp.PORT_ID
         LEFT JOIN RMS_PIER pier
         ON pier.PIER_ID = adn.GROUP_ID
         LEFT JOIN TMSSHIP_LOAD_SHIP_RESULT tlsr