Selaa lähdekoodia

'销售意见修改'

HUJIANGUO 3 vuotta sitten
vanhempi
commit
23fcdc70f4

+ 23 - 23
pom.xml

@@ -136,29 +136,29 @@
     <build>
         <plugins>
             <!--             自动生成代码文件 -->
-<!--            <plugin>-->
-<!--                <groupId>com.steerinfo</groupId>-->
-<!--                <artifactId>generator-maven-plugin</artifactId>-->
-<!--                <version>3.0</version>-->
-<!--                <configuration>-->
-<!--                    <connUrl>jdbc:oracle:thin:@172.16.33.163:1521:ilsdbpri</connUrl>-->
-<!--                    <user>dil</user>-->
-<!--                    <password>Dil123789</password>-->
-<!--                    &lt;!&ndash;包名&ndash;&gt;-->
-<!--                    <targetPackage>com.steerinfo.dil</targetPackage>-->
-<!--                    <tables>-->
-<!--                        <param></param>-->
-<!--                    </tables>-->
-<!--                </configuration>-->
-<!--                <executions>-->
-<!--                    <execution>-->
-<!--                        <phase>compile</phase>-->
-<!--                        <goals>-->
-<!--                            <goal>steerinfo</goal>-->
-<!--                        </goals>-->
-<!--                    </execution>-->
-<!--                </executions>-->
-<!--            </plugin>-->
+            <plugin>
+                <groupId>com.steerinfo</groupId>
+                <artifactId>generator-maven-plugin</artifactId>
+                <version>3.0</version>
+                <configuration>
+                    <connUrl>jdbc:oracle:thin:@172.16.33.163:1521:ilsdbpri</connUrl>
+                    <user>dil</user>
+                    <password>Dil123789</password>
+                    <!--包名-->
+                    <targetPackage>com.steerinfo.dil</targetPackage>
+                    <tables>
+                        <param>TMSTRUCK_LOAD_RESULT</param>
+                    </tables>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>steerinfo</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>

+ 19 - 4
src/main/java/com/steerinfo/dil/model/TmstruckLoadResult.java

@@ -10,13 +10,13 @@ import java.util.Date;
 @ApiModel(value="汽运装货实绩")
 public class TmstruckLoadResult implements IBasePO<BigDecimal> {
     /**
-     * 主键id(RESULT_ID,DECIMAL,38)
+     * 主键id(RESULT_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="主键id",required=true)
     private BigDecimal resultId;
 
     /**
-     * 实绩总表ID(RESULT_TOTAL_ID,DECIMAL,38)
+     * 实绩总表ID(RESULT_TOTAL_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="实绩总表ID",required=false)
     private BigDecimal resultTotalId;
@@ -40,13 +40,13 @@ public class TmstruckLoadResult implements IBasePO<BigDecimal> {
     private BigDecimal resultLoadDuration;
 
     /**
-     * 装货标准时长id(LOAD_STANDARD_TIME_ID,DECIMAL,38)
+     * 装货标准时长id(LOAD_STANDARD_TIME_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="装货标准时长id",required=false)
     private BigDecimal loadStandardTimeId;
 
     /**
-     * 装卸工ID(LOADER_ID,DECIMAL,38)
+     * 装卸工ID(LOADER_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="装卸工ID",required=false)
     private BigDecimal loaderId;
@@ -141,6 +141,12 @@ public class TmstruckLoadResult implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="路段顺序号",required=false)
     private BigDecimal segmentSqe;
 
+    /**
+     * 集装箱箱号(CASE_NUMBER,VARCHAR,255)
+     */
+    @ApiModelProperty(value="集装箱箱号",required=false)
+    private String caseNumber;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -329,6 +335,14 @@ public class TmstruckLoadResult implements IBasePO<BigDecimal> {
         this.segmentSqe = segmentSqe;
     }
 
+    public String getCaseNumber() {
+        return caseNumber;
+    }
+
+    public void setCaseNumber(String caseNumber) {
+        this.caseNumber = caseNumber == null ? null : caseNumber.trim();
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -357,6 +371,7 @@ public class TmstruckLoadResult implements IBasePO<BigDecimal> {
         sb.append(", loadingSequence=").append(loadingSequence);
         sb.append(", isdeduct=").append(isdeduct);
         sb.append(", segmentSqe=").append(segmentSqe);
+        sb.append(", caseNumber=").append(caseNumber);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

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

@@ -278,6 +278,7 @@ public class TmstruckLoadResultServiceImpl implements ITmstruckLoadResultService
         // 更新装货点
         tmstruckLoadResult.setLoadingId(DataChange.dataToBigDecimal(map.get("warehouseId")));
         tmstruckLoadResult.setInsertUpdateRemark((String) map.get("insertUpdateRemark"));
+        tmstruckLoadResult.setCaseNumber((String) map.get("caseNumber"));
         int i = tmstruckLoadResultMapper.updateByPrimaryKeySelective(tmstruckLoadResult);
         //更新路段顺序号
         i += utilsService.updateOrderLineSequence(map);

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

@@ -31,7 +31,7 @@ openfeign:
   WMSFeign:
     url: ${WMSFEIGN_URL:172.16.33.162:8012}
   OmsFeign:
-    url: ${OMSFEIGN_URL:172.16.33.162:8016}
+    url: ${OMSFEIGN_URL:localhost:8016}
   JoinFeign:
     url: ${JOINFEIGN_URL:172.16.33.162:8006}
   QmsFeign:
@@ -39,7 +39,7 @@ openfeign:
   ImFeign:
     url: ${IMFEIGN_URL:172.16.33.166:8055}
   AmsFeign:
-    url: ${AMSFEIGN_URL:172.16.33.162:8015}
+    url: ${AMSFEIGN_URL:localhost:8015}
 
 server:
   port: 8008

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

@@ -150,7 +150,7 @@
         select
                *
         from (
-                 select OO.ORDER_NUMBER              "orderNumber",
+                 select DISTINCT OO.ORDER_NUMBER              "orderNumber",
                         RC.CAPACITY_NUMBER           "capacityNumber",
                         TER.RESULT_ENTRY_GATE_TIME   "resultEntryGateTime",
                         TWR.RESULT_TARE_WEIGHT_TIME  "resultTareWeightTime",
@@ -170,6 +170,7 @@
                         RM.MATERIAL_NAME                     "materialName",
                         TLR.INSERT_UPDATE_REMARK             "materialRemark",
                         ASO.SALE_NUMBER                      "saleNumber",
+                        TLR.CASE_NUMBER                      "caseNumber",
                         CONCAT(CONCAT(RM.MATERIAL_SPECIFICATION, '('), CONCAT(RM.MATERIAL_MODEL, ')')) "materialCode"
                  from OMSTRUCK_ORDER OO
                           left join AMS_SALE_ORDER_MATERIAL ASOM
@@ -238,6 +239,11 @@
                     "outGatepostName" like '%${item}%'
                 </foreach>
             </if>
+            <if test="caseNumber != null">
+                <foreach collection="caseNumber" item="item" open="(" separator="or" close=")">
+                    "caseNumber" like '%${item}%'
+                </foreach>
+            </if>
             <if test="capacityNumber != null">
                 and
                 <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">

+ 1572 - 1543
src/main/resources/com/steerinfo/dil/mapper/TmstruckLoadResultMapper.xml

@@ -1,1591 +1,1620 @@
 <?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.TmstruckLoadResultMapper">
-    <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckLoadResult">
-        <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
-        <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
-        <result column="RESULT_LOAD_START_TIME" jdbcType="TIMESTAMP" property="resultLoadStartTime" />
-        <result column="RESULT_LOAD_END_TIME" jdbcType="TIMESTAMP" property="resultLoadEndTime" />
-        <result column="RESULT_LOAD_DURATION" jdbcType="DECIMAL" property="resultLoadDuration" />
-        <result column="LOAD_STANDARD_TIME_ID" jdbcType="DECIMAL" property="loadStandardTimeId" />
-        <result column="LOADER_ID" jdbcType="DECIMAL" property="loaderId" />
-        <result column="RESULT_ISCLEAR" jdbcType="VARCHAR" property="resultIsclear" />
-        <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
-        <result column="DELETE_TIME" jdbcType="TIMESTAMP" 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="STATUS" jdbcType="DECIMAL" property="status" />
-        <result column="RESULT_MEASURED_TONNAGE" jdbcType="DECIMAL" property="resultMeasuredTonnage" />
-        <result column="LOADING_ID" jdbcType="DECIMAL" property="loadingId" />
-        <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
-        <result column="LOADING_SEQUENCE" jdbcType="DECIMAL" property="loadingSequence" />
-        <result column="ISDEDUCT" jdbcType="DECIMAL" property="isdeduct" />
-        <result column="SEGMENT_SQE" jdbcType="DECIMAL" property="segmentSqe" />
-    </resultMap>
-    <sql id="columns">
-        RESULT_ID, RESULT_TOTAL_ID, RESULT_LOAD_START_TIME, RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION,
-    LOAD_STANDARD_TIME_ID, LOADER_ID, RESULT_ISCLEAR, DELETE_NAME, DELETE_TIME, INSERT_USERNAME,
-    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
-    LOADING_ID, MATERIAL_ID, LOADING_SEQUENCE, ISDEDUCT, SEGMENT_SQE
-    </sql>
-    <sql id="columns_alias">
-        t.RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_LOAD_START_TIME, t.RESULT_LOAD_END_TIME,
-    t.RESULT_LOAD_DURATION, t.LOAD_STANDARD_TIME_ID, t.LOADER_ID, t.RESULT_ISCLEAR, t.DELETE_NAME,
-    t.DELETE_TIME, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
-    t.INSERT_UPDATE_REMARK, t.STATUS, t.RESULT_MEASURED_TONNAGE, t.LOADING_ID, t.MATERIAL_ID,
-    t.LOADING_SEQUENCE, t.ISDEDUCT, t.SEGMENT_SQE
-    </sql>
-    <sql id="select">
-        SELECT <include refid="columns"/> FROM TMSTRUCK_LOAD_RESULT
-    </sql>
-    <sql id="select_alias">
-        SELECT <include refid="columns_alias"/> FROM TMSTRUCK_LOAD_RESULT t
-    </sql>
-    <sql id="where">
-        <where>
-            <if test="resultId != null">
-                and RESULT_ID = #{resultId}
-            </if>
-            <if test="resultTotalId != null">
-                and RESULT_TOTAL_ID = #{resultTotalId}
-            </if>
-            <if test="resultLoadStartTime != null">
-                and TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = #{resultLoadStartTime}
-            </if>
-            <if test="resultLoadEndTime != null">
-                and TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = #{resultLoadEndTime}
-            </if>
-            <if test="resultLoadDuration != null">
-                and RESULT_LOAD_DURATION = #{resultLoadDuration}
-            </if>
-            <if test="loadStandardTimeId != null">
-                and LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
-            </if>
-            <if test="loaderId != null">
-                and LOADER_ID = #{loaderId}
-            </if>
-            <if test="resultIsclear != null and resultIsclear != ''">
-                and RESULT_ISCLEAR = #{resultIsclear}
-            </if>
-            <if test="deleteName != null and deleteName != ''">
-                and DELETE_NAME = #{deleteName}
-            </if>
-            <if test="deleteTime != null">
-                and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{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="status != null">
-                and STATUS = #{status}
-            </if>
-            <if test="resultMeasuredTonnage != null">
-                and RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
-            </if>
-            <if test="loadingId != null">
-                and LOADING_ID = #{loadingId}
-            </if>
-            <if test="materialId != null">
-                and MATERIAL_ID = #{materialId}
-            </if>
-            <if test="loadingSequence != null">
-                and LOADING_SEQUENCE = #{loadingSequence}
-            </if>
-            <if test="isdeduct != null">
-                and ISDEDUCT = #{isdeduct}
-            </if>
-            <if test="segmentSqe != null">
-                and SEGMENT_SQE = #{segmentSqe}
-            </if>
-        </where>
-    </sql>
-    <sql id="whereLike">
-        <where>
-            <if test="resultId != null">
-                and RESULT_ID = #{resultId}
-            </if>
-            <if test="resultTotalId != null">
-                and RESULT_TOTAL_ID = #{resultTotalId}
-            </if>
-            <if test="resultLoadStartTime != null">
-                and TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = #{resultLoadStartTime}
-            </if>
-            <if test="resultLoadEndTime != null">
-                and TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = #{resultLoadEndTime}
-            </if>
-            <if test="resultLoadDuration != null">
-                and RESULT_LOAD_DURATION = #{resultLoadDuration}
-            </if>
-            <if test="loadStandardTimeId != null">
-                and LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
-            </if>
-            <if test="loaderId != null">
-                and LOADER_ID = #{loaderId}
-            </if>
-            <if test="resultIsclear != null and resultIsclear != ''">
-                and RESULT_ISCLEAR LIKE '%${resultIsclear}%'
-            </if>
-            <if test="deleteName != null and deleteName != ''">
-                and DELETE_NAME LIKE '%${deleteName}%'
-            </if>
-            <if test="deleteTime != null">
-                and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{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="status != null">
-                and STATUS = #{status}
-            </if>
-            <if test="resultMeasuredTonnage != null">
-                and RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
-            </if>
-            <if test="loadingId != null">
-                and LOADING_ID = #{loadingId}
-            </if>
-            <if test="materialId != null">
-                and MATERIAL_ID = #{materialId}
-            </if>
-            <if test="loadingSequence != null">
-                and LOADING_SEQUENCE = #{loadingSequence}
-            </if>
-            <if test="isdeduct != null">
-                and ISDEDUCT = #{isdeduct}
-            </if>
-            <if test="segmentSqe != null">
-                and SEGMENT_SQE = #{segmentSqe}
-            </if>
-        </where>
-    </sql>
-    <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
-        delete from TMSTRUCK_LOAD_RESULT
-        where RESULT_ID = #{resultId,jdbcType=DECIMAL}
-    </delete>
-    <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
-        delete from TMSTRUCK_LOAD_RESULT
-        where 1!=1
-        <if test="resultTotalId != null">
-            or RESULT_TOTAL_ID = #{resultTotalId}
-        </if>
-        <if test="resultLoadStartTime != null">
-            or TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = '#{resultLoadStartTime}'
-        </if>
-        <if test="resultLoadEndTime != null">
-            or TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = '#{resultLoadEndTime}'
-        </if>
-        <if test="resultLoadDuration != null">
-            or RESULT_LOAD_DURATION = #{resultLoadDuration}
-        </if>
-        <if test="loadStandardTimeId != null">
-            or LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
-        </if>
-        <if test="loaderId != null">
-            or LOADER_ID = #{loaderId}
-        </if>
-        <if test="resultIsclear != null and resultIsclear != ''">
-            or RESULT_ISCLEAR = #{resultIsclear}
-        </if>
-        <if test="deleteName != null and deleteName != ''">
-            or DELETE_NAME = #{deleteName}
-        </if>
-        <if test="deleteTime != null">
-            or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{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="status != null">
-            or STATUS = #{status}
-        </if>
-        <if test="resultMeasuredTonnage != null">
-            or RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
-        </if>
-        <if test="loadingId != null">
-            or LOADING_ID = #{loadingId}
-        </if>
-        <if test="materialId != null">
-            or MATERIAL_ID = #{materialId}
-        </if>
-        <if test="loadingSequence != null">
-            or LOADING_SEQUENCE = #{loadingSequence}
-        </if>
-        <if test="isdeduct != null">
-            or ISDEDUCT = #{isdeduct}
-        </if>
-        <if test="segmentSqe != null">
-            or SEGMENT_SQE = #{segmentSqe}
-        </if>
-    </delete>
-    <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
-        insert into TMSTRUCK_LOAD_RESULT (RESULT_ID, RESULT_TOTAL_ID, RESULT_LOAD_START_TIME,
-                                          RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION,
-                                          LOAD_STANDARD_TIME_ID, LOADER_ID, RESULT_ISCLEAR,
-                                          DELETE_NAME, DELETE_TIME, INSERT_USERNAME,
-                                          INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
-                                          INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
-                                          LOADING_ID, MATERIAL_ID, LOADING_SEQUENCE,
-                                          ISDEDUCT, SEGMENT_SQE)
-        values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{resultLoadStartTime,jdbcType=TIMESTAMP},
-                #{resultLoadEndTime,jdbcType=TIMESTAMP}, #{resultLoadDuration,jdbcType=DECIMAL},
-                #{loadStandardTimeId,jdbcType=DECIMAL}, #{loaderId,jdbcType=DECIMAL}, #{resultIsclear,jdbcType=VARCHAR},
-                #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR},
-                #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
-                #{insertUpdateRemark,jdbcType=VARCHAR}, #{status,jdbcType=DECIMAL}, #{resultMeasuredTonnage,jdbcType=DECIMAL},
-                #{loadingId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{loadingSequence,jdbcType=DECIMAL},
-                #{isdeduct,jdbcType=DECIMAL}, #{segmentSqe,jdbcType=DECIMAL})
-    </insert>
-    <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
-        insert into TMSTRUCK_LOAD_RESULT
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="resultId != null">
-                RESULT_ID,
-            </if>
-            <if test="resultTotalId != null">
-                RESULT_TOTAL_ID,
-            </if>
-            <if test="resultLoadStartTime != null">
-                RESULT_LOAD_START_TIME,
-            </if>
-            <if test="resultLoadEndTime != null">
-                RESULT_LOAD_END_TIME,
-            </if>
-            <if test="resultLoadDuration != null">
-                RESULT_LOAD_DURATION,
-            </if>
-            <if test="loadStandardTimeId != null">
-                LOAD_STANDARD_TIME_ID,
-            </if>
-            <if test="loaderId != null">
-                LOADER_ID,
-            </if>
-            <if test="resultIsclear != null">
-                RESULT_ISCLEAR,
-            </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="status != null">
-                STATUS,
-            </if>
-            <if test="resultMeasuredTonnage != null">
-                RESULT_MEASURED_TONNAGE,
-            </if>
-            <if test="loadingId != null">
-                LOADING_ID,
-            </if>
-            <if test="materialId != null">
-                MATERIAL_ID,
-            </if>
-            <if test="loadingSequence != null">
-                LOADING_SEQUENCE,
-            </if>
-            <if test="isdeduct != null">
-                ISDEDUCT,
-            </if>
-            <if test="segmentSqe != null">
-                SEGMENT_SQE,
-            </if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="resultId != null">
-                #{resultId,jdbcType=DECIMAL},
-            </if>
-            <if test="resultTotalId != null">
-                #{resultTotalId,jdbcType=DECIMAL},
-            </if>
-            <if test="resultLoadStartTime != null">
-                #{resultLoadStartTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="resultLoadEndTime != null">
-                #{resultLoadEndTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="resultLoadDuration != null">
-                #{resultLoadDuration,jdbcType=DECIMAL},
-            </if>
-            <if test="loadStandardTimeId != null">
-                #{loadStandardTimeId,jdbcType=DECIMAL},
-            </if>
-            <if test="loaderId != null">
-                #{loaderId,jdbcType=DECIMAL},
-            </if>
-            <if test="resultIsclear != null">
-                #{resultIsclear,jdbcType=VARCHAR},
-            </if>
-            <if test="deleteName != null">
-                #{deleteName,jdbcType=VARCHAR},
-            </if>
-            <if test="deleteTime != null">
-                #{deleteTime,jdbcType=TIMESTAMP},
-            </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="status != null">
-                #{status,jdbcType=DECIMAL},
-            </if>
-            <if test="resultMeasuredTonnage != null">
-                #{resultMeasuredTonnage,jdbcType=DECIMAL},
-            </if>
-            <if test="loadingId != null">
-                #{loadingId,jdbcType=DECIMAL},
-            </if>
-            <if test="materialId != null">
-                #{materialId,jdbcType=DECIMAL},
-            </if>
-            <if test="loadingSequence != null">
-                #{loadingSequence,jdbcType=DECIMAL},
-            </if>
-            <if test="isdeduct != null">
-                #{isdeduct,jdbcType=DECIMAL},
-            </if>
-            <if test="segmentSqe != null">
-                #{segmentSqe,jdbcType=DECIMAL},
-            </if>
-        </trim>
-    </insert>
-    <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
-        update TMSTRUCK_LOAD_RESULT
-        set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
-            RESULT_LOAD_START_TIME = #{resultLoadStartTime,jdbcType=TIMESTAMP},
-            RESULT_LOAD_END_TIME = #{resultLoadEndTime,jdbcType=TIMESTAMP},
-            RESULT_LOAD_DURATION = #{resultLoadDuration,jdbcType=DECIMAL},
-            LOAD_STANDARD_TIME_ID = #{loadStandardTimeId,jdbcType=DECIMAL},
-            LOADER_ID = #{loaderId,jdbcType=DECIMAL},
-            RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
-            DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
-            DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
-            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},
-            STATUS = #{status,jdbcType=DECIMAL},
-            RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage,jdbcType=DECIMAL},
-            LOADING_ID = #{loadingId,jdbcType=DECIMAL},
-            MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
-            LOADING_SEQUENCE = #{loadingSequence,jdbcType=DECIMAL},
-            ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
-            SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL}
-        where RESULT_ID = #{resultId,jdbcType=DECIMAL}
-    </update>
-    <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
-        update TMSTRUCK_LOAD_RESULT
-        <set>
-            <if test="resultTotalId != null">
-                RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
-            </if>
-            <if test="resultLoadStartTime != null">
-                RESULT_LOAD_START_TIME = #{resultLoadStartTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="resultLoadEndTime != null">
-                RESULT_LOAD_END_TIME = #{resultLoadEndTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="resultLoadDuration != null">
-                RESULT_LOAD_DURATION = #{resultLoadDuration,jdbcType=DECIMAL},
-            </if>
-            <if test="loadStandardTimeId != null">
-                LOAD_STANDARD_TIME_ID = #{loadStandardTimeId,jdbcType=DECIMAL},
-            </if>
-            <if test="loaderId != null">
-                LOADER_ID = #{loaderId,jdbcType=DECIMAL},
-            </if>
-            <if test="resultIsclear != null">
-                RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
-            </if>
-            <if test="deleteName != null">
-                DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
-            </if>
-            <if test="deleteTime != null">
-                DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
-            </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="status != null">
-                STATUS = #{status,jdbcType=DECIMAL},
-            </if>
-            <if test="resultMeasuredTonnage != null">
-                RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage,jdbcType=DECIMAL},
-            </if>
-            <if test="loadingId != null">
-                LOADING_ID = #{loadingId,jdbcType=DECIMAL},
-            </if>
-            <if test="materialId != null">
-                MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
-            </if>
-            <if test="loadingSequence != null">
-                LOADING_SEQUENCE = #{loadingSequence,jdbcType=DECIMAL},
-            </if>
-            <if test="isdeduct != null">
-                ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
-            </if>
-            <if test="segmentSqe != null">
-                SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
-            </if>
-        </set>
-        where RESULT_ID = #{resultId,jdbcType=DECIMAL}
-    </update>
-    <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
-        <include refid="select"/>
-        where RESULT_ID = #{resultId,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 TMSTRUCK_LOAD_RESULT
-        (RESULT_ID,
-        RESULT_TOTAL_ID, RESULT_LOAD_START_TIME,
-        RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION,
-        LOAD_STANDARD_TIME_ID, LOADER_ID,
-        RESULT_ISCLEAR, DELETE_NAME, DELETE_TIME,
-        INSERT_USERNAME, INSERT_TIME,
-        UPDATE_USERNAME, UPDATE_TIME,
-        INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
-        LOADING_ID, MATERIAL_ID, LOADING_SEQUENCE,
-        ISDEDUCT, SEGMENT_SQE)
-        ( <foreach collection="list" item="item" separator="union all">
-        select
-        #{item.resultId,jdbcType=DECIMAL},
-        #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultLoadStartTime,jdbcType=TIMESTAMP},
-        #{item.resultLoadEndTime,jdbcType=TIMESTAMP}, #{item.resultLoadDuration,jdbcType=DECIMAL},
-        #{item.loadStandardTimeId,jdbcType=DECIMAL}, #{item.loaderId,jdbcType=DECIMAL},
-        #{item.resultIsclear,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP},
-        #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
-        #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
-        #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.status,jdbcType=DECIMAL}, #{item.resultMeasuredTonnage,jdbcType=DECIMAL},
-        #{item.loadingId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL}, #{item.loadingSequence,jdbcType=DECIMAL},
-        #{item.isdeduct,jdbcType=DECIMAL}, #{item.segmentSqe,jdbcType=DECIMAL} from dual
-    </foreach> )
-    </insert>
-    <update id="batchUpdate" parameterType="java.util.List">
-        update TMSTRUCK_LOAD_RESULT
-        set
-        RESULT_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
-        </foreach>
-        ,RESULT_TOTAL_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
-        </foreach>
-        ,RESULT_LOAD_START_TIME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadStartTime,jdbcType=TIMESTAMP}
-        </foreach>
-        ,RESULT_LOAD_END_TIME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadEndTime,jdbcType=TIMESTAMP}
-        </foreach>
-        ,RESULT_LOAD_DURATION=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadDuration,jdbcType=DECIMAL}
-        </foreach>
-        ,LOAD_STANDARD_TIME_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.loadStandardTimeId,jdbcType=DECIMAL}
-        </foreach>
-        ,LOADER_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.loaderId,jdbcType=DECIMAL}
-        </foreach>
-        ,RESULT_ISCLEAR=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.resultIsclear,jdbcType=VARCHAR}
-        </foreach>
-        ,DELETE_NAME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
-        </foreach>
-        ,DELETE_TIME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
-        </foreach>
-        ,INSERT_USERNAME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
-        </foreach>
-        ,INSERT_TIME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
-        </foreach>
-        ,UPDATE_USERNAME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
-        </foreach>
-        ,UPDATE_TIME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
-        </foreach>
-        ,INSERT_UPDATE_REMARK=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
-        </foreach>
-        ,STATUS=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
-        </foreach>
-        ,RESULT_MEASURED_TONNAGE=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.resultMeasuredTonnage,jdbcType=DECIMAL}
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckLoadResult">
+    <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
+    <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
+    <result column="RESULT_LOAD_START_TIME" jdbcType="TIMESTAMP" property="resultLoadStartTime" />
+    <result column="RESULT_LOAD_END_TIME" jdbcType="TIMESTAMP" property="resultLoadEndTime" />
+    <result column="RESULT_LOAD_DURATION" jdbcType="DECIMAL" property="resultLoadDuration" />
+    <result column="LOAD_STANDARD_TIME_ID" jdbcType="DECIMAL" property="loadStandardTimeId" />
+    <result column="LOADER_ID" jdbcType="DECIMAL" property="loaderId" />
+    <result column="RESULT_ISCLEAR" jdbcType="VARCHAR" property="resultIsclear" />
+    <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
+    <result column="DELETE_TIME" jdbcType="TIMESTAMP" 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="STATUS" jdbcType="DECIMAL" property="status" />
+    <result column="RESULT_MEASURED_TONNAGE" jdbcType="DECIMAL" property="resultMeasuredTonnage" />
+    <result column="LOADING_ID" jdbcType="DECIMAL" property="loadingId" />
+    <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
+    <result column="LOADING_SEQUENCE" jdbcType="DECIMAL" property="loadingSequence" />
+    <result column="ISDEDUCT" jdbcType="DECIMAL" property="isdeduct" />
+    <result column="SEGMENT_SQE" jdbcType="DECIMAL" property="segmentSqe" />
+    <result column="CASE_NUMBER" jdbcType="VARCHAR" property="caseNumber" />
+  </resultMap>
+  <sql id="columns">
+    RESULT_ID, RESULT_TOTAL_ID, RESULT_LOAD_START_TIME, RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION, 
+    LOAD_STANDARD_TIME_ID, LOADER_ID, RESULT_ISCLEAR, DELETE_NAME, DELETE_TIME, INSERT_USERNAME, 
+    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE, 
+    LOADING_ID, MATERIAL_ID, LOADING_SEQUENCE, ISDEDUCT, SEGMENT_SQE, CASE_NUMBER
+  </sql>
+  <sql id="columns_alias">
+    t.RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_LOAD_START_TIME, t.RESULT_LOAD_END_TIME, 
+    t.RESULT_LOAD_DURATION, t.LOAD_STANDARD_TIME_ID, t.LOADER_ID, t.RESULT_ISCLEAR, t.DELETE_NAME, 
+    t.DELETE_TIME, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, 
+    t.INSERT_UPDATE_REMARK, t.STATUS, t.RESULT_MEASURED_TONNAGE, t.LOADING_ID, t.MATERIAL_ID, 
+    t.LOADING_SEQUENCE, t.ISDEDUCT, t.SEGMENT_SQE, t.CASE_NUMBER
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM TMSTRUCK_LOAD_RESULT
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM TMSTRUCK_LOAD_RESULT t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="resultTotalId != null">
+        and RESULT_TOTAL_ID = #{resultTotalId}
+      </if>
+      <if test="resultLoadStartTime != null">
+        and TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = #{resultLoadStartTime}
+      </if>
+      <if test="resultLoadEndTime != null">
+        and TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = #{resultLoadEndTime}
+      </if>
+      <if test="resultLoadDuration != null">
+        and RESULT_LOAD_DURATION = #{resultLoadDuration}
+      </if>
+      <if test="loadStandardTimeId != null">
+        and LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
+      </if>
+      <if test="loaderId != null">
+        and LOADER_ID = #{loaderId}
+      </if>
+      <if test="resultIsclear != null and resultIsclear != ''">
+        and RESULT_ISCLEAR = #{resultIsclear}
+      </if>
+      <if test="deleteName != null and deleteName != ''">
+        and DELETE_NAME = #{deleteName}
+      </if>
+      <if test="deleteTime != null">
+        and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{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="status != null">
+        and STATUS = #{status}
+      </if>
+      <if test="resultMeasuredTonnage != null">
+        and RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
+      </if>
+      <if test="loadingId != null">
+        and LOADING_ID = #{loadingId}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </if>
+      <if test="loadingSequence != null">
+        and LOADING_SEQUENCE = #{loadingSequence}
+      </if>
+      <if test="isdeduct != null">
+        and ISDEDUCT = #{isdeduct}
+      </if>
+      <if test="segmentSqe != null">
+        and SEGMENT_SQE = #{segmentSqe}
+      </if>
+      <if test="caseNumber != null and caseNumber != ''">
+        and CASE_NUMBER = #{caseNumber}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="resultTotalId != null">
+        and RESULT_TOTAL_ID = #{resultTotalId}
+      </if>
+      <if test="resultLoadStartTime != null">
+        and TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = #{resultLoadStartTime}
+      </if>
+      <if test="resultLoadEndTime != null">
+        and TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = #{resultLoadEndTime}
+      </if>
+      <if test="resultLoadDuration != null">
+        and RESULT_LOAD_DURATION = #{resultLoadDuration}
+      </if>
+      <if test="loadStandardTimeId != null">
+        and LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
+      </if>
+      <if test="loaderId != null">
+        and LOADER_ID = #{loaderId}
+      </if>
+      <if test="resultIsclear != null and resultIsclear != ''">
+        and RESULT_ISCLEAR LIKE '%${resultIsclear}%'
+      </if>
+      <if test="deleteName != null and deleteName != ''">
+        and DELETE_NAME LIKE '%${deleteName}%'
+      </if>
+      <if test="deleteTime != null">
+        and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{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="status != null">
+        and STATUS = #{status}
+      </if>
+      <if test="resultMeasuredTonnage != null">
+        and RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
+      </if>
+      <if test="loadingId != null">
+        and LOADING_ID = #{loadingId}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </if>
+      <if test="loadingSequence != null">
+        and LOADING_SEQUENCE = #{loadingSequence}
+      </if>
+      <if test="isdeduct != null">
+        and ISDEDUCT = #{isdeduct}
+      </if>
+      <if test="segmentSqe != null">
+        and SEGMENT_SQE = #{segmentSqe}
+      </if>
+      <if test="caseNumber != null and caseNumber != ''">
+        and CASE_NUMBER LIKE '%${caseNumber}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
+    delete from TMSTRUCK_LOAD_RESULT
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from TMSTRUCK_LOAD_RESULT
+    where 1!=1 
+      <if test="resultTotalId != null">
+        or RESULT_TOTAL_ID = #{resultTotalId}
+      </if>
+      <if test="resultLoadStartTime != null">
+        or TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = '#{resultLoadStartTime}'
+      </if>
+      <if test="resultLoadEndTime != null">
+        or TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = '#{resultLoadEndTime}'
+      </if>
+      <if test="resultLoadDuration != null">
+        or RESULT_LOAD_DURATION = #{resultLoadDuration}
+      </if>
+      <if test="loadStandardTimeId != null">
+        or LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
+      </if>
+      <if test="loaderId != null">
+        or LOADER_ID = #{loaderId}
+      </if>
+      <if test="resultIsclear != null and resultIsclear != ''">
+        or RESULT_ISCLEAR = #{resultIsclear}
+      </if>
+      <if test="deleteName != null and deleteName != ''">
+        or DELETE_NAME = #{deleteName}
+      </if>
+      <if test="deleteTime != null">
+        or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{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="status != null">
+        or STATUS = #{status}
+      </if>
+      <if test="resultMeasuredTonnage != null">
+        or RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
+      </if>
+      <if test="loadingId != null">
+        or LOADING_ID = #{loadingId}
+      </if>
+      <if test="materialId != null">
+        or MATERIAL_ID = #{materialId}
+      </if>
+      <if test="loadingSequence != null">
+        or LOADING_SEQUENCE = #{loadingSequence}
+      </if>
+      <if test="isdeduct != null">
+        or ISDEDUCT = #{isdeduct}
+      </if>
+      <if test="segmentSqe != null">
+        or SEGMENT_SQE = #{segmentSqe}
+      </if>
+      <if test="caseNumber != null and caseNumber != ''">
+        or CASE_NUMBER = #{caseNumber}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
+    insert into TMSTRUCK_LOAD_RESULT (RESULT_ID, RESULT_TOTAL_ID, RESULT_LOAD_START_TIME, 
+      RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION, 
+      LOAD_STANDARD_TIME_ID, LOADER_ID, RESULT_ISCLEAR, 
+      DELETE_NAME, DELETE_TIME, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, 
+      INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE, 
+      LOADING_ID, MATERIAL_ID, LOADING_SEQUENCE, 
+      ISDEDUCT, SEGMENT_SQE, CASE_NUMBER
+      )
+    values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{resultLoadStartTime,jdbcType=TIMESTAMP}, 
+      #{resultLoadEndTime,jdbcType=TIMESTAMP}, #{resultLoadDuration,jdbcType=DECIMAL}, 
+      #{loadStandardTimeId,jdbcType=DECIMAL}, #{loaderId,jdbcType=DECIMAL}, #{resultIsclear,jdbcType=VARCHAR}, 
+      #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR}, 
+      #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
+      #{insertUpdateRemark,jdbcType=VARCHAR}, #{status,jdbcType=DECIMAL}, #{resultMeasuredTonnage,jdbcType=DECIMAL}, 
+      #{loadingId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{loadingSequence,jdbcType=DECIMAL}, 
+      #{isdeduct,jdbcType=DECIMAL}, #{segmentSqe,jdbcType=DECIMAL}, #{caseNumber,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
+    insert into TMSTRUCK_LOAD_RESULT
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        RESULT_ID,
+      </if>
+      <if test="resultTotalId != null">
+        RESULT_TOTAL_ID,
+      </if>
+      <if test="resultLoadStartTime != null">
+        RESULT_LOAD_START_TIME,
+      </if>
+      <if test="resultLoadEndTime != null">
+        RESULT_LOAD_END_TIME,
+      </if>
+      <if test="resultLoadDuration != null">
+        RESULT_LOAD_DURATION,
+      </if>
+      <if test="loadStandardTimeId != null">
+        LOAD_STANDARD_TIME_ID,
+      </if>
+      <if test="loaderId != null">
+        LOADER_ID,
+      </if>
+      <if test="resultIsclear != null">
+        RESULT_ISCLEAR,
+      </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="status != null">
+        STATUS,
+      </if>
+      <if test="resultMeasuredTonnage != null">
+        RESULT_MEASURED_TONNAGE,
+      </if>
+      <if test="loadingId != null">
+        LOADING_ID,
+      </if>
+      <if test="materialId != null">
+        MATERIAL_ID,
+      </if>
+      <if test="loadingSequence != null">
+        LOADING_SEQUENCE,
+      </if>
+      <if test="isdeduct != null">
+        ISDEDUCT,
+      </if>
+      <if test="segmentSqe != null">
+        SEGMENT_SQE,
+      </if>
+      <if test="caseNumber != null">
+        CASE_NUMBER,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        #{resultId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultTotalId != null">
+        #{resultTotalId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultLoadStartTime != null">
+        #{resultLoadStartTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="resultLoadEndTime != null">
+        #{resultLoadEndTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="resultLoadDuration != null">
+        #{resultLoadDuration,jdbcType=DECIMAL},
+      </if>
+      <if test="loadStandardTimeId != null">
+        #{loadStandardTimeId,jdbcType=DECIMAL},
+      </if>
+      <if test="loaderId != null">
+        #{loaderId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultIsclear != null">
+        #{resultIsclear,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteName != null">
+        #{deleteName,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteTime != null">
+        #{deleteTime,jdbcType=TIMESTAMP},
+      </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="status != null">
+        #{status,jdbcType=DECIMAL},
+      </if>
+      <if test="resultMeasuredTonnage != null">
+        #{resultMeasuredTonnage,jdbcType=DECIMAL},
+      </if>
+      <if test="loadingId != null">
+        #{loadingId,jdbcType=DECIMAL},
+      </if>
+      <if test="materialId != null">
+        #{materialId,jdbcType=DECIMAL},
+      </if>
+      <if test="loadingSequence != null">
+        #{loadingSequence,jdbcType=DECIMAL},
+      </if>
+      <if test="isdeduct != null">
+        #{isdeduct,jdbcType=DECIMAL},
+      </if>
+      <if test="segmentSqe != null">
+        #{segmentSqe,jdbcType=DECIMAL},
+      </if>
+      <if test="caseNumber != null">
+        #{caseNumber,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
+    update TMSTRUCK_LOAD_RESULT
+    set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+      RESULT_LOAD_START_TIME = #{resultLoadStartTime,jdbcType=TIMESTAMP},
+      RESULT_LOAD_END_TIME = #{resultLoadEndTime,jdbcType=TIMESTAMP},
+      RESULT_LOAD_DURATION = #{resultLoadDuration,jdbcType=DECIMAL},
+      LOAD_STANDARD_TIME_ID = #{loadStandardTimeId,jdbcType=DECIMAL},
+      LOADER_ID = #{loaderId,jdbcType=DECIMAL},
+      RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
+      DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
+      DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
+      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},
+      STATUS = #{status,jdbcType=DECIMAL},
+      RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage,jdbcType=DECIMAL},
+      LOADING_ID = #{loadingId,jdbcType=DECIMAL},
+      MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+      LOADING_SEQUENCE = #{loadingSequence,jdbcType=DECIMAL},
+      ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
+      SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
+      CASE_NUMBER = #{caseNumber,jdbcType=VARCHAR}
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
+    update TMSTRUCK_LOAD_RESULT
+    <set>
+      <if test="resultTotalId != null">
+        RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultLoadStartTime != null">
+        RESULT_LOAD_START_TIME = #{resultLoadStartTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="resultLoadEndTime != null">
+        RESULT_LOAD_END_TIME = #{resultLoadEndTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="resultLoadDuration != null">
+        RESULT_LOAD_DURATION = #{resultLoadDuration,jdbcType=DECIMAL},
+      </if>
+      <if test="loadStandardTimeId != null">
+        LOAD_STANDARD_TIME_ID = #{loadStandardTimeId,jdbcType=DECIMAL},
+      </if>
+      <if test="loaderId != null">
+        LOADER_ID = #{loaderId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultIsclear != null">
+        RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteName != null">
+        DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteTime != null">
+        DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
+      </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="status != null">
+        STATUS = #{status,jdbcType=DECIMAL},
+      </if>
+      <if test="resultMeasuredTonnage != null">
+        RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage,jdbcType=DECIMAL},
+      </if>
+      <if test="loadingId != null">
+        LOADING_ID = #{loadingId,jdbcType=DECIMAL},
+      </if>
+      <if test="materialId != null">
+        MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+      </if>
+      <if test="loadingSequence != null">
+        LOADING_SEQUENCE = #{loadingSequence,jdbcType=DECIMAL},
+      </if>
+      <if test="isdeduct != null">
+        ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
+      </if>
+      <if test="segmentSqe != null">
+        SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
+      </if>
+      <if test="caseNumber != null">
+        CASE_NUMBER = #{caseNumber,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+    <include refid="select" />
+    where RESULT_ID = #{resultId,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 TMSTRUCK_LOAD_RESULT 
+      (RESULT_ID, 
+      RESULT_TOTAL_ID, RESULT_LOAD_START_TIME, 
+      RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION, 
+      LOAD_STANDARD_TIME_ID, LOADER_ID, 
+      RESULT_ISCLEAR, DELETE_NAME, DELETE_TIME, 
+      INSERT_USERNAME, INSERT_TIME, 
+      UPDATE_USERNAME, UPDATE_TIME, 
+      INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE, 
+      LOADING_ID, MATERIAL_ID, LOADING_SEQUENCE, 
+      ISDEDUCT, SEGMENT_SQE, CASE_NUMBER
+      )
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.resultId,jdbcType=DECIMAL}, 
+      #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultLoadStartTime,jdbcType=TIMESTAMP}, 
+      #{item.resultLoadEndTime,jdbcType=TIMESTAMP}, #{item.resultLoadDuration,jdbcType=DECIMAL}, 
+      #{item.loadStandardTimeId,jdbcType=DECIMAL}, #{item.loaderId,jdbcType=DECIMAL}, 
+      #{item.resultIsclear,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP}, 
+      #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, 
+      #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
+      #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.status,jdbcType=DECIMAL}, #{item.resultMeasuredTonnage,jdbcType=DECIMAL}, 
+      #{item.loadingId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL}, #{item.loadingSequence,jdbcType=DECIMAL}, 
+      #{item.isdeduct,jdbcType=DECIMAL}, #{item.segmentSqe,jdbcType=DECIMAL}, #{item.caseNumber,jdbcType=VARCHAR}
+       from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update TMSTRUCK_LOAD_RESULT
+     set
+       RESULT_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_TOTAL_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_LOAD_START_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadStartTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,RESULT_LOAD_END_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadEndTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,RESULT_LOAD_DURATION=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadDuration,jdbcType=DECIMAL}
+       </foreach>
+       ,LOAD_STANDARD_TIME_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.loadStandardTimeId,jdbcType=DECIMAL}
+       </foreach>
+       ,LOADER_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.loaderId,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_ISCLEAR=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultIsclear,jdbcType=VARCHAR}
+       </foreach>
+       ,DELETE_NAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
+       </foreach>
+       ,DELETE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+       ,STATUS=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_MEASURED_TONNAGE=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultMeasuredTonnage,jdbcType=DECIMAL}
+       </foreach>
+       ,LOADING_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.loadingId,jdbcType=DECIMAL}
+       </foreach>
+       ,MATERIAL_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
+       </foreach>
+       ,LOADING_SEQUENCE=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.loadingSequence,jdbcType=DECIMAL}
+       </foreach>
+       ,ISDEDUCT=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.isdeduct,jdbcType=DECIMAL}
+       </foreach>
+       ,SEGMENT_SQE=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.segmentSqe,jdbcType=DECIMAL}
+       </foreach>
+       ,CASE_NUMBER=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.caseNumber,jdbcType=VARCHAR}
+       </foreach>
+     where RESULT_ID in 
+     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+    #{item.resultId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from TMSTRUCK_LOAD_RESULT
+    where RESULT_ID in 
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  <sql id="orderBy">
+    <if test="orderField != null and orderField != ''">
+      order by "${orderField}"
+      <if test="orderType != null and orderType != ''">
+        ${orderType}
+      </if>
+    </if>
+  </sql>
+
+  <!--  获取所有装车实绩  -->
+  <select id="getCGJKLoadResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+
+    select *
+    from (
+    select TLR.RESULT_ID "resultId",
+    APO.PURCHASE_ORDER_NO "purchaseOrderNo",
+    RM.MATERIAL_NAME "materialName",
+    OO.ORDER_NUMBER "orderNumber",
+    RC.CAPACITY_NUMBER "capacityNumber",
+    TLR.RESULT_MEASURED_TONNAGE "resultMeasuredTonnage",
+    TLR.RESULT_ISCLEAR "resultIsclear",
+    to_char(TLR.RESULT_LOAD_START_TIME, 'yyyy-mm-dd') "resultLoadStartTime",
+    TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
+    TLR.INSERT_TIME "insertTime",
+    RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+    RS.SUPPLIER_NAME "supplierName"
+    from TMSTRUCK_LOAD_RESULT TLR
+    left join TMSTRUCK_TOTAL_RESULT TTR
+    on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+    left join OMSTRUCK_ORDER OO
+    on TTR.ORDER_ID = OO.ORDER_ID
+    left join OMSTRUCK_ORDER_MATERIAL OOM
+    on OO.ORDER_ID = OOM.ORDER_ID
+    left join AMS_PURCHASE_ORDER APO
+    on OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
+    left join DIL_BATCH DB
+    on DB.BATCH_ID = APO.BATCH_ID
+    left join RMS_MATERIAL RM
+    on OOM.MATERIAL_ID = RM.MATERIAL_ID
+    left join RMS_CAPACITY RC
+    on RC.CAPACITY_ID = OO.CAPACITY_ID
+    left join RMS_SUPPLIER RS
+    on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
+    left join RMS_CONSIGNEE RCON
+    on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
+    where TLR.STATUS = #{status} and OO.ORDER_TYPE = #{orderTypee}
+    )
+    <where>
+      <if test="purchaseOrderId != null">
+        <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
+          "purchaseOrderId" like '%${item}%'
         </foreach>
-        ,LOADING_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.loadingId,jdbcType=DECIMAL}
+      </if>
+      <if test="materialName != null">
+        and
+        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+          "materialName" like '%${item}%'
         </foreach>
-        ,MATERIAL_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
+      </if>
+      <if test="orderNumber != null">
+        and
+        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+          "orderNumber" like '%${item}%'
         </foreach>
-        ,LOADING_SEQUENCE=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.loadingSequence,jdbcType=DECIMAL}
+      </if>
+      <if test="capacityNumber != null">
+        and
+        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
+          "capacityNumber" like '%${item}%'
         </foreach>
-        ,ISDEDUCT=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.isdeduct,jdbcType=DECIMAL}
+      </if>
+      <if test="orderMaterialWeight != null">
+        and
+        <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
+          "orderMaterialWeight" like '%${item}%'
         </foreach>
-        ,SEGMENT_SQE=
-        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-            when #{item.resultId,jdbcType=DECIMAL} then #{item.segmentSqe,jdbcType=DECIMAL}
+      </if>
+      <if test="resultIsclear != null">
+        and
+        <foreach collection="resultIsclear" item="item" open="(" separator="or" close=")">
+          "resultIsclear" like '%${item}%'
         </foreach>
-        where RESULT_ID in
-        <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
-            #{item.resultId,jdbcType=DECIMAL}
+      </if>
+      <if test="resultLoadStartTime != null">
+        and
+        <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
+          "resultLoadStartTime" like '%${item}%'
         </foreach>
-    </update>
-    <delete id="batchDelete" parameterType="java.util.List">
-        delete from TMSTRUCK_LOAD_RESULT
-        where RESULT_ID in
-        <foreach collection="list" item="id" open="(" close=")" separator=",">
-            #{id}
+      </if>
+      <if test="insertUpdateRemark != null">
+        and
+        <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
+          "insertUpdateRemark" like '%${item}%'
         </foreach>
-    </delete>
-    <!-- 友情提示!!!-->
-    <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-    <sql id="orderBy">
-        <if test="orderField != null and orderField != ''">
-            order by "${orderField}"
-            <if test="orderType != null and orderType != ''">
-                ${orderType}
-            </if>
-        </if>
-    </sql>
+      </if>
+    </where>
+    <include refid="orderBy"></include>
+    <if test="orderField == null  ">
+      order by "resultLoadStartTime" desc
+    </if>
+  </select>
 
-    <!--  获取所有装车实绩  -->
-    <select id="getCGJKLoadResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
 
-        select *
-        from (
-        select TLR.RESULT_ID "resultId",
-        APO.PURCHASE_ORDER_NO "purchaseOrderNo",
-        RM.MATERIAL_NAME "materialName",
-        OO.ORDER_NUMBER "orderNumber",
-        RC.CAPACITY_NUMBER "capacityNumber",
-        TLR.RESULT_MEASURED_TONNAGE "resultMeasuredTonnage",
-        TLR.RESULT_ISCLEAR "resultIsclear",
-        to_char(TLR.RESULT_LOAD_START_TIME, 'yyyy-mm-dd') "resultLoadStartTime",
-        TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
-        TLR.INSERT_TIME "insertTime",
-        RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
-        RS.SUPPLIER_NAME "supplierName"
-        from TMSTRUCK_LOAD_RESULT TLR
-        left join TMSTRUCK_TOTAL_RESULT TTR
-        on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-        left join OMSTRUCK_ORDER OO
-        on TTR.ORDER_ID = OO.ORDER_ID
-        left join OMSTRUCK_ORDER_MATERIAL OOM
-        on OO.ORDER_ID = OOM.ORDER_ID
-        left join AMS_PURCHASE_ORDER APO
-        on OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
-        left join DIL_BATCH DB
-        on DB.BATCH_ID = APO.BATCH_ID
-        left join RMS_MATERIAL RM
-        on OOM.MATERIAL_ID = RM.MATERIAL_ID
-        left join RMS_CAPACITY RC
-        on RC.CAPACITY_ID = OO.CAPACITY_ID
-        left join RMS_SUPPLIER RS
-        on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
-        left join RMS_CONSIGNEE RCON
-        on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
-        where TLR.STATUS = #{status} and OO.ORDER_TYPE = #{orderTypee}
-        )
-        <where>
-            <if test="purchaseOrderId != null">
-                <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
-                    "purchaseOrderId" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="materialName != null">
-                and
-                <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-                    "materialName" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="orderNumber != null">
-                and
-                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-                    "orderNumber" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="capacityNumber != null">
-                and
-                <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
-                    "capacityNumber" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="orderMaterialWeight != null">
-                and
-                <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
-                    "orderMaterialWeight" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultIsclear != null">
-                and
-                <foreach collection="resultIsclear" item="item" open="(" separator="or" close=")">
-                    "resultIsclear" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultLoadStartTime != null">
-                and
-                <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
-                    "resultLoadStartTime" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="insertUpdateRemark != null">
-                and
-                <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
-                    "insertUpdateRemark" like '%${item}%'
-                </foreach>
-            </if>
-        </where>
-        <include refid="orderBy"></include>
-        <if test="orderField == null  ">
-            order by "resultLoadStartTime" desc
-        </if>
-    </select>
+  <!--  通过Id获取装车实绩 数据 用于修改-->
+  <select id="getLoadResultById" parameterType="int" resultType="java.util.LinkedHashMap">
+    select TLR.RESULT_ISCLEAR         "resultIsclear",
+           TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
+           TLR.INSERT_UPDATE_REMARK   "insertUpdateRemark"
+    from TMSTRUCK_LOAD_RESULT TLR
+    where RESULT_ID = #{resultId}
+  </select>
 
+  <!--  通过发站查询所属港口 -->
+  <select id="getPortIdBySendStationId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
+    select RAS.OWNED_PORT_ID
+    from RMSTRAIN_ARRIVAL_SEND RAS
+    where RAS.ARRIVAL_ID = #{sendStationId}
+  </select>
 
-    <!--  通过Id获取装车实绩 数据 用于修改-->
-    <select id="getLoadResultById" parameterType="int" resultType="java.util.LinkedHashMap">
-        select TLR.RESULT_ISCLEAR         "resultIsclear",
-               TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
-               TLR.INSERT_UPDATE_REMARK   "insertUpdateRemark"
-        from TMSTRUCK_LOAD_RESULT TLR
-        where RESULT_ID = #{resultId}
-    </select>
+  <!--  通过运输订单查询批次 -->
+  <select id="getBatchIdByOrderId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
+    select APO.BATCH_ID
+    from OMSTRUCK_ORDER OO
+           left join AMS_PURCHASE_ORDER APO
+                     on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
+    where OO.ORDER_ID = #{orderId}
+  </select>
 
-    <!--  通过发站查询所属港口 -->
-    <select id="getPortIdBySendStationId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
-        select RAS.OWNED_PORT_ID
-        from RMSTRAIN_ARRIVAL_SEND RAS
-        where RAS.ARRIVAL_ID = #{sendStationId}
-    </select>
+  <!--通过运输订单号查找运输订单类型-->
+  <select id="selectOrderTypeByOrderNumber" resultType="java.lang.Integer" parameterType="java.lang.String">
+    select OO.ORDER_TYPE "orderType"
+    from OMSTRUCK_ORDER OO
+    where OO.ORDER_NUMBER = #{oderNumber}
+  </select>
 
-    <!--  通过运输订单查询批次 -->
-    <select id="getBatchIdByOrderId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
-        select APO.BATCH_ID
-        from OMSTRUCK_ORDER OO
-                 left join AMS_PURCHASE_ORDER APO
-                           on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
-        where OO.ORDER_ID = #{orderId}
-    </select>
+  <!--  通过运输订单号查询 出库实绩 最小Id(第一件扫描时间)  0 成功  1 失败-->
+  <select id="getMinScanIdByOrderNum" parameterType="java.util.Map" resultType="java.util.Map">
+    select *
+    from (
+           select WOSR.RESULT_ID "resultId",
+                  WOSR.LOAD_ID   "loadId"
+           from WMSP_OUTBOUND_RESULT WOR
+                  left join WMSP_OUTBOUND_SCAN_RESULT WOSR
+                            on WOSR.OUTBOUND_RESULT_ID = WOR.RESULT_ID
+                  left join OMSTRUCK_ORDER OO
+                            on OO.ORDER_ID = WOR.BILL_LADING_ID
+           WHERE OO.ORDER_NUMBER = #{orderNumber}
+             and WOR.MATERIAL_ID = #{materialId}
+             and WOSR.RESULT_CHECK = 0
+           ORDER BY WOSR.RESULT_LOAD_TIME
 
-    <!--通过运输订单号查找运输订单类型-->
-    <select id="selectOrderTypeByOrderNumber" resultType="java.lang.Integer" parameterType="java.lang.String">
-        select OO.ORDER_TYPE "orderType"
-        from OMSTRUCK_ORDER OO
-        where OO.ORDER_NUMBER = #{oderNumber}
-    </select>
+         )
+    where rownum = 1
+  </select>
 
-<!--  通过运输订单号查询 出库实绩 最小Id(第一件扫描时间)  0 成功  1 失败-->
-    <select id="getMinScanIdByOrderNum" parameterType="java.util.Map" resultType="java.util.Map">
-        select *
-        from (
-                 select WOSR.RESULT_ID "resultId",
-                        WOSR.LOAD_ID   "loadId"
-                 from WMSP_OUTBOUND_RESULT WOR
-                          left join WMSP_OUTBOUND_SCAN_RESULT WOSR
-                                    on WOSR.OUTBOUND_RESULT_ID = WOR.RESULT_ID
-                          left join OMSTRUCK_ORDER OO
-                                    on OO.ORDER_ID = WOR.BILL_LADING_ID
-                 WHERE OO.ORDER_NUMBER = #{orderNumber}
-                   and WOR.MATERIAL_ID = #{materialId}
-                   and WOSR.RESULT_CHECK = 0
-                 ORDER BY WOSR.RESULT_LOAD_TIME
+  <!-- 根据运输订单号查找 -->
+  <select id="selectResultIdByOrderNumber" resultType="java.lang.Integer" parameterType="java.lang.String">
+    select WOSR.RESULT_ID "resultId"
 
-             )
-        where rownum = 1
-    </select>
+    from OMSTRUCK_ORDER OO
+           left join WMSP_OUTBOUND_RESULT WOR
+                     on OO.ORDER_ID = WOR.BILL_LADING_ID
+           left join WMSP_OUTBOUND_SCAN_RESULT WOSR
+                     on WOSR.OUTBOUND_RESULT_ID = WOR.RESULT_ID
+    WHERE OO.ORDER_NUMBER = #{orderNumber}
+      and WOSR.RESULT_CHECK = 0
+  </select>
 
-    <!-- 根据运输订单号查找 -->
-    <select id="selectResultIdByOrderNumber" resultType="java.lang.Integer" parameterType="java.lang.String">
-        select WOSR.RESULT_ID "resultId"
+  <!-- 根据实绩id查找扫描时间 -->
+  <select id="selectLoadTimeByResultId" resultType="java.util.Date" parameterType="java.math.BigDecimal">
+    select WOSR.RESULT_LOAD_TIME "loadTime"
+    from WMSP_OUTBOUND_SCAN_RESULT WOSR
+    where WOSR.RESULT_ID = #{resultId}
+  </select>
 
-        from OMSTRUCK_ORDER OO
-                 left join WMSP_OUTBOUND_RESULT WOR
-                           on OO.ORDER_ID = WOR.BILL_LADING_ID
-                 left join WMSP_OUTBOUND_SCAN_RESULT WOSR
-                           on WOSR.OUTBOUND_RESULT_ID = WOR.RESULT_ID
-        WHERE OO.ORDER_NUMBER = #{orderNumber}
-          and WOSR.RESULT_CHECK = 0
-    </select>
+  <!-- 根据扫描实绩id查询装卸工id -->
+  <select id="selecLoadIdByresultId" resultType="java.lang.Integer">
+    select WOSR.LOAD_ID "loadId"
+    from WMSP_OUTBOUND_SCAN_RESULT WOSR
+    where WOSR.RESULT_ID = #{resultId}
+  </select>
 
-    <!-- 根据实绩id查找扫描时间 -->
-    <select id="selectLoadTimeByResultId" resultType="java.util.Date" parameterType="java.math.BigDecimal">
-        select WOSR.RESULT_LOAD_TIME "loadTime"
-        from WMSP_OUTBOUND_SCAN_RESULT WOSR
-        where WOSR.RESULT_ID = #{resultId}
-    </select>
+  <!-- 销售装车实绩查询-->
+  <select id="selectLoadResultForSale" resultType="java.util.Map" parameterType="java.lang.Integer">
+    SELECT (SELECT ORDER_MATERIAL_NUMBER
+            FROM OMSTRUCK_ORDER_MATERIAL OOM
+            WHERE OOM.ORDER_ID = OO.ORDER_ID
+              AND TLR.MATERIAL_ID = OOM.MATERIAL_ID) "orderMaterialNumber",
+           TLR.RESULT_LOAD_START_TIME                "startTime",
+           TLR.RESULT_LOAD_END_TIME                  "endTime",
+           TLR.RESULT_LOAD_DURATION                  "loadDuration",
+           RM.MATERIAL_NAME                          "materialName",
+           RP.PERSONNEL_NAME                         "name",
+           RMS.MATERIAL_THEORETICAL_WEIGHT           "theoreticalWeight",
+           OO.ORDER_NUMBER                           "orderNumber",
+           ASO.SALE_NUMBER                           "saleNumber",
+           RC.CAPACITY_NUMBER                        "capacityNumber"
+    FROM TMSTRUCK_LOAD_RESULT TLR
+           LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
+           LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = TTR.ORDER_ID
+           LEFT JOIN RMS_MATERIAL_STEEL RMS ON RMS.MATERIAL_STEEL_ID = TLR.MATERIAL_ID
+           LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = RMS.MATERIAL_ID
+           LEFT JOIN RMS_PERSONNEL RP ON TLR.LOADER_ID = RP.PERSONNEL_ID
+           LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
+           LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
+           LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
+    where TLR.STATUS = #{status}
+      and OO.ORDER_TYPE = 1
+  </select>
 
-    <!-- 根据扫描实绩id查询装卸工id -->
-    <select id="selecLoadIdByresultId" resultType="java.lang.Integer">
-        select WOSR.LOAD_ID "loadId"
-        from WMSP_OUTBOUND_SCAN_RESULT WOSR
-        where WOSR.RESULT_ID = #{resultId}
-    </select>
+  <!--通过运输订单号查找物资id-->
+  <select id="selectMaterialIdByOrderNumber" parameterType="java.lang.String" resultType="java.util.Map">
+    SELECT
+    OOM.MATERIAL_ID "materialId"
+    FROM
+    OMSTRUCK_ORDER OO
+    LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
+    WHERE
+    <if test="orderNumber != null">
+      OO.ORDER_NUMBER = #{orderNumber}
+    </if>
+    <if test="orderId != null">
+      and OO.ORDER_ID = #{orderId}
+    </if>
+  </select>
 
-    <!-- 销售装车实绩查询-->
-    <select id="selectLoadResultForSale" resultType="java.util.Map" parameterType="java.lang.Integer">
-        SELECT (SELECT ORDER_MATERIAL_NUMBER
-                FROM OMSTRUCK_ORDER_MATERIAL OOM
-                WHERE OOM.ORDER_ID = OO.ORDER_ID
-                  AND TLR.MATERIAL_ID = OOM.MATERIAL_ID) "orderMaterialNumber",
-               TLR.RESULT_LOAD_START_TIME                "startTime",
-               TLR.RESULT_LOAD_END_TIME                  "endTime",
-               TLR.RESULT_LOAD_DURATION                  "loadDuration",
-               RM.MATERIAL_NAME                          "materialName",
-               RP.PERSONNEL_NAME                         "name",
-               RMS.MATERIAL_THEORETICAL_WEIGHT           "theoreticalWeight",
-               OO.ORDER_NUMBER                           "orderNumber",
-               ASO.SALE_NUMBER                           "saleNumber",
-               RC.CAPACITY_NUMBER                        "capacityNumber"
-        FROM TMSTRUCK_LOAD_RESULT TLR
-                 LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
-                 LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = TTR.ORDER_ID
-                 LEFT JOIN RMS_MATERIAL_STEEL RMS ON RMS.MATERIAL_STEEL_ID = TLR.MATERIAL_ID
-                 LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = RMS.MATERIAL_ID
-                 LEFT JOIN RMS_PERSONNEL RP ON TLR.LOADER_ID = RP.PERSONNEL_ID
-                 LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
-                 LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
-                 LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
-        where TLR.STATUS = #{status}
-          and OO.ORDER_TYPE = 1
-    </select>
+  <!--  通过订单ID 和物资Id 查询装车实绩ID 可能会有多条-->
+  <select id="getLoadResultId" parameterType="java.util.Map" resultType="java.lang.Integer">
+    select TLR.RESULT_ID
+    from OMSTRUCK_ORDER OO
+           left join TMSTRUCK_TOTAL_RESULT TTR
+                     on TTR.ORDER_ID = OO.ORDER_ID
+           left join TMSTRUCK_LOAD_RESULT TLR
+                     on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+    where OO.ORDER_ID = #{orderId}
+      and TLR.MATERIAL_ID = #{materialId}
+  </select>
 
-    <!--通过运输订单号查找物资id-->
-    <select id="selectMaterialIdByOrderNumber" parameterType="java.lang.String" resultType="java.util.Map">
-        SELECT
-        OOM.MATERIAL_ID "materialId"
-        FROM
-        OMSTRUCK_ORDER OO
-        LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
-        WHERE
-        <if test="orderNumber != null">
-            OO.ORDER_NUMBER = #{orderNumber}
-        </if>
-        <if test="orderId != null">
-            and OO.ORDER_ID = #{orderId}
-        </if>
-    </select>
+  <!--通过运输订单号查找装车实绩id-->
+  <select id="selectLoadResultIdByOrderNumber" resultType="java.lang.Integer" parameterType="java.util.Map">
+    SELECT TLR.RESULT_ID              "loadResultId",
+           TLR.RESULT_LOAD_START_TIME "startTime"
+    FROM OMSTRUCK_ORDER OO
+           LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+                     ON OO.ORDER_ID = TTR.ORDER_ID
+           LEFT JOIN TMSTRUCK_LOAD_RESULT TLR
+                     ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+    WHERE OO.ORDER_NUMBER = #{orderNumber}
+  </select>
 
-    <!--  通过订单ID 和物资Id 查询装车实绩ID 可能会有多条-->
-    <select id="getLoadResultId" parameterType="java.util.Map" resultType="java.lang.Integer">
-        select TLR.RESULT_ID
-        from OMSTRUCK_ORDER OO
-                 left join TMSTRUCK_TOTAL_RESULT TTR
-                           on TTR.ORDER_ID = OO.ORDER_ID
-                 left join TMSTRUCK_LOAD_RESULT TLR
-                           on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-        where OO.ORDER_ID = #{orderId}
-          and TLR.MATERIAL_ID = #{materialId}
-    </select>
+  <!--内转物流查询汽车装车实绩 -->
+  <select id="selectLoadResultForConverted" resultType="java.util.LinkedHashMap">
+    select APO.PURCHASE_ORDER_NO       "orderNo",
+           TLR.INSERT_TIME             "insertTime",
+           RC.CAPACITY_NUMBER          "capacityNumber",
+           TLR.RESULT_MEASURED_TONNAGE "toggage",
+           RAS.ARRIVAL_NAME            "arrivelName",
+           DB.RESULT_FOREIGN_SHIP_NAME "foreignShipName",
+           OO.ORDER_NUMBER             "orderNumber",
+           RM.MATERIAL_NAME            "materialName"
 
-    <!--通过运输订单号查找装车实绩id-->
-    <select id="selectLoadResultIdByOrderNumber" resultType="java.lang.Integer" parameterType="java.util.Map">
-        SELECT TLR.RESULT_ID              "loadResultId",
-               TLR.RESULT_LOAD_START_TIME "startTime"
-        FROM OMSTRUCK_ORDER OO
-                 LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
-                           ON OO.ORDER_ID = TTR.ORDER_ID
-                 LEFT JOIN TMSTRUCK_LOAD_RESULT TLR
-                           ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-        WHERE OO.ORDER_NUMBER = #{orderNumber}
-    </select>
+    from TMSTRUCK_LOAD_RESULT TLR
+           LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+                     ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
+           LEFT JOIN OMSTRUCK_ORDER OO
+                     ON OO.ORDER_ID = TTR.ORDER_ID
+           left join AMS_PURCHASE_ORDER APO
+                     ON oo.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
+           LEFT JOIN DIL_BATCH DB
+                     ON DB.BATCH_ID = APO.BATCH_ID
+           LEFT JOIN RMS_MATERIAL RM
+                     ON RM.MATERIAL_ID = TLR.MATERIAL_ID
+           LEFT JOIN RMS_CAPACITY RC
+                     ON OO.CAPACITY_ID = RC.CAPACITY_ID
+           LEFT JOIN TMSTRAIN_LOADING_RESULT TLR2
+                     ON TLR2.PURCHASE_ORDER_RAIL_PLAN_ID = OO.ORDER_PLAN_ID
+           LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS
+                     ON RAS.ARRIVAL_ID = TLR.LOADING_ID
 
-    <!--内转物流查询汽车装车实绩 -->
-    <select id="selectLoadResultForConverted" resultType="java.util.LinkedHashMap">
-        select APO.PURCHASE_ORDER_NO       "orderNo",
-               TLR.INSERT_TIME             "insertTime",
-               RC.CAPACITY_NUMBER          "capacityNumber",
-               TLR.RESULT_MEASURED_TONNAGE "toggage",
-               RAS.ARRIVAL_NAME            "arrivelName",
-               DB.RESULT_FOREIGN_SHIP_NAME "foreignShipName",
-               OO.ORDER_NUMBER             "orderNumber",
-               RM.MATERIAL_NAME            "materialName"
+  </select>
 
-        from TMSTRUCK_LOAD_RESULT TLR
-                 LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
-                           ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
-                 LEFT JOIN OMSTRUCK_ORDER OO
-                           ON OO.ORDER_ID = TTR.ORDER_ID
-                 left join AMS_PURCHASE_ORDER APO
-                           ON oo.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
-                 LEFT JOIN DIL_BATCH DB
-                           ON DB.BATCH_ID = APO.BATCH_ID
-                 LEFT JOIN RMS_MATERIAL RM
-                           ON RM.MATERIAL_ID = TLR.MATERIAL_ID
-                 LEFT JOIN RMS_CAPACITY RC
-                           ON OO.CAPACITY_ID = RC.CAPACITY_ID
-                 LEFT JOIN TMSTRAIN_LOADING_RESULT TLR2
-                           ON TLR2.PURCHASE_ORDER_RAIL_PLAN_ID = OO.ORDER_PLAN_ID
-                 LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS
-                           ON RAS.ARRIVAL_ID = TLR.LOADING_ID
+  <!-- 根据实绩id渲染数据 -->
+  <select id="selectLoadResultByResultId" resultType="java.lang.Integer">
+    SELECT TLR.LOADING_ID      "loadingId",
+           TLR.MATERIAL_ID     "materialId",
+           TLR.RESULT_TOTAL_ID "totalId"
+    FROM TMSTRUCK_LOAD_RESULT TLR
+    WHERE TLR.RESULT_ID = #{resultId}
+  </select>
 
-    </select>
+  <!--通过车牌号号查找物资id和运力id以及总实绩id-->
+  <select id="selectMaterialIdAndCapacityId" resultType="java.util.Map" parameterType="java.lang.Integer">
+    select OOM.MATERIAL_ID     "materialId",
+           OO.CAPACITY_ID      "capacityId",
+           TTR.RESULT_TOTAL_ID "resultTotalId"
+    from TMSTRUCK_TOTAL_RESULT TTR
+           left join OMSTRUCK_ORDER OO
+                     on OO.ORDER_ID = TTR.ORDER_ID
+           left join OMSTRUCK_ORDER_MATERIAL OOM
+                     on OOM.ORDER_ID = OO.ORDER_ID
+           LEFT JOIN RMS_CAPACITY RC
+                     ON RC.CAPACITY_ID = OO.CAPACITY_ID
+    where RC.CAPACITY_NUMBER = #{capacityNumber}
+  </select>
+  <!--根据id查找用户名    -->
+  <select id="selectPersonNameByPersonnelId" resultType="java.lang.String" parameterType="java.lang.Integer">
+    select RP.PERSONNEL_NAME "personnelName"
+    from RMS_PERSONNEL RP
+    where RP.PERSONNEL_ID = #{personnelId}
+  </select>
+  <select id="selectMaterialTypeByMaterialId" parameterType="java.lang.Integer" resultType="java.lang.Integer">
+    select RMT.MATERIAL_TYPE_ID "materialTypeId"
+    FROM RMS_MATERIAL RM
+           LEFT JOIN RMS_MATERIAL_TYPE RMT
+                     ON RMT.MATERIAL_TYPE_ID = RM.MATERIAL_TYPE_ID
+    where RM.MATERIAL_ID = #{materialId}
+  </select>
 
-    <!-- 根据实绩id渲染数据 -->
-    <select id="selectLoadResultByResultId" resultType="java.lang.Integer">
-        SELECT TLR.LOADING_ID      "loadingId",
-               TLR.MATERIAL_ID     "materialId",
-               TLR.RESULT_TOTAL_ID "totalId"
-        FROM TMSTRUCK_LOAD_RESULT TLR
-        WHERE TLR.RESULT_ID = #{resultId}
-    </select>
+  <!--  查询销售装车实绩  -->
+  <select id="getXSLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
+    SELECT *
+    FROM (
+    SELECT OO.ORDER_NUMBER "orderNumber",
+    RC.CAPACITY_NUMBER "capacityNumber",
+    TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
+    TLR.RESULT_LOAD_END_TIME "resultLoadEndTime",
+    TLR.RESULT_LOAD_DURATION "resultLoadDuration",
+    RP.PERSONNEL_NAME "personnelName",
+    RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
+    RM.MATERIAL_NAME "materialName",
+    ASO.SALE_NUMBER  "no",
+    (CASE WHEN  OOM.ORDER_MATERIAL_NUMBER is not null
+    THEN OOM.ORDER_MATERIAL_NUMBER
+    ELSE OOM.ORDER_MATERIAL_WEIGHT
+    END) "materialNumWei",
+    TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
+    TLR.CASE_NUMBER "caseNumber"
+    FROM TMSTRUCK_LOAD_RESULT TLR
+    LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+    ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+    LEFT JOIN OMSTRUCK_ORDER OO
+    ON OO.ORDER_ID = TTR.ORDER_ID
+    LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
+    ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
+    LEFT JOIN AMS_SALE_ORDER ASO
+    ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
+    LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
+    ON OOM.ORDER_ID = OO.ORDER_ID
+    LEFT JOIN RMS_MATERIAL RM
+    ON RM.MATERIAL_ID = OOM.MATERIAL_ID
+    LEFT JOIN RMS_CAPACITY RC
+    ON RC.CAPACITY_ID = OO.CAPACITY_ID
+    LEFT JOIN RMS_PERSONNEL RP
+    ON TLR.LOADER_ID = RP.PERSONNEL_ID
+    where
+    OO.ORDER_TYPE in (1, 2, 3)
+    and TLR.STATUS = #{status}
+    )
+    <where>
+      <if test="orderNumber != null">
+        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+          "orderNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialName != null">
+        and
+        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+          "materialName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="no != null">
+        and
+        <foreach collection="no" item="item" open="(" separator="or" close=")">
+          "no" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialNumWei != null">
+        and
+        <foreach collection="materialNumWei" item="item" open="(" separator="or" close=")">
+          "materialNumWei" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialTheoreticalWeight != null">
+        and
+        <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
+          "materialTheoreticalWeight" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="capacityNumber != null">
+        and
+        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
+          "capacityNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultLoadStartTime != null">
+        and
+        <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
+          "resultLoadStartTime" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultLoadEndTime != null">
+        and
+        <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
+          "resultLoadEndTime" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultLoadDuration != null">
+        and
+        <foreach collection="resultLoadDuration" item="item" open="(" separator="or" close=")">
+          "resultLoadDuration" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="standardDataMax != null">
+        and
+        <foreach collection="standardDataMax" item="item" open="(" separator="or" close=")">
+          "standardDataMax" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="personnelName != null">
+        and
+        <foreach collection="personnelName" item="item" open="(" separator="or" close=")">
+          "personnelName" like '%${item}%'
+        </foreach>
+      </if>
+    </where>
+    <include refid="orderBy"></include>
+    <if test="orderField == null  ">
+      order by "resultLoadStartTime" desc
+    </if>
+  </select>
 
-    <!--通过车牌号号查找物资id和运力id以及总实绩id-->
-    <select id="selectMaterialIdAndCapacityId" resultType="java.util.Map" parameterType="java.lang.Integer">
-        select OOM.MATERIAL_ID     "materialId",
-               OO.CAPACITY_ID      "capacityId",
-               TTR.RESULT_TOTAL_ID "resultTotalId"
-        from TMSTRUCK_TOTAL_RESULT TTR
-                 left join OMSTRUCK_ORDER OO
-                           on OO.ORDER_ID = TTR.ORDER_ID
-                 left join OMSTRUCK_ORDER_MATERIAL OOM
-                           on OOM.ORDER_ID = OO.ORDER_ID
-                 LEFT JOIN RMS_CAPACITY RC
-                           ON RC.CAPACITY_ID = OO.CAPACITY_ID
-        where RC.CAPACITY_NUMBER = #{capacityNumber}
-    </select>
-    <!--根据id查找用户名    -->
-    <select id="selectPersonNameByPersonnelId" resultType="java.lang.String" parameterType="java.lang.Integer">
-        select RP.PERSONNEL_NAME "personnelName"
-        from RMS_PERSONNEL RP
-        where RP.PERSONNEL_ID = #{personnelId}
-    </select>
-    <select id="selectMaterialTypeByMaterialId" parameterType="java.lang.Integer" resultType="java.lang.Integer">
-        select RMT.MATERIAL_TYPE_ID "materialTypeId"
-        FROM RMS_MATERIAL RM
-                 LEFT JOIN RMS_MATERIAL_TYPE RMT
-                           ON RMT.MATERIAL_TYPE_ID = RM.MATERIAL_TYPE_ID
-        where RM.MATERIAL_ID = #{materialId}
-    </select>
+  <!--  通过港口ID获取仓库ID  -->
+  <select id="getWarehouseIdByPortId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
+    select RW.WAREHOUSE_ID
+    from RMS_WAREHOUSE RW
+    where RW.WAREHOUSE_TYPE_ID = 4 and RW.PORT_ID = #{portId}
+  </select>
 
-    <!--  查询销售装车实绩  -->
-    <select id="getXSLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
-        SELECT *
-        FROM (
-            SELECT OO.ORDER_NUMBER "orderNumber",
-                   RC.CAPACITY_NUMBER "capacityNumber",
-                   TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
-                   TLR.RESULT_LOAD_END_TIME "resultLoadEndTime",
-                   TLR.RESULT_LOAD_DURATION "resultLoadDuration",
-                   RP.PERSONNEL_NAME "personnelName",
-                   RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
-                   RM.MATERIAL_NAME "materialName",
-                   ASO.SALE_NUMBER  "no",
-                   (CASE WHEN  OOM.ORDER_MATERIAL_NUMBER is not null
-                         THEN OOM.ORDER_MATERIAL_NUMBER
-                         ELSE OOM.ORDER_MATERIAL_WEIGHT
-                     END) "materialNumWei",
-                   TLR.INSERT_UPDATE_REMARK "insertUpdateRemark"
-            FROM TMSTRUCK_LOAD_RESULT TLR
-            LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
-                ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-            LEFT JOIN OMSTRUCK_ORDER OO
-                ON OO.ORDER_ID = TTR.ORDER_ID
-            LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
-                ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
-            LEFT JOIN AMS_SALE_ORDER ASO
-                ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
-            LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
-                ON OOM.ORDER_ID = OO.ORDER_ID
-            LEFT JOIN RMS_MATERIAL RM
-                ON RM.MATERIAL_ID = OOM.MATERIAL_ID
-            LEFT JOIN RMS_CAPACITY RC
-                ON RC.CAPACITY_ID = OO.CAPACITY_ID
-            LEFT JOIN RMS_PERSONNEL RP
-                ON TLR.LOADER_ID = RP.PERSONNEL_ID
-            where
-                  OO.ORDER_TYPE in (1, 2, 3)
-              and TLR.STATUS = #{status}
-        )
-        <where>
-            <if test="orderNumber != null">
-                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-                    "orderNumber" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="materialName != null">
-                and
-                <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-                    "materialName" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="no != null">
-                and
-                <foreach collection="no" item="item" open="(" separator="or" close=")">
-                    "no" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="materialNumWei != null">
-                and
-                <foreach collection="materialNumWei" item="item" open="(" separator="or" close=")">
-                    "materialNumWei" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="materialTheoreticalWeight != null">
-                and
-                <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
-                    "materialTheoreticalWeight" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="capacityNumber != null">
-                and
-                <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
-                    "capacityNumber" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultLoadStartTime != null">
-                and
-                <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
-                    "resultLoadStartTime" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultLoadEndTime != null">
-                and
-                <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
-                    "resultLoadEndTime" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultLoadDuration != null">
-                and
-                <foreach collection="resultLoadDuration" item="item" open="(" separator="or" close=")">
-                    "resultLoadDuration" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="standardDataMax != null">
-                and
-                <foreach collection="standardDataMax" item="item" open="(" separator="or" close=")">
-                    "standardDataMax" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="personnelName != null">
-                and
-                <foreach collection="personnelName" item="item" open="(" separator="or" close=")">
-                    "personnelName" like '%${item}%'
-                </foreach>
-            </if>
-        </where>
-        <include refid="orderBy"></include>
-        <if test="orderField == null  ">
-            order by "resultLoadStartTime" desc
-        </if>
-    </select>
+  <!--  通过物资ID和总实绩Id查询唯一的装车实绩Id  -->
+  <select id="getLoadResultIdByMIdAndTotalId" parameterType="int" resultType="java.util.Map">
+    select TLR.RESULT_ID "resultId",
+    TLR.SEGMENT_SQE "segmentSqe"
+    from TMSTRUCK_LOAD_RESULT TLR
+    <where>
+      TLR.RESULT_TOTAL_ID = #{resultTotalId}
+      <if test="materialId != null">
+        and TLR.MATERIAL_ID = #{materialId}
+      </if>
+    </where>
+  </select>
 
-<!--  通过港口ID获取仓库ID  -->
-    <select id="getWarehouseIdByPortId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
-        select RW.WAREHOUSE_ID
-        from RMS_WAREHOUSE RW
-        where RW.WAREHOUSE_TYPE_ID = 4 and RW.PORT_ID = #{portId}
-    </select>
+  <!--    通过物资唯一编码 查找物资ID -->
+  <select id="getMaterialIdByMaterialCode" parameterType="string" resultType="java.math.BigDecimal">
+    select MATERIAL_ID
+    from RMS_MATERIAL_STEEL
+    where MATERIAL_ONLY_CODE = #{materialOnlyCode}
+  </select>
 
-<!--  通过物资ID和总实绩Id查询唯一的装车实绩Id  -->
-    <select id="getLoadResultIdByMIdAndTotalId" parameterType="int" resultType="java.util.Map">
-        select TLR.RESULT_ID "resultId",
-               TLR.SEGMENT_SQE "segmentSqe"
-        from TMSTRUCK_LOAD_RESULT TLR
-        <where>
-            TLR.RESULT_TOTAL_ID = #{resultTotalId}
-            <if test="materialId != null">
-                and TLR.MATERIAL_ID = #{materialId}
-            </if>
-        </where>
-    </select>
+  <!--   查询所有正在进行进厂排队的销售订单  -->
+  <select id="getSaleOrderOnQueue" parameterType="java.util.Map" resultType="java.util.Map">
+    select *
+    from (
+    select OO.ORDER_ID        "orderId",
+    OO.ORDER_NUMBER    "orderNumber",
+    ASO.SALE_NUMBER    "saleNumber",
+    RC.CAPACITY_NUMBER "capacityNumber",
+    OO.ORDER_ISSUE_TIME "orderIssueTime"
+    from OMSTRUCK_ORDER OO
+    left join AMS_SALE_ORDER_MATERIAL ASOM
+    on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
+    left join AMS_SALE_ORDER ASO
+    on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
+    left join RMS_CAPACITY RC
+    on OO.CAPACITY_ID = RC.CAPACITY_ID
+    where OO.ORDER_ID in (select OO.ORDER_ID
+    from QMS_QUEUE_RESULT QQR
+    left join TMSTRUCK_TOTAL_RESULT TTR
+    on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID
+    left join OMSTRUCK_ORDER OO
+    on OO.ORDER_ID = TTR.ORDER_ID
+    where QQR.RESULT_START_TIME is not null
+    and QQR.RESULT_END_TIME is null
+    and OO.ORDER_TYPE = 1)
+    )
+    <where>
+      <if test="orderNumber != null">
+        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+          "orderNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleNumber != null">
+        and
+        <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
+          "saleNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="driverName != null">
+        and
+        <foreach collection="driverName" item="item" open="(" separator="or" close=")">
+          "driverName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="capacityNumber != null">
+        and
+        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
+          "capacityNumber" like '%${item}%'
+        </foreach>
+      </if>
+    </where>
+    <include refid="orderBy"></include>
+    <if test="orderField == null  ">
+      order by "orderIssueTime" desc
+    </if>
+  </select>
 
-<!--    通过物资唯一编码 查找物资ID -->
-    <select id="getMaterialIdByMaterialCode" parameterType="string" resultType="java.math.BigDecimal">
-        select MATERIAL_ID
-        from RMS_MATERIAL_STEEL
-        where MATERIAL_ONLY_CODE = #{materialOnlyCode}
-    </select>
+  <!--    通过订单Id和物资Id确定唯一的装车实绩Id -->
+  <select id="getLoadIdByOrderIdAndMId" parameterType="java.util.Map" resultType="java.lang.Integer">
+    select TLR.RESULT_ID
+    from OMSTRUCK_ORDER OO
+           left join TMSTRUCK_TOTAL_RESULT TTR
+                     on TTR.ORDER_ID = OO.ORDER_ID
+           left join TMSTRUCK_LOAD_RESULT TLR
+                     on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+    where OO.ORDER_ID = #{orderId}
+      and TLR.MATERIAL_ID = #{materialId}
+  </select>
 
-<!--   查询所有正在进行进厂排队的销售订单  -->
-    <select id="getSaleOrderOnQueue" parameterType="java.util.Map" resultType="java.util.Map">
-        select *
-        from (
-                 select OO.ORDER_ID        "orderId",
-                        OO.ORDER_NUMBER    "orderNumber",
-                        ASO.SALE_NUMBER    "saleNumber",
-                        RC.CAPACITY_NUMBER "capacityNumber",
-                        OO.ORDER_ISSUE_TIME "orderIssueTime"
-                 from OMSTRUCK_ORDER OO
-                          left join AMS_SALE_ORDER_MATERIAL ASOM
-                                    on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
-                          left join AMS_SALE_ORDER ASO
-                                    on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
-                          left join RMS_CAPACITY RC
-                                    on OO.CAPACITY_ID = RC.CAPACITY_ID
-                 where OO.ORDER_ID in (select OO.ORDER_ID
-                                       from QMS_QUEUE_RESULT QQR
-                                                left join TMSTRUCK_TOTAL_RESULT TTR
-                                                          on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID
-                                                left join OMSTRUCK_ORDER OO
-                                                          on OO.ORDER_ID = TTR.ORDER_ID
-                                       where QQR.RESULT_START_TIME is not null
-                                         and QQR.RESULT_END_TIME is null
-                                         and OO.ORDER_TYPE = 1)
-             )
-        <where>
-            <if test="orderNumber != null">
-                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-                    "orderNumber" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="saleNumber != null">
-                and
-                <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
-                    "saleNumber" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="driverName != null">
-                and
-                <foreach collection="driverName" item="item" open="(" separator="or" close=")">
-                    "driverName" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="capacityNumber != null">
-                and
-                <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
-                    "capacityNumber" like '%${item}%'
-                </foreach>
-            </if>
-        </where>
-        <include refid="orderBy"></include>
-        <if test="orderField == null  ">
-            order by "orderIssueTime" desc
+  <!--  查询内转钢材到异地库装车实绩  -->
+  <select id="getSteelNzLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
+    SELECT *
+    FROM (
+    select TLR.RESULT_ID                  "resultId",
+    AROD.DAYPLAN_NO                "dayplanNo",
+    OO.ORDER_NUMBER                "orderNumber",
+    RC.CAPACITY_NUMBER             "capacityNumber",
+    TLR.RESULT_LOAD_START_TIME     "resultLoadStartTime",
+    TLR.RESULT_LOAD_END_TIME       "resultLoadEndTime",
+    TLR.RESULT_LOAD_DURATION       "resultLoadDuration",
+    RSD.STANDARD_DATA_MIN          "standardDataMin",
+    RM.MATERIAL_NAME               "materialName",
+    OOM.ORDER_MATERIAL_NUMBER      "orderMaterialNumber",
+    RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
+    RP.PERSONNEL_NAME              "personnelName"
+    from TMSTRUCK_LOAD_RESULT TLR
+    left join TMSTRUCK_TOTAL_RESULT TTR
+    ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+    LEFT JOIN OMSTRUCK_ORDER OO
+    ON OO.ORDER_ID = TTR.ORDER_ID
+    LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
+    ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
+    LEFT JOIN RMS_CAPACITY RC
+    ON RC.CAPACITY_ID = OO.CAPACITY_ID
+    LEFT JOIN RMS_PERSONNEL RP
+    ON RP.PERSONNEL_ID = TLR.LOADER_ID
+    LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
+    ON OO.ORDER_ID = OOM.ORDER_ID AND OOM.MATERIAL_ID = TLR.MATERIAL_ID
+    LEFT JOIN RMS_MATERIAL RM
+    ON RM.MATERIAL_ID = OOM.MATERIAL_ID
+    LEFT JOIN RMS_STANDARD_DATA RSD
+    ON RSD.STANDARD_DATA_ID = TLR.LOAD_STANDARD_TIME_ID
+    WHERE OO.ORDER_TYPE = 4
+    AND TLR.RESULT_LOAD_START_TIME IS NOT NULL
+    AND TLR.STATUS = 0
+    )
+    <where>
+      <if test="dayplanNo != null">
+        <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
+          "dayplanNo" like '%${item}%'
+        </foreach>
+        <if test="orderNumber != null">
+          and
+          <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+            "orderNumber" like '%${item}%'
+          </foreach>
         </if>
-    </select>
-
-<!--    通过订单Id和物资Id确定唯一的装车实绩Id -->
-    <select id="getLoadIdByOrderIdAndMId" parameterType="java.util.Map" resultType="java.lang.Integer">
-        select TLR.RESULT_ID
-        from OMSTRUCK_ORDER OO
-        left join TMSTRUCK_TOTAL_RESULT TTR
-        on TTR.ORDER_ID = OO.ORDER_ID
-        left join TMSTRUCK_LOAD_RESULT TLR
-        on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-        where OO.ORDER_ID = #{orderId}
-          and TLR.MATERIAL_ID = #{materialId}
-    </select>
-
-<!--  查询内转钢材到异地库装车实绩  -->
-    <select id="getSteelNzLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
-        SELECT *
-        FROM (
-                 select TLR.RESULT_ID                  "resultId",
-                        AROD.DAYPLAN_NO                "dayplanNo",
-                        OO.ORDER_NUMBER                "orderNumber",
-                        RC.CAPACITY_NUMBER             "capacityNumber",
-                        TLR.RESULT_LOAD_START_TIME     "resultLoadStartTime",
-                        TLR.RESULT_LOAD_END_TIME       "resultLoadEndTime",
-                        TLR.RESULT_LOAD_DURATION       "resultLoadDuration",
-                        RSD.STANDARD_DATA_MIN          "standardDataMin",
-                        RM.MATERIAL_NAME               "materialName",
-                        OOM.ORDER_MATERIAL_NUMBER      "orderMaterialNumber",
-                        RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
-                        RP.PERSONNEL_NAME              "personnelName"
-                 from TMSTRUCK_LOAD_RESULT TLR
-                          left join TMSTRUCK_TOTAL_RESULT TTR
-                                    ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-                          LEFT JOIN OMSTRUCK_ORDER OO
-                                    ON OO.ORDER_ID = TTR.ORDER_ID
-                          LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
-                                    ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
-                          LEFT JOIN RMS_CAPACITY RC
-                                    ON RC.CAPACITY_ID = OO.CAPACITY_ID
-                          LEFT JOIN RMS_PERSONNEL RP
-                                    ON RP.PERSONNEL_ID = TLR.LOADER_ID
-                          LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
-                                    ON OO.ORDER_ID = OOM.ORDER_ID AND OOM.MATERIAL_ID = TLR.MATERIAL_ID
-                          LEFT JOIN RMS_MATERIAL RM
-                                    ON RM.MATERIAL_ID = OOM.MATERIAL_ID
-                          LEFT JOIN RMS_STANDARD_DATA RSD
-                                    ON RSD.STANDARD_DATA_ID = TLR.LOAD_STANDARD_TIME_ID
-                 WHERE OO.ORDER_TYPE = 4
-                   AND TLR.RESULT_LOAD_START_TIME IS NOT NULL
-                   AND TLR.STATUS = 0
-             )
-        <where>
-            <if test="dayplanNo != null">
-                <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
-                    "dayplanNo" like '%${item}%'
-                </foreach>
-                <if test="orderNumber != null">
-                    and
-                    <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-                        "orderNumber" like '%${item}%'
-                    </foreach>
-                </if>
-                <if test="capacityNumber != null">
-                    and
-                    <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
-                        "capacityNumber" like '%${item}%'
-                    </foreach>
-                </if>
-                <if test="resultLoadStartTime != null">
-                    and
-                    <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
-                        "resultLoadStartTime" like '%${item}%'
-                    </foreach>
-                </if>
-                <if test="resultLoadEndTime != null">
-                    and
-                    <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
-                        "resultLoadEndTime" like '%${item}%'
-                    </foreach>
-                </if>
-                <if test="resultLoadDuration != null">
-                    and
-                    <foreach collection="resultLoadDuration" item="item" open="(" separator="or" close=")">
-                        "resultLoadDuration" like '%${item}%'
-                    </foreach>
-                </if>
-                <if test="standardDataMin != null">
-                    and
-                    <foreach collection="standardDataMin" item="item" open="(" separator="or" close=")">
-                        "standardDataMin" like '%${item}%'
-                    </foreach>
-                </if>
-                <if test="materialName != null">
-                    and
-                    <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-                        "materialName" like '%${item}%'
-                    </foreach>
-                </if>
-                <if test="orderMaterialNumber != null">
-                    and
-                    <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
-                        "orderMaterialNumber" like '%${item}%'
-                    </foreach>
-                </if>
-                <if test="materialTheoreticalWeight != null">
-                    and
-                    <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
-                        "materialTheoreticalWeight" like '%${item}%'
-                    </foreach>
-                </if>
-                <if test="personnelName != null">
-                    and
-                    <foreach collection="personnelName" item="item" open="(" separator="or" close=")">
-                        "personnelName" like '%${item}%'
-                    </foreach>
-                </if>
-            </if>
-        </where>
-        <include refid="orderBy"></include>
-        <if test="orderField == null  ">
-            order by "resultLoadStartTime" desc
+        <if test="capacityNumber != null">
+          and
+          <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
+            "capacityNumber" like '%${item}%'
+          </foreach>
         </if>
-    </select>
-
-<!-- 查询内转进口矿/国产矿装车实绩   -->
-    <select id="getImportedDomesticNzLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
-        SELECT
-        *
-        FROM (
-        SELECT APO.PURCHASE_ORDER_NO       "purchaseOrderNo",
-        RM.MATERIAL_NAME            "materialName",
-        OO.ORDER_NUMBER             "orderNumber",
-        RC.CAPACITY_NUMBER          "capacityNumber",
-        to_char(TLR.RESULT_LOAD_START_TIME, 'yyyy-mm-dd hh:mm:ss')   "resultLoadStartTime",
-        RW.WAREHOUSE_NAME           "warehouseName",
-        to_char(TLR.RESULT_LOAD_END_TIME, 'yyyy-mm-dd hh:mm:ss')  "resultLoadEndTime",
-        TLR.RESULT_LOAD_DURATION  "loadDuration"
-        FROM TMSTRUCK_LOAD_RESULT TLR
-        LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
-        ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
-        LEFT JOIN OMSTRUCK_ORDER OO
-        ON OO.ORDER_ID = TTR.ORDER_ID
-        left join amstruck_inward_plan aip
-        on aip.plan_id = oo.order_plan_id
-        left join amstruck_requirement_plan arp
-        on arp.plan_id = aip.plan_id
-        left join amstruck_inward_requirement air
-        on air.requirement_id = arp.requirement_id
-        LEFT JOIN AMS_PURCHASE_ORDER APO
-        ON APO.PURCHASE_ORDER_ID = air.PURCHASE_ORDER_ID
-        LEFT JOIN DIL_BATCH DB
-        ON DB.BATCH_ID = APO.BATCH_ID
-        LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
-        ON OOM.ORDER_ID = OO.ORDER_ID
-        LEFT JOIN RMS_MATERIAL RM
-        ON RM.MATERIAL_ID = OOM.MATERIAL_ID
-        LEFT JOIN RMS_CAPACITY RC
-        ON RC.CAPACITY_ID = OO.CAPACITY_ID
-        LEFT JOIN RMS_WAREHOUSE RW
-        ON RW.WAREHOUSE_ID = TLR.LOADING_ID
-        WHERE OO.ORDER_TYPE =10
-        AND TLR.RESULT_LOAD_START_TIME IS NOT NULL
-        <if test="userId !=null">
-            and AIR.INSERT_USERNAME = #{userId}
+        <if test="resultLoadStartTime != null">
+          and
+          <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
+            "resultLoadStartTime" like '%${item}%'
+          </foreach>
+        </if>
+        <if test="resultLoadEndTime != null">
+          and
+          <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
+            "resultLoadEndTime" like '%${item}%'
+          </foreach>
+        </if>
+        <if test="resultLoadDuration != null">
+          and
+          <foreach collection="resultLoadDuration" item="item" open="(" separator="or" close=")">
+            "resultLoadDuration" like '%${item}%'
+          </foreach>
+        </if>
+        <if test="standardDataMin != null">
+          and
+          <foreach collection="standardDataMin" item="item" open="(" separator="or" close=")">
+            "standardDataMin" like '%${item}%'
+          </foreach>
+        </if>
+        <if test="materialName != null">
+          and
+          <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+            "materialName" like '%${item}%'
+          </foreach>
+        </if>
+        <if test="orderMaterialNumber != null">
+          and
+          <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
+            "orderMaterialNumber" like '%${item}%'
+          </foreach>
+        </if>
+        <if test="materialTheoreticalWeight != null">
+          and
+          <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
+            "materialTheoreticalWeight" like '%${item}%'
+          </foreach>
         </if>
-        order by tlr.result_load_end_time
-        )
-        <where>
-            <if test="purchaseOrderNo != null">
-                <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
-                    "purchaseOrderNo" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="materialName != null">
-                and
-                <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-                    "materialName" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="orderNumber != null">
-                and
-                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-                    "orderNumber" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="capacityNumber != null">
-                and
-                <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
-                    "capacityNumber" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultLoadStartTime != null">
-                and
-                <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
-                    "resultLoadStartTime" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultLoadEndTime != null">
-                and
-                <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
-                    "resultLoadEndTime" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="warehouseName != null">
-                and
-                <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
-                    "warehouseName" like '%${item}%'
-                </foreach>
-            </if>
-             <if test="loadDuration != null">
-                and
-                <foreach collection="loadDuration" item="item" open="(" separator="or" close=")">
-                    "loadDuration" like '%${item}%'
-                </foreach>
-            </if>
-        </where>
-        <include refid="orderBy"></include>
-        <if test="orderField == null  ">
-            order by "resultLoadStartTime" desc
+        <if test="personnelName != null">
+          and
+          <foreach collection="personnelName" item="item" open="(" separator="or" close=")">
+            "personnelName" like '%${item}%'
+          </foreach>
         </if>
-    </select>
+      </if>
+    </where>
+    <include refid="orderBy"></include>
+    <if test="orderField == null  ">
+      order by "resultLoadStartTime" desc
+    </if>
+  </select>
 
-<!--  查询内转厂内物资装车实绩  -->
-    <select id="getInFactoryLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
+  <!-- 查询内转进口矿/国产矿装车实绩   -->
+  <select id="getImportedDomesticNzLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
+    SELECT
+    *
+    FROM (
+    SELECT APO.PURCHASE_ORDER_NO       "purchaseOrderNo",
+    RM.MATERIAL_NAME            "materialName",
+    OO.ORDER_NUMBER             "orderNumber",
+    RC.CAPACITY_NUMBER          "capacityNumber",
+    to_char(TLR.RESULT_LOAD_START_TIME, 'yyyy-mm-dd hh:mm:ss')   "resultLoadStartTime",
+    RW.WAREHOUSE_NAME           "warehouseName",
+    to_char(TLR.RESULT_LOAD_END_TIME, 'yyyy-mm-dd hh:mm:ss')  "resultLoadEndTime",
+    TLR.RESULT_LOAD_DURATION  "loadDuration"
+    FROM TMSTRUCK_LOAD_RESULT TLR
+    LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+    ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
+    LEFT JOIN OMSTRUCK_ORDER OO
+    ON OO.ORDER_ID = TTR.ORDER_ID
+    left join amstruck_inward_plan aip
+    on aip.plan_id = oo.order_plan_id
+    left join amstruck_requirement_plan arp
+    on arp.plan_id = aip.plan_id
+    left join amstruck_inward_requirement air
+    on air.requirement_id = arp.requirement_id
+    LEFT JOIN AMS_PURCHASE_ORDER APO
+    ON APO.PURCHASE_ORDER_ID = air.PURCHASE_ORDER_ID
+    LEFT JOIN DIL_BATCH DB
+    ON DB.BATCH_ID = APO.BATCH_ID
+    LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
+    ON OOM.ORDER_ID = OO.ORDER_ID
+    LEFT JOIN RMS_MATERIAL RM
+    ON RM.MATERIAL_ID = OOM.MATERIAL_ID
+    LEFT JOIN RMS_CAPACITY RC
+    ON RC.CAPACITY_ID = OO.CAPACITY_ID
+    LEFT JOIN RMS_WAREHOUSE RW
+    ON RW.WAREHOUSE_ID = TLR.LOADING_ID
+    WHERE OO.ORDER_TYPE =10
+    AND TLR.RESULT_LOAD_START_TIME IS NOT NULL
+    <if test="userId !=null">
+      and AIR.INSERT_USERNAME = #{userId}
+    </if>
+    order by tlr.result_load_end_time
+    )
+    <where>
+      <if test="purchaseOrderNo != null">
+        <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
+          "purchaseOrderNo" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialName != null">
+        and
+        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+          "materialName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="orderNumber != null">
+        and
+        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+          "orderNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="capacityNumber != null">
+        and
+        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
+          "capacityNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultLoadStartTime != null">
+        and
+        <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
+          "resultLoadStartTime" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultLoadEndTime != null">
+        and
+        <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
+          "resultLoadEndTime" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="warehouseName != null">
+        and
+        <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
+          "warehouseName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="loadDuration != null">
+        and
+        <foreach collection="loadDuration" item="item" open="(" separator="or" close=")">
+          "loadDuration" like '%${item}%'
+        </foreach>
+      </if>
+    </where>
+    <include refid="orderBy"></include>
+    <if test="orderField == null  ">
+      order by "resultLoadStartTime" desc
+    </if>
+  </select>
 
-        SELECT *
-        FROM (
-                 SELECT RM.MATERIAL_NAME           "materialName",
-                        OO.ORDER_NUMBER            "orderNumber",
-                        RC.CAPACITY_NUMBER         "capacityNumber",
-                        OOM.ORDER_MATERIAL_NUMBER  "orderMaterialNumber",
-                        TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
-                        TLR.RESULT_LOAD_END_TIME   "resultLoadEndTime",
-                        TLR.RESULT_LOAD_DURATION   "resultLoadDuration",
-                        RW.WAREHOUSE_NAME          "warehouseName"
-                 FROM TMSTRUCK_LOAD_RESULT TLR
-                          LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
-                                    ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
-                          LEFT JOIN OMSTRUCK_ORDER OO
-                                    ON OO.ORDER_ID = TTR.ORDER_ID
-                          LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
-                                    ON OOM.ORDER_ID = OO.ORDER_ID
-                          LEFT JOIN RMS_MATERIAL RM
-                                    ON RM.MATERIAL_ID = OOM.MATERIAL_ID
-                          LEFT JOIN RMS_CAPACITY RC
-                                    ON RC.CAPACITY_ID = OO.CAPACITY_ID
-                          LEFT JOIN RMS_WAREHOUSE RW
-                                    ON RW.WAREHOUSE_ID = TLR.LOADING_ID
-                 WHERE OO.ORDER_TYPE = 11
-                   AND TLR.RESULT_LOAD_START_TIME IS NOT NULL
-        )
-        <where>
-            <if test="resultLoadEndTime != null">
-                <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
-                    "resultLoadEndTime" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="materialName != null">
-                and
-                <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-                    "materialName" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultLoadDuration != null">
-                and
-                <foreach collection="resultLoadDuration" item="item" open="(" separator="or" close=")">
-                    "resultLoadDuration" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="orderNumber != null">
-                and
-                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-                    "orderNumber" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="capacityNumber != null">
-                and
-                <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
-                    "capacityNumber" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="orderMaterialWeight != null">
-                and
-                <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
-                    "orderMaterialWeight" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultLoadStartTime != null">
-                and
-                <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
-                    "resultLoadStartTime" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="warehouseName != null">
-                and
-                <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
-                    "warehouseName" like '%${item}%'
-                </foreach>
-            </if>
-        </where>
-        <include refid="orderBy"></include>
-        <if test="orderField == null  ">
-            order by "resultLoadStartTime" desc
-        </if>
+  <!--  查询内转厂内物资装车实绩  -->
+  <select id="getInFactoryLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
+
+    SELECT *
+    FROM (
+    SELECT RM.MATERIAL_NAME           "materialName",
+    OO.ORDER_NUMBER            "orderNumber",
+    RC.CAPACITY_NUMBER         "capacityNumber",
+    OOM.ORDER_MATERIAL_NUMBER  "orderMaterialNumber",
+    TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
+    TLR.RESULT_LOAD_END_TIME   "resultLoadEndTime",
+    TLR.RESULT_LOAD_DURATION   "resultLoadDuration",
+    RW.WAREHOUSE_NAME          "warehouseName"
+    FROM TMSTRUCK_LOAD_RESULT TLR
+    LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+    ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
+    LEFT JOIN OMSTRUCK_ORDER OO
+    ON OO.ORDER_ID = TTR.ORDER_ID
+    LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
+    ON OOM.ORDER_ID = OO.ORDER_ID
+    LEFT JOIN RMS_MATERIAL RM
+    ON RM.MATERIAL_ID = OOM.MATERIAL_ID
+    LEFT JOIN RMS_CAPACITY RC
+    ON RC.CAPACITY_ID = OO.CAPACITY_ID
+    LEFT JOIN RMS_WAREHOUSE RW
+    ON RW.WAREHOUSE_ID = TLR.LOADING_ID
+    WHERE OO.ORDER_TYPE = 11
+    AND TLR.RESULT_LOAD_START_TIME IS NOT NULL
+    )
+    <where>
+      <if test="resultLoadEndTime != null">
+        <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
+          "resultLoadEndTime" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialName != null">
+        and
+        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+          "materialName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultLoadDuration != null">
+        and
+        <foreach collection="resultLoadDuration" item="item" open="(" separator="or" close=")">
+          "resultLoadDuration" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="orderNumber != null">
+        and
+        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+          "orderNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="capacityNumber != null">
+        and
+        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
+          "capacityNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="orderMaterialWeight != null">
+        and
+        <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
+          "orderMaterialWeight" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultLoadStartTime != null">
+        and
+        <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
+          "resultLoadStartTime" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="warehouseName != null">
+        and
+        <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
+          "warehouseName" like '%${item}%'
+        </foreach>
+      </if>
+    </where>
+    <include refid="orderBy"></include>
+    <if test="orderField == null  ">
+      order by "resultLoadStartTime" desc
+    </if>
 
-    </select>
-    <select id="getResultId" resultType="java.math.BigDecimal" parameterType="DeCimal">
-        select tlr.result_id "resultId" from tmstruck_load_result tlr
-        where tlr.result_total_id=#{totalId}
-    </select>
+  </select>
+  <select id="getResultId" resultType="java.math.BigDecimal" parameterType="DeCimal">
+    select tlr.result_id "resultId" from tmstruck_load_result tlr
+    where tlr.result_total_id=#{totalId}
+  </select>
 
-        <select id="getOrderType" resultType="java.lang.Integer">
-                select oo.order_type
-          from tmstruck_total_result ttr
-          left join omstruck_order oo
-            on oo.order_id = ttr.order_id
-         where ttr.result_total_id = #{totalId}
-        </select>
+  <select id="getOrderType" resultType="java.lang.Integer">
+    select oo.order_type
+    from tmstruck_total_result ttr
+           left join omstruck_order oo
+                     on oo.order_id = ttr.order_id
+    where ttr.result_total_id = #{totalId}
+  </select>
 
-    <!--    根据订单id查询所有的零星物资出厂实绩-->
-    <select id="getSporadicSuppliesLoadResult" resultType="java.util.Map">
-        select *
-        from (
-        select
-        TLR.RESULT_ID "resultId",
-        OO.ORDER_NUMBER "orderNumber",
-        RC.CAPACITY_NUMBER "capacityNumber",
-        TLR.RESULT_MEASURED_TONNAGE "resultMeasuredTonnage",
-        TLR.RESULT_ISCLEAR "resultIsclear",
-        to_char(TLR.RESULT_LOAD_START_TIME, 'yyyy-mm-dd') "resultLoadStartTime",
-        TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
-        TLR.INSERT_TIME "insertTime",
-        RM.MATERIAL_NAME "materialName",
-        OOM.ORDER_MATERIAL_NUMBER "materialNumber",
-        OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
-        TWR.RESULT_NET_WEIGHT "netWeight"
-        from TMSTRUCK_LOAD_RESULT TLR
-        left join TMSTRUCK_TOTAL_RESULT TTR
-        on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-        left join TMSTRUCK_WEIGHT_RESULT TWR
-        on TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
-        left join OMSTRUCK_ORDER OO
-        on TTR.ORDER_ID = OO.ORDER_ID
-        left join OMSTRUCK_ORDER_MATERIAL OOM
-        on OOM.ORDER_ID=OO.ORDER_ID
-        left join RMS_MATERIAL RM
-        on RM.MATERIAL_ID = OOM.MATERIAL_ID
-        left join AMSTRUCK_SPORADIC_ORDER ASO
-        on OO.ORDER_PLAN_ID = ASO.SPORADIC_ORDER_ID
-        left join RMS_CAPACITY RC
-        on RC.CAPACITY_ID = OO.CAPACITY_ID
-        where TLR.STATUS = #{status} and OO.ORDER_TYPE = #{orderTypee}
-          and TLR.RESULT_LOAD_START_TIME IS NOT NULL
-          <if test="userId!=null">
-             AND  ASO.INSERT_USERNAME=#{userId}
-          </if>
-           <if test="userIds!=null">
-             and ASO.UPDATE_USERNAME = #{userIds}
-            </if>
-        )
-        <where>
-            <if test="orderNumber != null">
-                and
-                <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-                    "orderNumber" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="capacityNumber != null">
-                and
-                <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
-                    "capacityNumber" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultIsclear != null">
-                and
-                <foreach collection="resultIsclear" item="item" open="(" separator="or" close=")">
-                    "resultIsclear" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="resultLoadStartTime != null">
-                and
-                <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
-                    "resultLoadStartTime" like '%${item}%'
-                </foreach>
-            </if>
-            <if test="insertUpdateRemark != null">
-                and
-                <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
-                    "insertUpdateRemark" like '%${item}%'
-                </foreach>
-            </if>
-        </where>
-        <include refid="orderBy"></include>
-        <if test="orderField == null  ">
-            order by "resultLoadStartTime" desc
-        </if>
-    </select>
-<!--  获取采购内转装车实绩  -->
-    <select id="getCgNzLoadingResult" resultType="java.util.Map" parameterType="java.lang.Integer">
-          select *from ( select OO.ORDER_NUMBER              "orderNumber",
-                       OOM.ORDER_MATERIAL_WEIGHT    "orderMaterialWeight",
-                       OO.ORDER_RECEIVE_REFUSE_TIME "orderReceiveRefuseTime",
-                       RW.WAREHOUSE_NAME            "warehouseName",
-                       RM.MATERIAL_NAME             "materialName",
-                       RC.CAPACITY_NUMBER           "capacityNumber",
-                       RW2.WAREHOUSE_NAME           "warehouseName2",
-                       OO.INSERT_UPDATE_REMARK      "insertUpdateRemark",
-                       TTR.RESULT_TOTAL_ID          "resultTotalId"
-                  from OMSTRUCK_ORDER OO
-                  left join RMS_CAPACITY RC
-                    on RC.CAPACITY_ID = OO.CAPACITY_ID
-                  left join OMSTRUCK_ORDER_MATERIAL OOM
-                    on OOM.ORDER_ID = OO.ORDER_ID
-                  left join RMS_MATERIAL RM
-                    on RM.MATERIAL_ID = OOM.MATERIAL_ID
-                  left join RMS_WAREHOUSE RW
-                    on RW.WAREHOUSE_ID = OO.UNLOAD_POINT_ID
-                  left join TMSTRUCK_TOTAL_RESULT TTR
-                    on TTR.ORDER_ID = OO.ORDER_ID
-                  left join TMSTRUCK_LOAD_RESULT TLR
-                    on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-                  left join RMS_WAREHOUSE RW2
-                    on RW2.WAREHOUSE_ID = TLR.LOADING_ID
-                 where OO.ORDER_STATUS = #{orderStatus}
-                   and TLR.RESULT_LOAD_END_TIME IS NULL
-                   and OO.ORDER_TYPE = #{orderType})
-    </select>
+  <!--    根据订单id查询所有的零星物资出厂实绩-->
+  <select id="getSporadicSuppliesLoadResult" resultType="java.util.Map">
+    select *
+    from (
+    select
+    TLR.RESULT_ID "resultId",
+    OO.ORDER_NUMBER "orderNumber",
+    RC.CAPACITY_NUMBER "capacityNumber",
+    TLR.RESULT_MEASURED_TONNAGE "resultMeasuredTonnage",
+    TLR.RESULT_ISCLEAR "resultIsclear",
+    to_char(TLR.RESULT_LOAD_START_TIME, 'yyyy-mm-dd') "resultLoadStartTime",
+    TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
+    TLR.INSERT_TIME "insertTime",
+    RM.MATERIAL_NAME "materialName",
+    OOM.ORDER_MATERIAL_NUMBER "materialNumber",
+    OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
+    TWR.RESULT_NET_WEIGHT "netWeight"
+    from TMSTRUCK_LOAD_RESULT TLR
+    left join TMSTRUCK_TOTAL_RESULT TTR
+    on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+    left join TMSTRUCK_WEIGHT_RESULT TWR
+    on TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
+    left join OMSTRUCK_ORDER OO
+    on TTR.ORDER_ID = OO.ORDER_ID
+    left join OMSTRUCK_ORDER_MATERIAL OOM
+    on OOM.ORDER_ID=OO.ORDER_ID
+    left join RMS_MATERIAL RM
+    on RM.MATERIAL_ID = OOM.MATERIAL_ID
+    left join AMSTRUCK_SPORADIC_ORDER ASO
+    on OO.ORDER_PLAN_ID = ASO.SPORADIC_ORDER_ID
+    left join RMS_CAPACITY RC
+    on RC.CAPACITY_ID = OO.CAPACITY_ID
+    where TLR.STATUS = #{status} and OO.ORDER_TYPE = #{orderTypee}
+    and TLR.RESULT_LOAD_START_TIME IS NOT NULL
+    <if test="userId!=null">
+      AND  ASO.INSERT_USERNAME=#{userId}
+    </if>
+    <if test="userIds!=null">
+      and ASO.UPDATE_USERNAME = #{userIds}
+    </if>
+    )
+    <where>
+      <if test="orderNumber != null">
+        and
+        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+          "orderNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="capacityNumber != null">
+        and
+        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
+          "capacityNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultIsclear != null">
+        and
+        <foreach collection="resultIsclear" item="item" open="(" separator="or" close=")">
+          "resultIsclear" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultLoadStartTime != null">
+        and
+        <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
+          "resultLoadStartTime" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="insertUpdateRemark != null">
+        and
+        <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
+          "insertUpdateRemark" like '%${item}%'
+        </foreach>
+      </if>
+    </where>
+    <include refid="orderBy"></include>
+    <if test="orderField == null  ">
+      order by "resultLoadStartTime" desc
+    </if>
+  </select>
+  <!--  获取采购内转装车实绩  -->
+  <select id="getCgNzLoadingResult" resultType="java.util.Map" parameterType="java.lang.Integer">
+    select *from ( select OO.ORDER_NUMBER              "orderNumber",
+                          OOM.ORDER_MATERIAL_WEIGHT    "orderMaterialWeight",
+                          OO.ORDER_RECEIVE_REFUSE_TIME "orderReceiveRefuseTime",
+                          RW.WAREHOUSE_NAME            "warehouseName",
+                          RM.MATERIAL_NAME             "materialName",
+                          RC.CAPACITY_NUMBER           "capacityNumber",
+                          RW2.WAREHOUSE_NAME           "warehouseName2",
+                          OO.INSERT_UPDATE_REMARK      "insertUpdateRemark",
+                          TTR.RESULT_TOTAL_ID          "resultTotalId"
+                   from OMSTRUCK_ORDER OO
+                          left join RMS_CAPACITY RC
+                                    on RC.CAPACITY_ID = OO.CAPACITY_ID
+                          left join OMSTRUCK_ORDER_MATERIAL OOM
+                                    on OOM.ORDER_ID = OO.ORDER_ID
+                          left join RMS_MATERIAL RM
+                                    on RM.MATERIAL_ID = OOM.MATERIAL_ID
+                          left join RMS_WAREHOUSE RW
+                                    on RW.WAREHOUSE_ID = OO.UNLOAD_POINT_ID
+                          left join TMSTRUCK_TOTAL_RESULT TTR
+                                    on TTR.ORDER_ID = OO.ORDER_ID
+                          left join TMSTRUCK_LOAD_RESULT TLR
+                                    on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+                          left join RMS_WAREHOUSE RW2
+                                    on RW2.WAREHOUSE_ID = TLR.LOADING_ID
+                   where OO.ORDER_STATUS = #{orderStatus}
+                     and TLR.RESULT_LOAD_END_TIME IS NULL
+                     and OO.ORDER_TYPE = #{orderType})
+  </select>
 </mapper>