Forráskód Böngészése

修改供应商问题

HUJIANGUO 3 éve
szülő
commit
76d70925b5

+ 746 - 742
src/main/resources/com/steerinfo/dil/mapper/TmstruckEnfactoryResultMapper.xml

@@ -1,774 +1,778 @@
 <?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.TmstruckEnfactoryResultMapper">
-  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckEnfactoryResult">
-    <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
-    <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
-    <result column="GATEPOST_ID" jdbcType="DECIMAL" property="gatepostId" />
-    <result column="RESULT_ENTRY_MODE" jdbcType="VARCHAR" property="resultEntryMode" />
-    <result column="RESULT_ENTRY_GATE_TIME" jdbcType="TIMESTAMP" property="resultEntryGateTime" />
-    <result column="RESULT_MEMO" jdbcType="VARCHAR" property="resultMemo" />
-    <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="DELETE_USERNAME" jdbcType="VARCHAR" property="deleteUsername" />
-    <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
-  </resultMap>
-  <sql id="columns">
-    RESULT_ID, RESULT_TOTAL_ID, GATEPOST_ID, RESULT_ENTRY_MODE, RESULT_ENTRY_GATE_TIME, 
+    <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckEnfactoryResult">
+        <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId"/>
+        <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId"/>
+        <result column="GATEPOST_ID" jdbcType="DECIMAL" property="gatepostId"/>
+        <result column="RESULT_ENTRY_MODE" jdbcType="VARCHAR" property="resultEntryMode"/>
+        <result column="RESULT_ENTRY_GATE_TIME" jdbcType="TIMESTAMP" property="resultEntryGateTime"/>
+        <result column="RESULT_MEMO" jdbcType="VARCHAR" property="resultMemo"/>
+        <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="DELETE_USERNAME" jdbcType="VARCHAR" property="deleteUsername"/>
+        <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime"/>
+    </resultMap>
+    <sql id="columns">
+        RESULT_ID, RESULT_TOTAL_ID, GATEPOST_ID, RESULT_ENTRY_MODE, RESULT_ENTRY_GATE_TIME,
     RESULT_MEMO, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, 
     DELETE_USERNAME, DELETE_TIME
-  </sql>
-  <sql id="columns_alias">
-    t.RESULT_ID, t.RESULT_TOTAL_ID, t.GATEPOST_ID, t.RESULT_ENTRY_MODE, t.RESULT_ENTRY_GATE_TIME, 
+    </sql>
+    <sql id="columns_alias">
+        t.RESULT_ID, t.RESULT_TOTAL_ID, t.GATEPOST_ID, t.RESULT_ENTRY_MODE, t.RESULT_ENTRY_GATE_TIME,
     t.RESULT_MEMO, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, 
     t.INSERT_UPDATE_REMARK, t.DELETE_USERNAME, t.DELETE_TIME
-  </sql>
-  <sql id="select">
-    SELECT <include refid="columns"/> FROM TMSTRUCK_ENFACTORY_RESULT
-  </sql>
-  <sql id="select_alias">
-    SELECT <include refid="columns_alias"/> FROM TMSTRUCK_ENFACTORY_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="gatepostId != null">
-        and GATEPOST_ID = #{gatepostId}
-      </if>
-      <if test="resultEntryMode != null and resultEntryMode != ''">
-        and RESULT_ENTRY_MODE = #{resultEntryMode}
-      </if>
-      <if test="resultEntryGateTime != null">
-        and TO_CHAR(RESULT_ENTRY_GATE_TIME,'yyyy-MM-dd') = #{resultEntryGateTime}
-      </if>
-      <if test="resultMemo != null and resultMemo != ''">
-        and RESULT_MEMO = #{resultMemo}
-      </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="deleteUsername != null and deleteUsername != ''">
-        and DELETE_USERNAME = #{deleteUsername}
-      </if>
-      <if test="deleteTime != null">
-        and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
-      </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="gatepostId != null">
-        and GATEPOST_ID = #{gatepostId}
-      </if>
-      <if test="resultEntryMode != null and resultEntryMode != ''">
-        and RESULT_ENTRY_MODE LIKE '%${resultEntryMode}%'
-      </if>
-      <if test="resultEntryGateTime != null">
-        and TO_CHAR(RESULT_ENTRY_GATE_TIME,'yyyy-MM-dd') = #{resultEntryGateTime}
-      </if>
-      <if test="resultMemo != null and resultMemo != ''">
-        and RESULT_MEMO LIKE '%${resultMemo}%'
-      </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="deleteUsername != null and deleteUsername != ''">
-        and DELETE_USERNAME LIKE '%${deleteUsername}%'
-      </if>
-      <if test="deleteTime != null">
-        and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
-      </if>
-    </where>
-  </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
-    delete from TMSTRUCK_ENFACTORY_RESULT
-    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
-  </delete>
-  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
-    delete from TMSTRUCK_ENFACTORY_RESULT
-    where 1!=1 
-      <if test="resultTotalId != null">
-        or RESULT_TOTAL_ID = #{resultTotalId}
-      </if>
-      <if test="gatepostId != null">
-        or GATEPOST_ID = #{gatepostId}
-      </if>
-      <if test="resultEntryMode != null and resultEntryMode != ''">
-        or RESULT_ENTRY_MODE = #{resultEntryMode}
-      </if>
-      <if test="resultEntryGateTime != null">
-        or TO_CHAR(RESULT_ENTRY_GATE_TIME,'yyyy-MM-dd') = '#{resultEntryGateTime}'
-      </if>
-      <if test="resultMemo != null and resultMemo != ''">
-        or RESULT_MEMO = #{resultMemo}
-      </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="deleteUsername != null and deleteUsername != ''">
-        or DELETE_USERNAME = #{deleteUsername}
-      </if>
-      <if test="deleteTime != null">
-        or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
-      </if>
-  </delete>
-  <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
-    insert into TMSTRUCK_ENFACTORY_RESULT (RESULT_ID, RESULT_TOTAL_ID, GATEPOST_ID, 
-      RESULT_ENTRY_MODE, RESULT_ENTRY_GATE_TIME, 
-      RESULT_MEMO, INSERT_USERNAME, INSERT_TIME, 
-      UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, 
-      DELETE_USERNAME, DELETE_TIME)
-    values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{gatepostId,jdbcType=DECIMAL}, 
-      #{resultEntryMode,jdbcType=VARCHAR}, #{resultEntryGateTime,jdbcType=TIMESTAMP}, 
-      #{resultMemo,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, 
-      #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, 
-      #{deleteUsername,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP})
-  </insert>
-  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
-    insert into TMSTRUCK_ENFACTORY_RESULT
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="resultId != null">
-        RESULT_ID,
-      </if>
-      <if test="resultTotalId != null">
-        RESULT_TOTAL_ID,
-      </if>
-      <if test="gatepostId != null">
-        GATEPOST_ID,
-      </if>
-      <if test="resultEntryMode != null">
-        RESULT_ENTRY_MODE,
-      </if>
-      <if test="resultEntryGateTime != null">
-        RESULT_ENTRY_GATE_TIME,
-      </if>
-      <if test="resultMemo != null">
-        RESULT_MEMO,
-      </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="deleteUsername != null">
-        DELETE_USERNAME,
-      </if>
-      <if test="deleteTime != null">
-        DELETE_TIME,
-      </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="gatepostId != null">
-        #{gatepostId,jdbcType=DECIMAL},
-      </if>
-      <if test="resultEntryMode != null">
-        #{resultEntryMode,jdbcType=VARCHAR},
-      </if>
-      <if test="resultEntryGateTime != null">
-        #{resultEntryGateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="resultMemo != null">
-        #{resultMemo,jdbcType=VARCHAR},
-      </if>
-      <if test="insertUsername != null">
-        #{insertUsername,jdbcType=VARCHAR},
-      </if>
-      <if test="insertTime != null">
-        #{insertTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateUsername != null">
-        #{updateUsername,jdbcType=VARCHAR},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="insertUpdateRemark != null">
-        #{insertUpdateRemark,jdbcType=VARCHAR},
-      </if>
-      <if test="deleteUsername != null">
-        #{deleteUsername,jdbcType=VARCHAR},
-      </if>
-      <if test="deleteTime != null">
-        #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
-    update TMSTRUCK_ENFACTORY_RESULT
-    set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
-      GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL},
-      RESULT_ENTRY_MODE = #{resultEntryMode,jdbcType=VARCHAR},
-      RESULT_ENTRY_GATE_TIME = #{resultEntryGateTime,jdbcType=TIMESTAMP},
-      RESULT_MEMO = #{resultMemo,jdbcType=VARCHAR},
-      INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
-      INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
-      UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
-      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
-      INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
-      DELETE_USERNAME = #{deleteUsername,jdbcType=VARCHAR},
-      DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP}
-    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
-    update TMSTRUCK_ENFACTORY_RESULT
-    <set>
-      <if test="resultTotalId != null">
-        RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
-      </if>
-      <if test="gatepostId != null">
-        GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL},
-      </if>
-      <if test="resultEntryMode != null">
-        RESULT_ENTRY_MODE = #{resultEntryMode,jdbcType=VARCHAR},
-      </if>
-      <if test="resultEntryGateTime != null">
-        RESULT_ENTRY_GATE_TIME = #{resultEntryGateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="resultMemo != null">
-        RESULT_MEMO = #{resultMemo,jdbcType=VARCHAR},
-      </if>
-      <if test="insertUsername != null">
-        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
-      </if>
-      <if test="insertTime != null">
-        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateUsername != null">
-        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
-      </if>
-      <if test="updateTime != null">
-        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="insertUpdateRemark != null">
-        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
-      </if>
-      <if test="deleteUsername != null">
-        DELETE_USERNAME = #{deleteUsername,jdbcType=VARCHAR},
-      </if>
-      <if test="deleteTime != null">
-        DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
-      </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_ENFACTORY_RESULT 
-      (RESULT_ID, 
-      RESULT_TOTAL_ID, GATEPOST_ID, RESULT_ENTRY_MODE, 
-      RESULT_ENTRY_GATE_TIME, RESULT_MEMO, 
-      INSERT_USERNAME, INSERT_TIME, 
-      UPDATE_USERNAME, UPDATE_TIME, 
-      INSERT_UPDATE_REMARK, DELETE_USERNAME, 
-      DELETE_TIME)
-    ( <foreach collection="list" item="item" separator="union all"> 
-   select  
-      #{item.resultId,jdbcType=DECIMAL}, 
-      #{item.resultTotalId,jdbcType=DECIMAL}, #{item.gatepostId,jdbcType=DECIMAL}, #{item.resultEntryMode,jdbcType=VARCHAR}, 
-      #{item.resultEntryGateTime,jdbcType=TIMESTAMP}, #{item.resultMemo,jdbcType=VARCHAR}, 
-      #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, 
-      #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
-      #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleteUsername,jdbcType=VARCHAR}, 
-      #{item.deleteTime,jdbcType=TIMESTAMP} from dual  
-   </foreach> )
-  </insert>
-  <update id="batchUpdate" parameterType="java.util.List">
-     update TMSTRUCK_ENFACTORY_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>
-       ,GATEPOST_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.gatepostId,jdbcType=DECIMAL}
-       </foreach>
-       ,RESULT_ENTRY_MODE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEntryMode,jdbcType=VARCHAR}
-       </foreach>
-       ,RESULT_ENTRY_GATE_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEntryGateTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,RESULT_MEMO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultMemo,jdbcType=VARCHAR}
-       </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>
-       ,DELETE_USERNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteUsername,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>
-     where RESULT_ID in 
-     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
-    #{item.resultId,jdbcType=DECIMAL}
-     </foreach> 
-  </update>
-  <delete id="batchDelete" parameterType="java.util.List">
-    delete from TMSTRUCK_ENFACTORY_RESULT
-    where RESULT_ID in 
-    <foreach collection="list" item="id" open="(" close=")" separator=",">
-      #{id}
-    </foreach>
-  </delete>
-  <!-- 友情提示!!!-->
-  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-
-<!--  按照进厂时间进行排序 -->
-  <sql id="orderByEnterTime">
-    <if test="orderField != null and orderField != ''">
-      order by "${orderField}"
-      <if test="orderType != null and orderType != ''">
-        ${orderType}
-      </if>
-    </if>
-    <if test="orderField == null  ">
-      order by "resultEntryGateTime" desc
-    </if>
-  </sql>
-
-<!--  查询所有的采购进厂作业实绩 -->
-  <select id="getCGJKEnFactoryResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
-    select *
-    from (
-           select
-                  TER.RESULT_ID               "resultId",
-                  APO.PURCHASE_ORDER_NO       "purchaseOrderNo",
-                  RM.MATERIAL_NAME            "materialName",
-                  DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
-                  OO.ORDER_NUMBER             "orderNumber",
-                  RC.CAPACITY_NUMBER          "capacityNumber",
-                  RG.GATEPOST_NAME         "gatepostName",
-                  TER.RESULT_ENTRY_MODE       "resultEntryMode",
-                  TER.RESULT_ENTRY_GATE_TIME  "resultEntryGateTime",
-                  RS.SUPPLIER_NAME            "supplierName",
-                  OOM.ORDER_MATERIAL_WEIGHT   "orderMaterialWeight",
-                  TER.INSERT_TIME             "insertTime",
-                  RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
-           from TMSTRUCK_ENFACTORY_RESULT TER
-                  left join TMSTRUCK_TOTAL_RESULT TTR
-                            on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-                  left join OMSTRUCK_ORDER OO
-                            on TTR.ORDER_ID = OO.ORDER_ID
-                  left join AMS_PURCHASE_ORDER APO
-                            on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
-                  left join DIL_BATCH DB
-                            on DB.BATCH_ID = APO.BATCH_ID
-                  left join RMS_DRIVER_CAPACITY RDC
-                            on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
-                  left join RMS_CAPACITY RC
-                            on RC.CAPACITY_ID = RDC.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
-                  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_GATEPOST RG
-                            on RG.GATEPOST_ID = TER.GATEPOST_ID
-            where TER.RESULT_ENTRY_GATE_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
-         )
-      <where>
-        <if test="purchaseOrderId != null">
-          <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
-            "purchaseOrderId" like '%${item}%'
-          </foreach>
+    </sql>
+    <sql id="select">
+        SELECT
+        <include refid="columns"/>
+        FROM TMSTRUCK_ENFACTORY_RESULT
+    </sql>
+    <sql id="select_alias">
+        SELECT
+        <include refid="columns_alias"/>
+        FROM TMSTRUCK_ENFACTORY_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="gatepostId != null">
+                and GATEPOST_ID = #{gatepostId}
+            </if>
+            <if test="resultEntryMode != null and resultEntryMode != ''">
+                and RESULT_ENTRY_MODE = #{resultEntryMode}
+            </if>
+            <if test="resultEntryGateTime != null">
+                and TO_CHAR(RESULT_ENTRY_GATE_TIME,'yyyy-MM-dd') = #{resultEntryGateTime}
+            </if>
+            <if test="resultMemo != null and resultMemo != ''">
+                and RESULT_MEMO = #{resultMemo}
+            </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="deleteUsername != null and deleteUsername != ''">
+                and DELETE_USERNAME = #{deleteUsername}
+            </if>
+            <if test="deleteTime != null">
+                and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
+            </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="gatepostId != null">
+                and GATEPOST_ID = #{gatepostId}
+            </if>
+            <if test="resultEntryMode != null and resultEntryMode != ''">
+                and RESULT_ENTRY_MODE LIKE '%${resultEntryMode}%'
+            </if>
+            <if test="resultEntryGateTime != null">
+                and TO_CHAR(RESULT_ENTRY_GATE_TIME,'yyyy-MM-dd') = #{resultEntryGateTime}
+            </if>
+            <if test="resultMemo != null and resultMemo != ''">
+                and RESULT_MEMO LIKE '%${resultMemo}%'
+            </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="deleteUsername != null and deleteUsername != ''">
+                and DELETE_USERNAME LIKE '%${deleteUsername}%'
+            </if>
+            <if test="deleteTime != null">
+                and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
+            </if>
+        </where>
+    </sql>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
+        delete
+        from TMSTRUCK_ENFACTORY_RESULT
+        where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+    </delete>
+    <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+        delete from TMSTRUCK_ENFACTORY_RESULT
+        where 1!=1
+        <if test="resultTotalId != null">
+            or RESULT_TOTAL_ID = #{resultTotalId}
         </if>
-        <if test="materialName != null">
-        and
-          <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-            "materialName" like '%${item}%'
-          </foreach>
+        <if test="gatepostId != null">
+            or GATEPOST_ID = #{gatepostId}
         </if>
-        <if test="resultForeignShipName != null">
-        and
-        <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
-          "resultForeignShipName" like '%${item}%'
-        </foreach>
+        <if test="resultEntryMode != null and resultEntryMode != ''">
+            or RESULT_ENTRY_MODE = #{resultEntryMode}
         </if>
-        <if test="orderNumber != null">
-        and
-        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-          "orderNumber" like '%${item}%'
-        </foreach>
+        <if test="resultEntryGateTime != null">
+            or TO_CHAR(RESULT_ENTRY_GATE_TIME,'yyyy-MM-dd') = '#{resultEntryGateTime}'
         </if>
-        <if test="capacityNumber != null">
-        and
-        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
-          "capacityNumber" like '%${item}%'
-        </foreach>
+        <if test="resultMemo != null and resultMemo != ''">
+            or RESULT_MEMO = #{resultMemo}
         </if>
-        <if test="warehouseName != null">
-        and
-        <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
-          "warehouseName" like '%${item}%'
-        </foreach>
+        <if test="insertUsername != null and insertUsername != ''">
+            or INSERT_USERNAME = #{insertUsername}
         </if>
-        <if test="resultEntryMode != null">
-        and
-        <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
-          "resultEntryMode" like '%${item}%'
-        </foreach>
+        <if test="insertTime != null">
+            or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
         </if>
-        <if test="supplierName != null">
-        and
-        <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
-          "supplierName" like '%${item}%'
-        </foreach>
+        <if test="updateUsername != null and updateUsername != ''">
+            or UPDATE_USERNAME = #{updateUsername}
         </if>
-        <if test="orderMaterialWeight != null">
-        and
-        <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
-          "orderMaterialWeight" like '%${item}%'
-        </foreach>
+        <if test="updateTime != null">
+            or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
         </if>
-      </where>
-    <include refid="orderByEnterTime"></include>
-  </select>
-
-
-<!--  查询内转进厂作业实绩  -->
-  <select id="getAllInwardTurnEnFactoryResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
-    select *
-    from (
-    select
-        RM.MATERIAL_NAME            "materialName",
-        OO.ORDER_NUMBER             "orderNumber",
-        RC.CAPACITY_NUMBER          "capacityNumber",
-        RG.GATEPOST_NAME         "gatepostName",
-        TER.RESULT_ENTRY_MODE       "resultEntryMode",
-        TER.RESULT_ENTRY_GATE_TIME  "resultEntryGateTime",
-           (
-               CASE
-                   WHEN OOM.ORDER_MATERIAL_WEIGHT is null
-                   THEN OOM.ORDER_MATERIAL_NUMBER
-                   ELSE OOM.ORDER_MATERIAL_WEIGHT
-                   END
-               ) "orderMaterialNo"
-    from TMSTRUCK_ENFACTORY_RESULT TER
-    left join TMSTRUCK_TOTAL_RESULT TTR
-    on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-    left join OMSTRUCK_ORDER OO
-    on TTR.ORDER_ID = OO.ORDER_ID
-    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_GATEPOST RG
-    on RG.GATEPOST_ID = TER.GATEPOST_ID
-    where TER.RESULT_ENTRY_GATE_TIME is not null and OO.ORDER_TYPE = 4
-    )
-    <where>
-      <if test="materialName != null">
-
-        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-          "materialName" like '%${item}%'
+        <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+            or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+        </if>
+        <if test="deleteUsername != null and deleteUsername != ''">
+            or DELETE_USERNAME = #{deleteUsername}
+        </if>
+        <if test="deleteTime != null">
+            or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
+        </if>
+    </delete>
+    <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
+        insert into TMSTRUCK_ENFACTORY_RESULT (RESULT_ID, RESULT_TOTAL_ID, GATEPOST_ID,
+                                               RESULT_ENTRY_MODE, RESULT_ENTRY_GATE_TIME,
+                                               RESULT_MEMO, INSERT_USERNAME, INSERT_TIME,
+                                               UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
+                                               DELETE_USERNAME, DELETE_TIME)
+        values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{gatepostId,jdbcType=DECIMAL},
+                #{resultEntryMode,jdbcType=VARCHAR}, #{resultEntryGateTime,jdbcType=TIMESTAMP},
+                #{resultMemo,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
+                #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
+                #{insertUpdateRemark,jdbcType=VARCHAR},
+                #{deleteUsername,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP})
+    </insert>
+    <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
+        insert into TMSTRUCK_ENFACTORY_RESULT
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="resultId != null">
+                RESULT_ID,
+            </if>
+            <if test="resultTotalId != null">
+                RESULT_TOTAL_ID,
+            </if>
+            <if test="gatepostId != null">
+                GATEPOST_ID,
+            </if>
+            <if test="resultEntryMode != null">
+                RESULT_ENTRY_MODE,
+            </if>
+            <if test="resultEntryGateTime != null">
+                RESULT_ENTRY_GATE_TIME,
+            </if>
+            <if test="resultMemo != null">
+                RESULT_MEMO,
+            </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="deleteUsername != null">
+                DELETE_USERNAME,
+            </if>
+            <if test="deleteTime != null">
+                DELETE_TIME,
+            </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="gatepostId != null">
+                #{gatepostId,jdbcType=DECIMAL},
+            </if>
+            <if test="resultEntryMode != null">
+                #{resultEntryMode,jdbcType=VARCHAR},
+            </if>
+            <if test="resultEntryGateTime != null">
+                #{resultEntryGateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="resultMemo != null">
+                #{resultMemo,jdbcType=VARCHAR},
+            </if>
+            <if test="insertUsername != null">
+                #{insertUsername,jdbcType=VARCHAR},
+            </if>
+            <if test="insertTime != null">
+                #{insertTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateUsername != null">
+                #{updateUsername,jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="insertUpdateRemark != null">
+                #{insertUpdateRemark,jdbcType=VARCHAR},
+            </if>
+            <if test="deleteUsername != null">
+                #{deleteUsername,jdbcType=VARCHAR},
+            </if>
+            <if test="deleteTime != null">
+                #{deleteTime,jdbcType=TIMESTAMP},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
+        update TMSTRUCK_ENFACTORY_RESULT
+        set RESULT_TOTAL_ID        = #{resultTotalId,jdbcType=DECIMAL},
+            GATEPOST_ID            = #{gatepostId,jdbcType=DECIMAL},
+            RESULT_ENTRY_MODE      = #{resultEntryMode,jdbcType=VARCHAR},
+            RESULT_ENTRY_GATE_TIME = #{resultEntryGateTime,jdbcType=TIMESTAMP},
+            RESULT_MEMO            = #{resultMemo,jdbcType=VARCHAR},
+            INSERT_USERNAME        = #{insertUsername,jdbcType=VARCHAR},
+            INSERT_TIME            = #{insertTime,jdbcType=TIMESTAMP},
+            UPDATE_USERNAME        = #{updateUsername,jdbcType=VARCHAR},
+            UPDATE_TIME            = #{updateTime,jdbcType=TIMESTAMP},
+            INSERT_UPDATE_REMARK   = #{insertUpdateRemark,jdbcType=VARCHAR},
+            DELETE_USERNAME        = #{deleteUsername,jdbcType=VARCHAR},
+            DELETE_TIME            = #{deleteTime,jdbcType=TIMESTAMP}
+        where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+    </update>
+    <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
+        update TMSTRUCK_ENFACTORY_RESULT
+        <set>
+            <if test="resultTotalId != null">
+                RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+            </if>
+            <if test="gatepostId != null">
+                GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL},
+            </if>
+            <if test="resultEntryMode != null">
+                RESULT_ENTRY_MODE = #{resultEntryMode,jdbcType=VARCHAR},
+            </if>
+            <if test="resultEntryGateTime != null">
+                RESULT_ENTRY_GATE_TIME = #{resultEntryGateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="resultMemo != null">
+                RESULT_MEMO = #{resultMemo,jdbcType=VARCHAR},
+            </if>
+            <if test="insertUsername != null">
+                INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+            </if>
+            <if test="insertTime != null">
+                INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateUsername != null">
+                UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime != null">
+                UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="insertUpdateRemark != null">
+                INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+            </if>
+            <if test="deleteUsername != null">
+                DELETE_USERNAME = #{deleteUsername,jdbcType=VARCHAR},
+            </if>
+            <if test="deleteTime != null">
+                DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
+            </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_ENFACTORY_RESULT
+        (RESULT_ID,
+        RESULT_TOTAL_ID, GATEPOST_ID, RESULT_ENTRY_MODE,
+        RESULT_ENTRY_GATE_TIME, RESULT_MEMO,
+        INSERT_USERNAME, INSERT_TIME,
+        UPDATE_USERNAME, UPDATE_TIME,
+        INSERT_UPDATE_REMARK, DELETE_USERNAME,
+        DELETE_TIME)
+        ( <foreach collection="list" item="item" separator="union all">
+        select
+        #{item.resultId,jdbcType=DECIMAL},
+        #{item.resultTotalId,jdbcType=DECIMAL}, #{item.gatepostId,jdbcType=DECIMAL},
+        #{item.resultEntryMode,jdbcType=VARCHAR},
+        #{item.resultEntryGateTime,jdbcType=TIMESTAMP}, #{item.resultMemo,jdbcType=VARCHAR},
+        #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
+        #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
+        #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleteUsername,jdbcType=VARCHAR},
+        #{item.deleteTime,jdbcType=TIMESTAMP} from dual
+    </foreach> )
+    </insert>
+    <update id="batchUpdate" parameterType="java.util.List">
+        update TMSTRUCK_ENFACTORY_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>
-      </if>
-      <if test="orderNumber != null">
-        and
-        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-          "orderNumber" like '%${item}%'
+        ,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>
-      </if>
-      <if test="capacityNumber != null">
-        and
-        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
-          "capacityNumber" like '%${item}%'
+        ,GATEPOST_ID=
+        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+            when #{item.resultId,jdbcType=DECIMAL} then #{item.gatepostId,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="resultEntryMode != null">
-        and
-        <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
-          "resultEntryMode" like '%${item}%'
+        ,RESULT_ENTRY_MODE=
+        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+            when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEntryMode,jdbcType=VARCHAR}
         </foreach>
-      </if>
-      <if test="orderMaterialNo != null">
-        and
-        <foreach collection="orderMaterialNo" item="item" open="(" separator="or" close=")">
-          "orderMaterialNo" like '%${item}%'
+        ,RESULT_ENTRY_GATE_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+            when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEntryGateTime,jdbcType=TIMESTAMP}
         </foreach>
-      </if>
-    </where>
-    <include refid="orderByEnterTime"></include>
-  </select>
-  
-<!--  通过车牌号并且状态不为2 或 运输订单 或运输订单ID  查询关联的实绩总表ID -->
-  <select id="selectOrderIdByCpAndOn" parameterType="java.util.Map" resultType="int">
-    select TTR.RESULT_TOTAL_ID "resultTotalId"
-    from OMSTRUCK_ORDER OO
-           left join TMSTRUCK_TOTAL_RESULT TTR
-                on TTR.ORDER_ID = OO.ORDER_ID
-           left join RMS_CAPACITY RC
-                on RC.CAPACITY_ID = OO.CAPACITY_ID
-    <where>
-      <if test="orderId != null">
-        OO.ORDER_ID = #{orderId}
-      </if>
-
-      <if test="orderNumber != null">
-        and OO.ORDER_NUMBER = #{orderNumber}
-      </if>
-      <if test="capacityNumber != null">
-        RC.CAPACITY_NUMBER = #{capacityNumber} and OO.ORDER_STATUS != 2 --司机还未结束不能生成下一单
-      </if>
-    </where>
-  </select>
-
-<!--  通过门岗名称查询门岗Id-->
-  <select id="selectGatepostIdByGatepostName" parameterType="java.lang.String" resultType="int">
-    select GATEPOST_ID "gatepostId"
-    from RMS_GATEPOST
-    where GATEPOST_NAME = #{gatepostName}
-  </select>
-
-<!--  通过运输订单号查找实绩Id -->
-  <select id="selectEnFactoryResultId" parameterType="string" resultType="java.util.Map">
-    select  TER.RESULT_ID "resultId",
-            OO.ORDER_ID "orderId",
-            OO.ORDER_TYPE "orderTypee", --避免与筛选条件重名
-            TER.RESULT_TOTAL_ID "resultTotalId"
-    from OMSTRUCK_ORDER OO
-           left join TMSTRUCK_TOTAL_RESULT TTR
-                     on OO.ORDER_ID=TTR.ORDER_ID
-           left join TMSTRUCK_ENFACTORY_RESULT TER
-                     on TER.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
-    where OO.ORDER_NUMBER=#{orderNumber}
-  </select>
-
-<!--  查找排队序号 -->
-  <select id="selectNodeNumber" resultType="int" parameterType="string">
-    select
-           (
-        <![CDATA[
-             select
-               count(*)
-             from
-               QMS_QUEUE_LIST QQL2
-                 join QMS_QUEUE_GRID QQG2
-                      on QQG2.GRID_ID = QQL2.GRID_ID
-             where
-               QQL2.LIST_NODE_ORDER <= QQL.LIST_NODE_ORDER
-               and QQL2.GRID_ID = QQL.GRID_ID
-               and QQL2.DELETED = 0
-        ]]>
-      ) "listNodeOrder"
-    from OMSTRUCK_ORDER OO
-           left join QMS_QUEUE_LIST QQL
-                     on OO.CAPACITY_ID = QQL.CAPACITY_ID
-    where OO.ORDER_NUMBER = #{orderNumber} and QQL.DELETED = 1
-  </select>
-
-<!--查询销售进厂实绩 -->
-  <select id="getXSEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
-    select *
-    from (
-    select
-    TER.RESULT_ID               "resultId",
-    ASO.SALE_NUMBER             "saleNumber",
-    RM.MATERIAL_NAME            "materialName",
-    OO.ORDER_NUMBER             "orderNumber",
-    RC.CAPACITY_NUMBER          "capacityNumber",
-    RG.GATEPOST_NAME         "gatepostName",
-    TER.RESULT_ENTRY_MODE       "resultEntryMode",
-    TER.RESULT_ENTRY_GATE_TIME  "resultEntryGateTime",
-    RS.SHIPPER_NAME            "shipperName",
-    OOM.ORDER_MATERIAL_NUMBER   "orderMaterialNumber",
-    TER.INSERT_TIME             "insertTime",
-    RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
-    from TMSTRUCK_ENFACTORY_RESULT TER
-    left join TMSTRUCK_TOTAL_RESULT TTR
-    on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-    left join OMSTRUCK_ORDER OO
-    on TTR.ORDER_ID = OO.ORDER_ID
-    left join AMS_SALE_ORDER ASO
-    on ASO.SALE_ORDER_ID = OO.ORDER_PLAN_ID
-    left join RMS_DRIVER_CAPACITY RDC
-    on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
-    left join RMS_CAPACITY RC
-    on RC.CAPACITY_ID = RDC.CAPACITY_ID
-    left join RMS_SHIPPER RS
-    on RS.SHIPPER_ID = ASO.SHIPPER_ID
-    left join RMS_CONSIGNEE RCON
-    on RCON.CONSIGNEE_ID = ASO.RECEIVE_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_GATEPOST RG
-    on RG.GATEPOST_ID = TER.GATEPOST_ID
-    where TER.RESULT_ENTRY_GATE_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
-    )
-    <where>
-      <if test="saleNumber != null">
-        <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
-          "saleNumber" like '%${item}%'
+        ,RESULT_MEMO=
+        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+            when #{item.resultId,jdbcType=DECIMAL} then #{item.resultMemo,jdbcType=VARCHAR}
         </foreach>
-      </if>
-      <if test="materialName != null">
-        and
-        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-          "materialName" like '%${item}%'
+        ,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>
-      </if>
-      <if test="gatepostName != null">
-        and
-        <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
-          "gatepostName" like '%${item}%'
+        ,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>
-      </if>
-      <if test="orderNumber != null">
-        and
-        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-          "orderNumber" like '%${item}%'
+        ,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>
-      </if>
-      <if test="capacityNumber != null">
-        and
-        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
-          "capacityNumber" like '%${item}%'
+        ,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>
-      </if>
-      <if test="shipperName != null">
-        and
-        <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
-          "shipperName" like '%${item}%'
+        ,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>
-      </if>
-      <if test="resultEntryMode != null">
-        and
-        <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
-          "resultEntryMode" like '%${item}%'
+        ,DELETE_USERNAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+            when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteUsername,jdbcType=VARCHAR}
         </foreach>
-      </if>
-      <if test="resultEntryGateTime != null">
-        and
-        <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
-          "resultEntryGateTime" like '%${item}%'
+        ,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>
-      </if>
-      <if test="consigneeCompanyName != null">
-        and
-        <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
-          "consigneeCompanyName" like '%${item}%'
+        where RESULT_ID in
+        <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+            #{item.resultId,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="orderMaterialNumber != null">
-        and
-        <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
-          "orderMaterialNumber" like '%${item}%'
+    </update>
+    <delete id="batchDelete" parameterType="java.util.List">
+        delete from TMSTRUCK_ENFACTORY_RESULT
+        where RESULT_ID in
+        <foreach collection="list" item="id" open="(" close=")" separator=",">
+            #{id}
         </foreach>
-      </if>
-    </where>
-    <include refid="orderByEnterTime"></include>
-  </select>
+    </delete>
+    <!-- 友情提示!!!-->
+    <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+    <!--  按照进厂时间进行排序 -->
+    <sql id="orderByEnterTime">
+        <if test="orderField != null and orderField != ''">
+            order by "${orderField}"
+            <if test="orderType != null and orderType != ''">
+                ${orderType}
+            </if>
+        </if>
+        <if test="orderField == null  ">
+            order by "resultEntryGateTime" desc
+        </if>
+    </sql>
+
+    <!--  查询所有的采购进厂作业实绩 -->
+    <select id="getCGJKEnFactoryResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+        select *
+        from (
+        select
+        TER.RESULT_ID "resultId",
+        APO.PURCHASE_ORDER_NO "purchaseOrderNo",
+        RM.MATERIAL_NAME "materialName",
+        DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
+        OO.ORDER_NUMBER "orderNumber",
+        RC.CAPACITY_NUMBER "capacityNumber",
+        RG.GATEPOST_NAME "gatepostName",
+        TER.RESULT_ENTRY_MODE "resultEntryMode",
+        TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
+        RS.SUPPLIER_DUTY_PARAGRAPH "supplierName",
+        OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
+        TER.INSERT_TIME "insertTime",
+        RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
+        from TMSTRUCK_ENFACTORY_RESULT TER
+        left join TMSTRUCK_TOTAL_RESULT TTR
+        on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER OO
+        on TTR.ORDER_ID = OO.ORDER_ID
+        left join AMS_PURCHASE_ORDER APO
+        on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
+        left join DIL_BATCH DB
+        on DB.BATCH_ID = APO.BATCH_ID
+        left join RMS_DRIVER_CAPACITY RDC
+        on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
+        left join RMS_CAPACITY RC
+        on RC.CAPACITY_ID = RDC.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
+        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_GATEPOST RG
+        on RG.GATEPOST_ID = TER.GATEPOST_ID
+        where TER.RESULT_ENTRY_GATE_TIME is not null 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="resultForeignShipName != null">
+                and
+                <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
+                    "resultForeignShipName" 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="warehouseName != null">
+                and
+                <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
+                    "warehouseName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultEntryMode != null">
+                and
+                <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
+                    "resultEntryMode" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="supplierName != null">
+                and
+                <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
+                    "supplierName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="orderMaterialWeight != null">
+                and
+                <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
+                    "orderMaterialWeight" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderByEnterTime"></include>
+    </select>
+
+
+    <!--  查询内转进厂作业实绩  -->
+    <select id="getAllInwardTurnEnFactoryResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+        select *
+        from (
+        select
+        RM.MATERIAL_NAME "materialName",
+        OO.ORDER_NUMBER "orderNumber",
+        RC.CAPACITY_NUMBER "capacityNumber",
+        RG.GATEPOST_NAME "gatepostName",
+        TER.RESULT_ENTRY_MODE "resultEntryMode",
+        TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
+        (
+        CASE
+        WHEN OOM.ORDER_MATERIAL_WEIGHT is null
+        THEN OOM.ORDER_MATERIAL_NUMBER
+        ELSE OOM.ORDER_MATERIAL_WEIGHT
+        END
+        ) "orderMaterialNo"
+        from TMSTRUCK_ENFACTORY_RESULT TER
+        left join TMSTRUCK_TOTAL_RESULT TTR
+        on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER OO
+        on TTR.ORDER_ID = OO.ORDER_ID
+        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_GATEPOST RG
+        on RG.GATEPOST_ID = TER.GATEPOST_ID
+        where TER.RESULT_ENTRY_GATE_TIME is not null and OO.ORDER_TYPE = 4
+        )
+        <where>
+            <if test="materialName != null">
+
+                <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="resultEntryMode != null">
+                and
+                <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
+                    "resultEntryMode" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="orderMaterialNo != null">
+                and
+                <foreach collection="orderMaterialNo" item="item" open="(" separator="or" close=")">
+                    "orderMaterialNo" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderByEnterTime"></include>
+    </select>
+
+    <!--  通过车牌号并且状态不为2 或 运输订单 或运输订单ID  查询关联的实绩总表ID -->
+    <select id="selectOrderIdByCpAndOn" parameterType="java.util.Map" resultType="int">
+        select TTR.RESULT_TOTAL_ID "resultTotalId"
+        from OMSTRUCK_ORDER OO
+        left join TMSTRUCK_TOTAL_RESULT TTR
+        on TTR.ORDER_ID = OO.ORDER_ID
+        left join RMS_CAPACITY RC
+        on RC.CAPACITY_ID = OO.CAPACITY_ID
+        <where>
+            <if test="orderId != null">
+                OO.ORDER_ID = #{orderId}
+            </if>
+
+            <if test="orderNumber != null">
+                and OO.ORDER_NUMBER = #{orderNumber}
+            </if>
+            <if test="capacityNumber != null">
+                RC.CAPACITY_NUMBER = #{capacityNumber} and OO.ORDER_STATUS != 2 --司机还未结束不能生成下一单
+            </if>
+        </where>
+    </select>
+
+    <!--  通过门岗名称查询门岗Id-->
+    <select id="selectGatepostIdByGatepostName" parameterType="java.lang.String" resultType="int">
+        select GATEPOST_ID "gatepostId"
+        from RMS_GATEPOST
+        where GATEPOST_NAME = #{gatepostName}
+    </select>
+
+    <!--  通过运输订单号查找实绩Id -->
+    <select id="selectEnFactoryResultId" parameterType="string" resultType="java.util.Map">
+        select TER.RESULT_ID       "resultId",
+               OO.ORDER_ID         "orderId",
+               OO.ORDER_TYPE       "orderTypee", --避免与筛选条件重名
+               TER.RESULT_TOTAL_ID "resultTotalId"
+        from OMSTRUCK_ORDER OO
+                 left join TMSTRUCK_TOTAL_RESULT TTR
+                           on OO.ORDER_ID = TTR.ORDER_ID
+                 left join TMSTRUCK_ENFACTORY_RESULT TER
+                           on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        where OO.ORDER_NUMBER = #{orderNumber}
+    </select>
+
+    <!--  查找排队序号 -->
+    <select id="selectNodeNumber" resultType="int" parameterType="string">
+        select (
+        <![CDATA[
+             select count(*)
+                   from QMS_QUEUE_LIST QQL2
+                            join QMS_QUEUE_GRID QQG2
+                                 on QQG2.GRID_ID = QQL2.GRID_ID
+                   where QQL2.LIST_NODE_ORDER <= QQL.LIST_NODE_ORDER
+                     and QQL2.GRID_ID = QQL.GRID_ID
+                     and QQL2.DELETED = 0
+        ]]>
+      ) "listNodeOrder"
+        from OMSTRUCK_ORDER OO
+                 left join QMS_QUEUE_LIST QQL
+                           on OO.CAPACITY_ID = QQL.CAPACITY_ID
+        where OO.ORDER_NUMBER = #{orderNumber}
+          and QQL.DELETED = 1
+    </select>
+
+    <!--查询销售进厂实绩 -->
+    <select id="getXSEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
+        select *
+        from (
+        select
+        TER.RESULT_ID "resultId",
+        ASO.SALE_NUMBER "saleNumber",
+        RM.MATERIAL_NAME "materialName",
+        OO.ORDER_NUMBER "orderNumber",
+        RC.CAPACITY_NUMBER "capacityNumber",
+        RG.GATEPOST_NAME "gatepostName",
+        TER.RESULT_ENTRY_MODE "resultEntryMode",
+        TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
+        RS.SHIPPER_NAME "shipperName",
+        OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
+        TER.INSERT_TIME "insertTime",
+        RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
+        from TMSTRUCK_ENFACTORY_RESULT TER
+        left join TMSTRUCK_TOTAL_RESULT TTR
+        on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER OO
+        on TTR.ORDER_ID = OO.ORDER_ID
+        left join AMS_SALE_ORDER ASO
+        on ASO.SALE_ORDER_ID = OO.ORDER_PLAN_ID
+        left join RMS_DRIVER_CAPACITY RDC
+        on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
+        left join RMS_CAPACITY RC
+        on RC.CAPACITY_ID = RDC.CAPACITY_ID
+        left join RMS_SHIPPER RS
+        on RS.SHIPPER_ID = ASO.SHIPPER_ID
+        left join RMS_CONSIGNEE RCON
+        on RCON.CONSIGNEE_ID = ASO.RECEIVE_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_GATEPOST RG
+        on RG.GATEPOST_ID = TER.GATEPOST_ID
+        where TER.RESULT_ENTRY_GATE_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
+        )
+        <where>
+            <if test="saleNumber != null">
+                <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
+                    "saleNumber" 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="gatepostName != null">
+                and
+                <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
+                    "gatepostName" 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="shipperName != null">
+                and
+                <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
+                    "shipperName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultEntryMode != null">
+                and
+                <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
+                    "resultEntryMode" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultEntryGateTime != null">
+                and
+                <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
+                    "resultEntryGateTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="consigneeCompanyName != null">
+                and
+                <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
+                    "consigneeCompanyName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="orderMaterialNumber != null">
+                and
+                <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
+                    "orderMaterialNumber" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderByEnterTime"></include>
+    </select>
 </mapper>

+ 938 - 923
src/main/resources/com/steerinfo/dil/mapper/TmstruckLoadResultMapper.xml

@@ -1,962 +1,977 @@
 <?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" />
-  </resultMap>
-  <sql id="columns">
-    RESULT_ID, RESULT_TOTAL_ID, RESULT_LOAD_START_TIME, RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION, 
+    <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"/>
+    </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
-  </sql>
-  <sql id="columns_alias">
-    t.RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_LOAD_START_TIME, t.RESULT_LOAD_END_TIME, 
+    </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
-  </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>
-    </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>
-    </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>
-  </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)
-    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})
-  </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>
-    </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>
-    </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}
-    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>
-    </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)
-    ( <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} 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>
-    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",
-                  TLR.RESULT_LOAD_START_TIME "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_DRIVER_CAPACITY RDC
-                            on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
-                  left join RMS_CAPACITY RC
-                            on RC.CAPACITY_ID = RDC.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}%'
+    </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>
+        </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>
+        </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>
+    </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)
+        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})
+    </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>
+        </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>
+        </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}
+        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>
+        </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)
+        ( <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} 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>
-      </if>
-      <if test="materialName != null">
-        and
-        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-          "materialName" like '%${item}%'
+        ,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>
-      </if>
-      <if test="orderNumber != null">
-        and
-        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-          "orderNumber" like '%${item}%'
+        ,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>
-      </if>
-      <if test="capacityNumber != null">
-        and
-        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
-          "capacityNumber" like '%${item}%'
+        ,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>
-      </if>
-      <if test="orderMaterialWeight != null">
-        and
-        <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
-          "orderMaterialWeight" like '%${item}%'
+        ,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>
-      </if>
-      <if test="resultIsclear != null">
-        and
-        <foreach collection="resultIsclear" item="item" open="(" separator="or" close=")">
-          "resultIsclear" like '%${item}%'
+        ,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>
-      </if>
-      <if test="resultLoadStartTime != null">
-        and
-        <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
-          "resultLoadStartTime" like '%${item}%'
+        ,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>
-      </if>
-      <if test="insertUpdateRemark != null">
-        and
-        <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
-          "insertUpdateRemark" like '%${item}%'
+        where RESULT_ID in
+        <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+            #{item.resultId,jdbcType=DECIMAL}
         </foreach>
-      </if>
-    </where>
-    <include refid="orderBy"></include>
-    <if test="orderField == null  ">
-      order by "resultLoadStartTime" desc
-    </if>
-  </select>
+    </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",
+        TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
+        TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
+        TLR.INSERT_TIME "insertTime",
+        RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+        RS.SUPPLIER_DUTY_PARAGRAPH "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_DRIVER_CAPACITY RDC
+        on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
+        left join RMS_CAPACITY RC
+        on RC.CAPACITY_ID = RDC.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>
 
-<!--  通过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>
 
-<!--  通过发站查询所属港口 -->
-  <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="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="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="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="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="selectResultIdByOrderNumber" resultType="java.lang.Integer" parameterType="java.lang.String">
-    select  WOSR.RESULT_ID  "resultId"
+    <!-- 根据运输订单号查找 -->
+    <select id="selectResultIdByOrderNumber" resultType="java.lang.Integer" parameterType="java.lang.String">
+        select WOSR.RESULT_ID "resultId"
 
-    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=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 = 1
+    </select>
 
-  <!-- 根据实绩id查找扫描时间 -->
-  <select id="selectLoadTimeByResultId" resultType="java.util.Map" parameterType="java.lang.Integer">
-    select WOSR.RESULT_LOAD_TIME "loadTime"
-    from WMSP_OUTBOUND_SCAN_RESULT WOSR
-    where WOSR.RESULT_ID=#{resultId}
-  </select>
+    <!-- 根据实绩id查找扫描时间 -->
+    <select id="selectLoadTimeByResultId" resultType="java.util.Map" parameterType="java.lang.Integer">
+        select WOSR.RESULT_LOAD_TIME "loadTime"
+        from WMSP_OUTBOUND_SCAN_RESULT WOSR
+        where WOSR.RESULT_ID = #{resultId}
+    </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查询装卸工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>
 
-  <!-- 销售装车实绩查询-->
-  <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>
+    <!-- 销售装车实绩查询-->
+    <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-->
-  <select id="selectMaterialIdByOrderNumber" parameterType="java.lang.String" resultType="java.util.Map">
-    SELECT
-      OOM.MATERIAL_ID "materialId"
-    FROM
-      OMSTRUCK_ORDER OO
+    <!--通过运输订单号查找物资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>
+        WHERE
+        <if test="orderNumber != null">
+            OO.ORDER_NUMBER = #{orderNumber}
+        </if>
+        <if test="orderId != null">
+            and OO.ORDER_ID = #{orderId}
+        </if>
+    </select>
 
-<!--  通过订单ID 和物资Id 查询装车实绩ID 可能会有多条-->
-  <select id="getLoadResultIdList" 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="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>
-  <!--内转物流查询汽车装车实绩 -->
-  <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 和物资Id 查询装车实绩ID 可能会有多条-->
+    <select id="getLoadResultIdList" 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="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>
+    <!--内转物流查询汽车装车实绩 -->
+    <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"
 
-    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
+        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>
+    </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>
+    <!-- 根据实绩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>
 
-  <!--通过车牌号号查找物资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以及总实绩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>
 
-<!--  查询销售装车实绩  -->
+    <!--  查询销售装车实绩  -->
     <select id="getXSLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
-      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",
-      TLR.RESULT_LOAD_START_TIME "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_DRIVER_CAPACITY RDC
-      on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
-      left join RMS_CAPACITY RC
-      on RC.CAPACITY_ID = RDC.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>
+        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",
+        TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
+        TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
+        TLR.INSERT_TIME "insertTime",
+        RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+        RS.SUPPLIER_DUTY_PARAGRAPH "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_DRIVER_CAPACITY RDC
+        on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
+        left join RMS_CAPACITY RC
+        on RC.CAPACITY_ID = RDC.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>
-      </where>
-      <include refid="orderBy"></include>
-      <if test="orderField == null  ">
-        order by "resultLoadStartTime" desc
-      </if>
     </select>
 
 </mapper>

+ 462 - 456
src/main/resources/com/steerinfo/dil/mapper/TmstruckMeasureCommissionMapper.xml

@@ -1,491 +1,497 @@
 <?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.TmstruckMeasureCommissionMapper">
-  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckMeasureCommission">
-    <id column="COMMSSION_ID" jdbcType="DECIMAL" property="commssionId" />
-    <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
-    <result column="COMMSSION_TYPE" jdbcType="DECIMAL" property="commssionType" />
-    <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" />
-  </resultMap>
-  <sql id="columns">
-    COMMSSION_ID, RESULT_TOTAL_ID, COMMSSION_TYPE, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+    <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckMeasureCommission">
+        <id column="COMMSSION_ID" jdbcType="DECIMAL" property="commssionId"/>
+        <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId"/>
+        <result column="COMMSSION_TYPE" jdbcType="DECIMAL" property="commssionType"/>
+        <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"/>
+    </resultMap>
+    <sql id="columns">
+        COMMSSION_ID, RESULT_TOTAL_ID, COMMSSION_TYPE, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
     UPDATE_TIME, INSERT_UPDATE_REMARK
-  </sql>
-  <sql id="columns_alias">
-    t.COMMSSION_ID, t.RESULT_TOTAL_ID, t.COMMSSION_TYPE, t.INSERT_USERNAME, t.INSERT_TIME, 
+    </sql>
+    <sql id="columns_alias">
+        t.COMMSSION_ID, t.RESULT_TOTAL_ID, t.COMMSSION_TYPE, t.INSERT_USERNAME, t.INSERT_TIME,
     t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
-  </sql>
-  <sql id="select">
-    SELECT <include refid="columns"/> FROM TMSTRUCK_MEASURE_COMMISSION
-  </sql>
-  <sql id="select_alias">
-    SELECT <include refid="columns_alias"/> FROM TMSTRUCK_MEASURE_COMMISSION t
-  </sql>
-  <sql id="where">
-    <where> 
-      <if test="commssionId != null">
-        and COMMSSION_ID = #{commssionId}
-      </if>
-      <if test="resultTotalId != null">
-        and RESULT_TOTAL_ID = #{resultTotalId}
-      </if>
-      <if test="commssionType != null">
-        and COMMSSION_TYPE = #{commssionType}
-      </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>
-    </where>
-  </sql>
-  <sql id="whereLike">
-    <where> 
-      <if test="commssionId != null">
-        and COMMSSION_ID = #{commssionId}
-      </if>
-      <if test="resultTotalId != null">
-        and RESULT_TOTAL_ID = #{resultTotalId}
-      </if>
-      <if test="commssionType != null">
-        and COMMSSION_TYPE = #{commssionType}
-      </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>
-    </where>
-  </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
-    delete from TMSTRUCK_MEASURE_COMMISSION
-    where COMMSSION_ID = #{commssionId,jdbcType=DECIMAL}
-  </delete>
-  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
-    delete from TMSTRUCK_MEASURE_COMMISSION
-    where 1!=1 
-      <if test="resultTotalId != null">
-        or RESULT_TOTAL_ID = #{resultTotalId}
-      </if>
-      <if test="commssionType != null">
-        or COMMSSION_TYPE = #{commssionType}
-      </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>
-  </delete>
-  <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckMeasureCommission">
-    insert into TMSTRUCK_MEASURE_COMMISSION (COMMSSION_ID, RESULT_TOTAL_ID, COMMSSION_TYPE, 
-      INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
-      UPDATE_TIME, INSERT_UPDATE_REMARK)
-    values (#{commssionId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{commssionType,jdbcType=DECIMAL}, 
-      #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR})
-  </insert>
-  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckMeasureCommission">
-    insert into TMSTRUCK_MEASURE_COMMISSION
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="commssionId != null">
-        COMMSSION_ID,
-      </if>
-      <if test="resultTotalId != null">
-        RESULT_TOTAL_ID,
-      </if>
-      <if test="commssionType != null">
-        COMMSSION_TYPE,
-      </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>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="commssionId != null">
-        #{commssionId,jdbcType=DECIMAL},
-      </if>
-      <if test="resultTotalId != null">
-        #{resultTotalId,jdbcType=DECIMAL},
-      </if>
-      <if test="commssionType != null">
-        #{commssionType,jdbcType=DECIMAL},
-      </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>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckMeasureCommission">
-    update TMSTRUCK_MEASURE_COMMISSION
-    set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
-      COMMSSION_TYPE = #{commssionType,jdbcType=DECIMAL},
-      INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
-      INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
-      UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
-      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
-      INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
-    where COMMSSION_ID = #{commssionId,jdbcType=DECIMAL}
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckMeasureCommission">
-    update TMSTRUCK_MEASURE_COMMISSION
-    <set>
-      <if test="resultTotalId != null">
-        RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
-      </if>
-      <if test="commssionType != null">
-        COMMSSION_TYPE = #{commssionType,jdbcType=DECIMAL},
-      </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>
-    </set>
-    where COMMSSION_ID = #{commssionId,jdbcType=DECIMAL}
-  </update>
-  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
-    <include refid="select"/>
-    where COMMSSION_ID = #{commssionId,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_MEASURE_COMMISSION 
-      (COMMSSION_ID, 
-      RESULT_TOTAL_ID, COMMSSION_TYPE, 
-      INSERT_USERNAME, INSERT_TIME, 
-      UPDATE_USERNAME, UPDATE_TIME, 
-      INSERT_UPDATE_REMARK)
-    ( <foreach collection="list" item="item" separator="union all"> 
-   select  
-      #{item.commssionId,jdbcType=DECIMAL}, 
-      #{item.resultTotalId,jdbcType=DECIMAL}, #{item.commssionType,jdbcType=DECIMAL}, 
-      #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, 
-      #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
-      #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual  
-   </foreach> )
-  </insert>
-  <update id="batchUpdate" parameterType="java.util.List">
-     update TMSTRUCK_MEASURE_COMMISSION
-     set
-       COMMSSION_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
-          when #{item.commssionId,jdbcType=DECIMAL} then #{item.commssionId,jdbcType=DECIMAL}
-       </foreach>
-       ,RESULT_TOTAL_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
-          when #{item.commssionId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
-       </foreach>
-       ,COMMSSION_TYPE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
-          when #{item.commssionId,jdbcType=DECIMAL} then #{item.commssionType,jdbcType=DECIMAL}
-       </foreach>
-       ,INSERT_USERNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
-          when #{item.commssionId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
-       </foreach>
-       ,INSERT_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
-          when #{item.commssionId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,UPDATE_USERNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
-          when #{item.commssionId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
-       </foreach>
-       ,UPDATE_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
-          when #{item.commssionId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,INSERT_UPDATE_REMARK=
-       <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
-          when #{item.commssionId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
-       </foreach>
-     where COMMSSION_ID in 
-     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
-    #{item.commssionId,jdbcType=DECIMAL}
-     </foreach> 
-  </update>
-  <delete id="batchDelete" parameterType="java.util.List">
-    delete from TMSTRUCK_MEASURE_COMMISSION
-    where COMMSSION_ID in
-    <foreach collection="list" item="id" open="(" close=")" 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>
-
-  <!--  通过总实绩ID 和 计量类型 查询计量委托实绩 -->
-  <select id="getMeasureCommission" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
-    select
-           TMC.COMMSSION_ID          "commssionId",
-           <if test="orderTypee = 3">
-             APO.PURCHASE_ORDER_NO     "purchaseOrderNo",
-             RS3.SUPPLIER_NAME          "supplierName",
-           </if>
-           <if test="orderTypee = 1">
-             ASO.SALE_NUMBER "saleNumber",
-             RS1.SHIPPER_NAME "shipperName",
-           </if>
-           RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
-           RM.MATERIAL_NAME          "materialName",
-           OO.ORDER_NUMBER           "orderNumber",
-           RC.CAPACITY_NUMBER        "capacityNumber",
-           RTC.TRUCK_CALCULATE_NUMBER   "truckCalculateNumber",
-           OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
-           OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
-           TMC.COMMSSION_TYPE        "commssionType",
-
-           TMC.INSERT_TIME           "insertTime"
-    from TMSTRUCK_MEASURE_COMMISSION TMC
-           left join TMSTRUCK_TOTAL_RESULT TTR
-                     on TMC.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-           left join OMSTRUCK_ORDER OO
-                     on OO.ORDER_ID = TTR.ORDER_ID
-           <if test="orderTypee = 3">
-                left join AMS_PURCHASE_ORDER APO
-                    on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
-                left join RMS_SUPPLIER RS3 -- 发货单位
-                    on RS3.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
-                left join RMS_CONSIGNEE RCON -- 收货单位
-                    on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
-           </if>
-           <if test="orderTypee = 1">
-                left join AMS_SALE_ORDER ASO
-                    on ASO.SALE_ORDER_ID = OO.ORDER_PLAN_ID
-                left join RMS_SHIPPER RS1 -- 发货单位
-                    on RS1.SHIPPER_ID = ASO.SHIPPER_ID
-                left join RMS_CONSIGNEE RCON -- 收货单位
-                    on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
-           </if>
-           <if test="type == 0"> --计皮
-             left join TMSTRUCK_WEIGHT_RESULT TWR
-                       on TWR.RESULT_TOTAL_ID = TMC.RESULT_TOTAL_ID
-             left join RMS_TRUCK_CALCULATE RTC
-                       on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
-           </if>
-           <if test="type == 1"> --计毛
-             left join TMSTRUCK_WEIGHT_RESULT TWR
-                       on TWR.RESULT_TOTAL_ID = TMC.RESULT_TOTAL_ID
-             left join RMS_TRUCK_CALCULATE RTC
-                       on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
-           </if>
-           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
-           where TMC.COMMSSION_TYPE = #{type} and TTR.RESULT_TOTAL_ID = #{resultTotalId}
-    <where>
-      <if test="purchaseOrderNo != null">
-        <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
-          "purchaseOrderNo" like '%${item}%'
+    </sql>
+    <sql id="select">
+        SELECT
+        <include refid="columns"/>
+        FROM TMSTRUCK_MEASURE_COMMISSION
+    </sql>
+    <sql id="select_alias">
+        SELECT
+        <include refid="columns_alias"/>
+        FROM TMSTRUCK_MEASURE_COMMISSION t
+    </sql>
+    <sql id="where">
+        <where>
+            <if test="commssionId != null">
+                and COMMSSION_ID = #{commssionId}
+            </if>
+            <if test="resultTotalId != null">
+                and RESULT_TOTAL_ID = #{resultTotalId}
+            </if>
+            <if test="commssionType != null">
+                and COMMSSION_TYPE = #{commssionType}
+            </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>
+        </where>
+    </sql>
+    <sql id="whereLike">
+        <where>
+            <if test="commssionId != null">
+                and COMMSSION_ID = #{commssionId}
+            </if>
+            <if test="resultTotalId != null">
+                and RESULT_TOTAL_ID = #{resultTotalId}
+            </if>
+            <if test="commssionType != null">
+                and COMMSSION_TYPE = #{commssionType}
+            </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>
+        </where>
+    </sql>
+    <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+        delete
+        from TMSTRUCK_MEASURE_COMMISSION
+        where COMMSSION_ID = #{commssionId,jdbcType=DECIMAL}
+    </delete>
+    <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+        delete from TMSTRUCK_MEASURE_COMMISSION
+        where 1!=1
+        <if test="resultTotalId != null">
+            or RESULT_TOTAL_ID = #{resultTotalId}
+        </if>
+        <if test="commssionType != null">
+            or COMMSSION_TYPE = #{commssionType}
+        </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>
+    </delete>
+    <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckMeasureCommission">
+        insert into TMSTRUCK_MEASURE_COMMISSION (COMMSSION_ID, RESULT_TOTAL_ID, COMMSSION_TYPE,
+                                                 INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
+                                                 UPDATE_TIME, INSERT_UPDATE_REMARK)
+        values (#{commssionId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{commssionType,jdbcType=DECIMAL},
+                #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
+                #{updateUsername,jdbcType=VARCHAR},
+                #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR})
+    </insert>
+    <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckMeasureCommission">
+        insert into TMSTRUCK_MEASURE_COMMISSION
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="commssionId != null">
+                COMMSSION_ID,
+            </if>
+            <if test="resultTotalId != null">
+                RESULT_TOTAL_ID,
+            </if>
+            <if test="commssionType != null">
+                COMMSSION_TYPE,
+            </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>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="commssionId != null">
+                #{commssionId,jdbcType=DECIMAL},
+            </if>
+            <if test="resultTotalId != null">
+                #{resultTotalId,jdbcType=DECIMAL},
+            </if>
+            <if test="commssionType != null">
+                #{commssionType,jdbcType=DECIMAL},
+            </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>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckMeasureCommission">
+        update TMSTRUCK_MEASURE_COMMISSION
+        set RESULT_TOTAL_ID      = #{resultTotalId,jdbcType=DECIMAL},
+            COMMSSION_TYPE       = #{commssionType,jdbcType=DECIMAL},
+            INSERT_USERNAME      = #{insertUsername,jdbcType=VARCHAR},
+            INSERT_TIME          = #{insertTime,jdbcType=TIMESTAMP},
+            UPDATE_USERNAME      = #{updateUsername,jdbcType=VARCHAR},
+            UPDATE_TIME          = #{updateTime,jdbcType=TIMESTAMP},
+            INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
+        where COMMSSION_ID = #{commssionId,jdbcType=DECIMAL}
+    </update>
+    <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckMeasureCommission">
+        update TMSTRUCK_MEASURE_COMMISSION
+        <set>
+            <if test="resultTotalId != null">
+                RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+            </if>
+            <if test="commssionType != null">
+                COMMSSION_TYPE = #{commssionType,jdbcType=DECIMAL},
+            </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>
+        </set>
+        where COMMSSION_ID = #{commssionId,jdbcType=DECIMAL}
+    </update>
+    <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+        <include refid="select"/>
+        where COMMSSION_ID = #{commssionId,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_MEASURE_COMMISSION
+        (COMMSSION_ID,
+        RESULT_TOTAL_ID, COMMSSION_TYPE,
+        INSERT_USERNAME, INSERT_TIME,
+        UPDATE_USERNAME, UPDATE_TIME,
+        INSERT_UPDATE_REMARK)
+        ( <foreach collection="list" item="item" separator="union all">
+        select
+        #{item.commssionId,jdbcType=DECIMAL},
+        #{item.resultTotalId,jdbcType=DECIMAL}, #{item.commssionType,jdbcType=DECIMAL},
+        #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
+        #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
+        #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual
+    </foreach> )
+    </insert>
+    <update id="batchUpdate" parameterType="java.util.List">
+        update TMSTRUCK_MEASURE_COMMISSION
+        set
+        COMMSSION_ID=
+        <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
+            when #{item.commssionId,jdbcType=DECIMAL} then #{item.commssionId,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="shipperName != null">
-        <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
-          "shipperName" like '%${item}%'
+        ,RESULT_TOTAL_ID=
+        <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
+            when #{item.commssionId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="saleNumber != null">
-        <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
-          "saleNumber" like '%${item}%'
+        ,COMMSSION_TYPE=
+        <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
+            when #{item.commssionId,jdbcType=DECIMAL} then #{item.commssionType,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="materialName != null">
-        and
-        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-          "materialName" like '%${item}%'
+        ,INSERT_USERNAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
+            when #{item.commssionId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
         </foreach>
-      </if>
-      <if test="orderNumber != null">
-        and
-        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-          "orderNumber" like '%${item}%'
+        ,INSERT_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
+            when #{item.commssionId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
         </foreach>
-      </if>
-      <if test="capacityNumber != null">
-        and
-        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
-          "capacityNumber" like '%${item}%'
+        ,UPDATE_USERNAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
+            when #{item.commssionId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
         </foreach>
-      </if>
-      <if test="orderMaterialNumber != null">
-        and
-        <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
-          "orderMaterialNumber" like '%${item}%'
+        ,UPDATE_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
+            when #{item.commssionId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
         </foreach>
-      </if>
-      <if test="commssionType != null">
-        and
-        <foreach collection="commssionType" item="item" open="(" separator="or" close=")">
-          "commssionType" like '%${item}%'
+        ,INSERT_UPDATE_REMARK=
+        <foreach collection="list" item="item" index="index" separator=" " open="case COMMSSION_ID" close="end">
+            when #{item.commssionId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
         </foreach>
-      </if>
-      <if test="supplierName != null">
-        and
-        <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
-          "supplierName" like '%${item}%'
+        where COMMSSION_ID in
+        <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+            #{item.commssionId,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="orderMaterialWeight != null">
-        and
-        <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
-          "orderMaterialWeight" like '%${item}%'
+    </update>
+    <delete id="batchDelete" parameterType="java.util.List">
+        delete from TMSTRUCK_MEASURE_COMMISSION
+        where COMMSSION_ID in
+        <foreach collection="list" item="id" open="(" close=")" separator=",">
+            #{id}
         </foreach>
-      </if>
-    </where>
-    <include refid="orderBy"></include>
-    <if test="orderField == null  ">
-      order by "insertTime" desc
-    </if>
-  </select>
+    </delete>
+    <!-- 友情提示!!!-->
+    <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
 
-<!-- 查询采购计量委托  -->
-  <select id="getCGMeasureCommission" parameterType="java.util.Map" resultType="java.util.Map">
-    select APO.PURCHASE_ORDER_NO "purchaseOrderNo",
-           RC.CAPACITY_NUMBER "capacityNumber",
-           OO.ORDER_NUMBER "orderNumber",
-           RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
-           RS.SUPPLIER_ID "supplierId",
-           RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
-           RM.MATERIAL_NAME "materialName",
-           RW.WAREHOUSE_NAME "warehouseName",
-           DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName"
-    from TMSTRUCK_MEASURE_COMMISSION TMC
-    left join TMSTRUCK_TOTAL_RESULT TTR
+    <!--  排序 -->
+    <sql id="orderBy">
+        <if test="orderField != null and orderField != ''">
+            order by "${orderField}"
+            <if test="orderType != null and orderType != ''">
+                ${orderType}
+            </if>
+        </if>
+    </sql>
+
+    <!--  通过总实绩ID 和 计量类型 查询计量委托实绩 -->
+    <select id="getMeasureCommission" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+        select
+        TMC.COMMSSION_ID "commssionId",
+        <if test="orderTypee = 3">
+            APO.PURCHASE_ORDER_NO "purchaseOrderNo",
+            RS3.SUPPLIER_DUTY_PARAGRAPH "supplierName",
+        </if>
+        <if test="orderTypee = 1">
+            ASO.SALE_NUMBER "saleNumber",
+            RS1.SHIPPER_NAME "shipperName",
+        </if>
+        RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+        RM.MATERIAL_NAME "materialName",
+        OO.ORDER_NUMBER "orderNumber",
+        RC.CAPACITY_NUMBER "capacityNumber",
+        RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
+        OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
+        OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
+        TMC.COMMSSION_TYPE "commssionType",
+
+        TMC.INSERT_TIME "insertTime"
+        from TMSTRUCK_MEASURE_COMMISSION TMC
+        left join TMSTRUCK_TOTAL_RESULT TTR
+        on TMC.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER OO
+        on OO.ORDER_ID = TTR.ORDER_ID
+        <if test="orderTypee = 3">
+            left join AMS_PURCHASE_ORDER APO
+            on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
+            left join RMS_SUPPLIER RS3 -- 发货单位
+            on RS3.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
+            left join RMS_CONSIGNEE RCON -- 收货单位
+            on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
+        </if>
+        <if test="orderTypee = 1">
+            left join AMS_SALE_ORDER ASO
+            on ASO.SALE_ORDER_ID = OO.ORDER_PLAN_ID
+            left join RMS_SHIPPER RS1 -- 发货单位
+            on RS1.SHIPPER_ID = ASO.SHIPPER_ID
+            left join RMS_CONSIGNEE RCON -- 收货单位
+            on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
+        </if>
+        <if test="type == 0">--计皮
+            left join TMSTRUCK_WEIGHT_RESULT TWR
+            on TWR.RESULT_TOTAL_ID = TMC.RESULT_TOTAL_ID
+            left join RMS_TRUCK_CALCULATE RTC
+            on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
+        </if>
+        <if test="type == 1">--计毛
+            left join TMSTRUCK_WEIGHT_RESULT TWR
+            on TWR.RESULT_TOTAL_ID = TMC.RESULT_TOTAL_ID
+            left join RMS_TRUCK_CALCULATE RTC
+            on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
+        </if>
+        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
+        where TMC.COMMSSION_TYPE = #{type} and TTR.RESULT_TOTAL_ID = #{resultTotalId}
+        <where>
+            <if test="purchaseOrderNo != null">
+                <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
+                    "purchaseOrderNo" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="shipperName != null">
+                <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
+                    "shipperName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="saleNumber != null">
+                <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
+                    "saleNumber" 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="orderMaterialNumber != null">
+                and
+                <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
+                    "orderMaterialNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="commssionType != null">
+                and
+                <foreach collection="commssionType" item="item" open="(" separator="or" close=")">
+                    "commssionType" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="supplierName != null">
+                and
+                <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
+                    "supplierName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="orderMaterialWeight != null">
+                and
+                <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
+                    "orderMaterialWeight" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderBy"></include>
+        <if test="orderField == null  ">
+            order by "insertTime" desc
+        </if>
+    </select>
+
+    <!-- 查询采购计量委托  -->
+    <select id="getCGMeasureCommission" parameterType="java.util.Map" resultType="java.util.Map">
+        select APO.PURCHASE_ORDER_NO "purchaseOrderNo",
+        RC.CAPACITY_NUMBER "capacityNumber",
+        OO.ORDER_NUMBER "orderNumber",
+        RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
+        RS.SUPPLIER_ID "supplierId",
+        RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+        RM.MATERIAL_NAME "materialName",
+        RW.WAREHOUSE_NAME "warehouseName",
+        DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName"
+        from TMSTRUCK_MEASURE_COMMISSION TMC
+        left join TMSTRUCK_TOTAL_RESULT TTR
         on TTR.RESULT_TOTAL_ID = TMC.RESULT_TOTAL_ID
-    left join OMSTRUCK_ORDER OO
+        left join OMSTRUCK_ORDER OO
         on OO.ORDER_ID = TTR.ORDER_ID
-    left join AMS_PURCHASE_ORDER APO
+        left join AMS_PURCHASE_ORDER APO
         on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
-    left join DIL_BATCH DB
+        left join DIL_BATCH DB
         on APO.BATCH_ID = DB.BATCH_ID
-    left join RMS_DRIVER_CAPACITY RDC
+        left join RMS_DRIVER_CAPACITY RDC
         on OO.DRIVER_CAPACITY_ID = RDC.DRIVER_CAPACITY_ID
-    left join RMS_CAPACITY RC
+        left join RMS_CAPACITY RC
         on RC.CAPACITY_ID = RDC.CAPACITY_ID
-    left join OMSTRUCK_ORDER_MATERIAL OOM
+        left join OMSTRUCK_ORDER_MATERIAL OOM
         on OOM.ORDER_ID = OO.ORDER_ID
-    left join RMS_MATERIAL RM
+        left join RMS_MATERIAL RM
         on RM.MATERIAL_ID = OOM.MATERIAL_ID
-    left join TMSTRUCK_WEIGHT_RESULT TWR
+        left join TMSTRUCK_WEIGHT_RESULT TWR
         on TWR.RESULT_TOTAL_ID = TMC.RESULT_TOTAL_ID
-    <if test="type == 0"> --计皮
-        left join RMS_TRUCK_CALCULATE RTC
+        <if test="type == 0">--计皮
+            left join RMS_TRUCK_CALCULATE RTC
             on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
-    </if>
-    <if test="type == 1"> --计毛
-        left join RMS_TRUCK_CALCULATE RTC
+        </if>
+        <if test="type == 1">--计毛
+            left join RMS_TRUCK_CALCULATE RTC
             on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
-    </if>
-    left join TMSTRUCK_UNLOAD_RESULT TUR
+        </if>
+        left join TMSTRUCK_UNLOAD_RESULT TUR
         on TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
-    left join RMS_WAREHOUSE RW
+        left join RMS_WAREHOUSE RW
         on RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
-    left join RMS_SUPPLIER RS -- 发货单位
+        left join RMS_SUPPLIER RS -- 发货单位
         on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
-    left join RMS_CONSIGNEE RCON -- 收货单位
+        left join RMS_CONSIGNEE RCON -- 收货单位
         on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
-    where TMC.COMMSSION_TYPE = #{type} and TMC.RESULT_TOTAL_ID = #{resultTotalId}
-  </select>
+        where TMC.COMMSSION_TYPE = #{type} and TMC.RESULT_TOTAL_ID = #{resultTotalId}
+    </select>
 
-<!--  查询销售计量委托  -->
+    <!--  查询销售计量委托  -->
     <select id="getXSMeasureCommission" parameterType="java.util.Map" resultType="java.util.Map">
         select
-                ASO.SALE_NUMBER "saleNumber",
-                RS.SHIPPER_NAME "shipperName",
-                RC.CAPACITY_NUMBER "capacityNumber",
-                OO.ORDER_NUMBER "orderNumber",
-                RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
-                RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
-                RM.MATERIAL_NAME "materialName",
-                RW.WAREHOUSE_NAME "warehouseName",
+        ASO.SALE_NUMBER "saleNumber",
+        RS.SHIPPER_NAME "shipperName",
+        RC.CAPACITY_NUMBER "capacityNumber",
+        OO.ORDER_NUMBER "orderNumber",
+        RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
+        RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+        RM.MATERIAL_NAME "materialName",
+        RW.WAREHOUSE_NAME "warehouseName",
         from TMSTRUCK_MEASURE_COMMISSION TMC
         left join TMSTRUCK_TOTAL_RESULT TTR
         on TTR.RESULT_TOTAL_ID = TMC.RESULT_TOTAL_ID
@@ -503,11 +509,11 @@
         on RM.MATERIAL_ID = OOM.MATERIAL_ID
         left join TMSTRUCK_WEIGHT_RESULT TWR
         on TWR.RESULT_TOTAL_ID = TMC.RESULT_TOTAL_ID
-        <if test="type == 0"> --计皮
+        <if test="type == 0">--计皮
             left join RMS_TRUCK_CALCULATE RTC
             on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
         </if>
-        <if test="type == 1"> --计毛
+        <if test="type == 1">--计毛
             left join RMS_TRUCK_CALCULATE RTC
             on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
         </if>

+ 0 - 6
src/main/resources/com/steerinfo/dil/mapper/TmstruckUnloadResultMapper.xml

@@ -563,12 +563,6 @@
                     "commssionType" like '%${item}%'
                 </foreach>
             </if>
-            <if test="supplierName != null">
-                and
-                <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
-                    "supplierName" like '%${item}%'
-                </foreach>
-            </if>
             <if test="orderMaterialWeight != null">
                 and
                 <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">

+ 1257 - 1229
src/main/resources/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.xml

@@ -1,1276 +1,1304 @@
 <?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.TmstruckWeightResultMapper">
-  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckWeightResult">
-    <id column="WEIGHT_TASK_RESULT_ID" jdbcType="DECIMAL" property="weightTaskResultId" />
-    <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
+    <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckWeightResult">
+        <id column="WEIGHT_TASK_RESULT_ID" jdbcType="DECIMAL" property="weightTaskResultId"/>
+        <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId"/>
 
-    <result column="RESULT_POUND_NO" jdbcType="VARCHAR" property="resultPoundNo" />
-    <result column="RESULT_GROSS_WEIGHT" jdbcType="DECIMAL" property="resultGrossWeight" />
-    <result column="RESULT_GROSS_WEIGHT_TIME" jdbcType="TIMESTAMP" property="resultGrossWeightTime" />
-    <result column="RESULT_TARE_WEIGHT" jdbcType="DECIMAL" property="resultTareWeight" />
-    <result column="RESULT_TARE_WEIGHT_TIME" jdbcType="TIMESTAMP" property="resultTareWeightTime" />
-    <result column="RESULT_NET_WEIGHT" jdbcType="DECIMAL" property="resultNetWeight" />
-    <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="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
-    <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
-    <result column="RESULT_GROSS_PLACE_ID" jdbcType="DECIMAL" property="resultGrossPlaceId" />
-    <result column="RESULT_TARE_PLACE_ID" jdbcType="DECIMAL" property="resultTarePlaceId" />
-  </resultMap>
-  <sql id="columns">
-    WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID,  RESULT_POUND_NO, RESULT_GROSS_WEIGHT,
+        <result column="RESULT_POUND_NO" jdbcType="VARCHAR" property="resultPoundNo"/>
+        <result column="RESULT_GROSS_WEIGHT" jdbcType="DECIMAL" property="resultGrossWeight"/>
+        <result column="RESULT_GROSS_WEIGHT_TIME" jdbcType="TIMESTAMP" property="resultGrossWeightTime"/>
+        <result column="RESULT_TARE_WEIGHT" jdbcType="DECIMAL" property="resultTareWeight"/>
+        <result column="RESULT_TARE_WEIGHT_TIME" jdbcType="TIMESTAMP" property="resultTareWeightTime"/>
+        <result column="RESULT_NET_WEIGHT" jdbcType="DECIMAL" property="resultNetWeight"/>
+        <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="DELETE_NAME" jdbcType="VARCHAR" property="deleteName"/>
+        <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime"/>
+        <result column="RESULT_GROSS_PLACE_ID" jdbcType="DECIMAL" property="resultGrossPlaceId"/>
+        <result column="RESULT_TARE_PLACE_ID" jdbcType="DECIMAL" property="resultTarePlaceId"/>
+    </resultMap>
+    <sql id="columns">
+        WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID,  RESULT_POUND_NO, RESULT_GROSS_WEIGHT,
     RESULT_GROSS_WEIGHT_TIME, RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME, RESULT_NET_WEIGHT,
     INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
     DELETE_NAME, DELETE_TIME, RESULT_GROSS_PLACE_ID, RESULT_TARE_PLACE_ID
-  </sql>
-  <sql id="columns_alias">
-    t.WEIGHT_TASK_RESULT_ID, t.RESULT_TOTAL_ID,  t.RESULT_POUND_NO, t.RESULT_GROSS_WEIGHT,
+    </sql>
+    <sql id="columns_alias">
+        t.WEIGHT_TASK_RESULT_ID, t.RESULT_TOTAL_ID,  t.RESULT_POUND_NO, t.RESULT_GROSS_WEIGHT,
     t.RESULT_GROSS_WEIGHT_TIME, t.RESULT_TARE_WEIGHT, t.RESULT_TARE_WEIGHT_TIME, t.RESULT_NET_WEIGHT,
     t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
     t.DELETE_NAME, t.DELETE_TIME, t.RESULT_GROSS_PLACE_ID, t.RESULT_TARE_PLACE_ID
-  </sql>
-  <sql id="select">
-    SELECT <include refid="columns" /> FROM TMSTRUCK_WEIGHT_RESULT
-  </sql>
-  <sql id="select_alias">
-    SELECT <include refid="columns_alias" /> FROM TMSTRUCK_WEIGHT_RESULT t
-  </sql>
-  <sql id="where">
-    <where>
-      <if test="weightTaskResultId != null">
-        and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
-      </if>
-      <if test="resultTotalId != null">
-        and RESULT_TOTAL_ID = #{resultTotalId}
-      </if>
-      <if test="resultPoundNo != null and resultPoundNo != ''">
-        and RESULT_POUND_NO = #{resultPoundNo}
-      </if>
-      <if test="resultGrossWeight != null">
-        and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
-      </if>
-      <if test="resultGrossWeightTime != null">
-        and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
-      </if>
-      <if test="resultTareWeight != null">
-        and RESULT_TARE_WEIGHT = #{resultTareWeight}
-      </if>
-      <if test="resultTareWeightTime != null">
-        and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
-      </if>
-      <if test="resultNetWeight != null">
-        and RESULT_NET_WEIGHT = #{resultNetWeight}
-      </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="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="resultGrossPlaceId != null">
-        and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
-      </if>
-      <if test="resultTarePlaceId != null">
-        and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
-      </if>
-    </where>
-  </sql>
-  <sql id="whereLike">
-    <where>
-      <if test="weightTaskResultId != null">
-        and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
-      </if>
-      <if test="resultTotalId != null">
-        and RESULT_TOTAL_ID = #{resultTotalId}
-      </if>
-      <if test="resultPoundNo != null and resultPoundNo != ''">
-        and RESULT_POUND_NO LIKE '%${resultPoundNo}%'
-      </if>
-      <if test="resultGrossWeight != null">
-        and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
-      </if>
-      <if test="resultGrossWeightTime != null">
-        and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
-      </if>
-      <if test="resultTareWeight != null">
-        and RESULT_TARE_WEIGHT = #{resultTareWeight}
-      </if>
-      <if test="resultTareWeightTime != null">
-        and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
-      </if>
-      <if test="resultNetWeight != null">
-        and RESULT_NET_WEIGHT = #{resultNetWeight}
-      </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="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="resultGrossPlaceId != null">
-        and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
-      </if>
-      <if test="resultTarePlaceId != null">
-        and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
-      </if>
-    </where>
-  </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
-    delete from TMSTRUCK_WEIGHT_RESULT
-    where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
-  </delete>
-  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
-    delete from TMSTRUCK_WEIGHT_RESULT
-    where 1!=1
-    <if test="resultTotalId != null">
-      or RESULT_TOTAL_ID = #{resultTotalId}
-    </if>
-    <if test="resultPoundNo != null and resultPoundNo != ''">
-      or RESULT_POUND_NO = #{resultPoundNo}
-    </if>
-    <if test="resultGrossWeight != null">
-      or RESULT_GROSS_WEIGHT = #{resultGrossWeight}
-    </if>
-    <if test="resultGrossWeightTime != null">
-      or TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultGrossWeightTime}'
-    </if>
-    <if test="resultTareWeight != null">
-      or RESULT_TARE_WEIGHT = #{resultTareWeight}
-    </if>
-    <if test="resultTareWeightTime != null">
-      or TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultTareWeightTime}'
-    </if>
-    <if test="resultNetWeight != null">
-      or RESULT_NET_WEIGHT = #{resultNetWeight}
-    </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="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="resultGrossPlaceId != null">
-      or RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
-    </if>
-    <if test="resultTarePlaceId != null">
-      or RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
-    insert into TMSTRUCK_WEIGHT_RESULT (WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID,
-                                        RESULT_POUND_NO, RESULT_GROSS_WEIGHT,
-                                        RESULT_GROSS_WEIGHT_TIME, RESULT_TARE_WEIGHT,
-                                        RESULT_TARE_WEIGHT_TIME, RESULT_NET_WEIGHT,
-                                        INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
-                                        UPDATE_TIME, INSERT_UPDATE_REMARK, DELETE_NAME,
-                                        DELETE_TIME, RESULT_GROSS_PLACE_ID, RESULT_TARE_PLACE_ID
-    )
-    values (#{weightTaskResultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL},
-            #{resultPoundNo,jdbcType=VARCHAR}, #{resultGrossWeight,jdbcType=DECIMAL},
-            #{resultGrossWeightTime,jdbcType=TIMESTAMP}, #{resultTareWeight,jdbcType=DECIMAL},
-            #{resultTareWeightTime,jdbcType=TIMESTAMP}, #{resultNetWeight,jdbcType=DECIMAL},
-            #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
-            #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleteName,jdbcType=VARCHAR},
-            #{deleteTime,jdbcType=TIMESTAMP}, #{resultGrossPlaceId,jdbcType=DECIMAL}, #{resultTarePlaceId,jdbcType=DECIMAL}
-           )
-  </insert>
-  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
-    insert into TMSTRUCK_WEIGHT_RESULT
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="weightTaskResultId != null">
-        WEIGHT_TASK_RESULT_ID,
-      </if>
-      <if test="resultTotalId != null">
-        RESULT_TOTAL_ID,
-      </if>
-      <if test="resultPoundNo != null">
-        RESULT_POUND_NO,
-      </if>
-      <if test="resultGrossWeight != null">
-        RESULT_GROSS_WEIGHT,
-      </if>
-      <if test="resultGrossWeightTime != null">
-        RESULT_GROSS_WEIGHT_TIME,
-      </if>
-      <if test="resultTareWeight != null">
-        RESULT_TARE_WEIGHT,
-      </if>
-      <if test="resultTareWeightTime != null">
-        RESULT_TARE_WEIGHT_TIME,
-      </if>
-      <if test="resultNetWeight != null">
-        RESULT_NET_WEIGHT,
-      </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="deleteName != null">
-        DELETE_NAME,
-      </if>
-      <if test="deleteTime != null">
-        DELETE_TIME,
-      </if>
-      <if test="resultGrossPlaceId != null">
-        RESULT_GROSS_PLACE_ID,
-      </if>
-      <if test="resultTarePlaceId != null">
-        RESULT_TARE_PLACE_ID,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="weightTaskResultId != null">
-        #{weightTaskResultId,jdbcType=DECIMAL},
-      </if>
-      <if test="resultTotalId != null">
-        #{resultTotalId,jdbcType=DECIMAL},
-      </if>
-      <if test="resultPoundNo != null">
-        #{resultPoundNo,jdbcType=VARCHAR},
-      </if>
-      <if test="resultGrossWeight != null">
-        #{resultGrossWeight,jdbcType=DECIMAL},
-      </if>
-      <if test="resultGrossWeightTime != null">
-        #{resultGrossWeightTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="resultTareWeight != null">
-        #{resultTareWeight,jdbcType=DECIMAL},
-      </if>
-      <if test="resultTareWeightTime != null">
-        #{resultTareWeightTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="resultNetWeight != null">
-        #{resultNetWeight,jdbcType=DECIMAL},
-      </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="deleteName != null">
-        #{deleteName,jdbcType=VARCHAR},
-      </if>
-      <if test="deleteTime != null">
-        #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="resultGrossPlaceId != null">
-        #{resultGrossPlaceId,jdbcType=DECIMAL},
-      </if>
-      <if test="resultTarePlaceId != null">
-        #{resultTarePlaceId,jdbcType=DECIMAL},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
-    update TMSTRUCK_WEIGHT_RESULT
-    set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
-        RESULT_POUND_NO = #{resultPoundNo,jdbcType=VARCHAR},
-        RESULT_GROSS_WEIGHT = #{resultGrossWeight,jdbcType=DECIMAL},
-        RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
-        RESULT_TARE_WEIGHT = #{resultTareWeight,jdbcType=DECIMAL},
-        RESULT_TARE_WEIGHT_TIME = #{resultTareWeightTime,jdbcType=TIMESTAMP},
-        RESULT_NET_WEIGHT = #{resultNetWeight,jdbcType=DECIMAL},
-        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
-        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
-        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
-        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
-        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
-        DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
-        DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
-        RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId,jdbcType=DECIMAL},
-        RESULT_TARE_PLACE_ID = #{resultTarePlaceId,jdbcType=DECIMAL}
-    where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
-    update TMSTRUCK_WEIGHT_RESULT
-    <set>
-      <if test="resultTotalId != null">
-        RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
-      </if>
-      <if test="resultPoundNo != null">
-        RESULT_POUND_NO = #{resultPoundNo,jdbcType=VARCHAR},
-      </if>
-      <if test="resultGrossWeight != null">
-        RESULT_GROSS_WEIGHT = #{resultGrossWeight,jdbcType=DECIMAL},
-      </if>
-      <if test="resultGrossWeightTime != null">
-        RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="resultTareWeight != null">
-        RESULT_TARE_WEIGHT = #{resultTareWeight,jdbcType=DECIMAL},
-      </if>
-      <if test="resultTareWeightTime != null">
-        RESULT_TARE_WEIGHT_TIME = #{resultTareWeightTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="resultNetWeight != null">
-        RESULT_NET_WEIGHT = #{resultNetWeight,jdbcType=DECIMAL},
-      </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="deleteName != null">
-        DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
-      </if>
-      <if test="deleteTime != null">
-        DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="resultGrossPlaceId != null">
-        RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId,jdbcType=DECIMAL},
-      </if>
-      <if test="resultTarePlaceId != null">
-        RESULT_TARE_PLACE_ID = #{resultTarePlaceId,jdbcType=DECIMAL},
-      </if>
-    </set>
-    where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
-  </update>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
-    <include refid="select" />
-    where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,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_WEIGHT_RESULT
-    (WEIGHT_TASK_RESULT_ID,
-    RESULT_TOTAL_ID, RESULT_POUND_NO,
-    RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
-    RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME,
-    RESULT_NET_WEIGHT, INSERT_USERNAME,
-    INSERT_TIME, UPDATE_USERNAME,
-    UPDATE_TIME, INSERT_UPDATE_REMARK,
-    DELETE_NAME, DELETE_TIME, RESULT_GROSS_PLACE_ID,
-    RESULT_TARE_PLACE_ID)
-    ( <foreach collection="list" item="item" separator="union all">
-    select
-    #{item.weightTaskResultId,jdbcType=DECIMAL},
-    #{item.resultTotalId,jdbcType=DECIMAL},  #{item.resultPoundNo,jdbcType=VARCHAR},
-    #{item.resultGrossWeight,jdbcType=DECIMAL}, #{item.resultGrossWeightTime,jdbcType=TIMESTAMP},
-    #{item.resultTareWeight,jdbcType=DECIMAL}, #{item.resultTareWeightTime,jdbcType=TIMESTAMP},
-    #{item.resultNetWeight,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
-    #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
-    #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
-    #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.resultGrossPlaceId,jdbcType=DECIMAL},
-    #{item.resultTarePlaceId,jdbcType=DECIMAL} from dual
-  </foreach> )
-  </insert>
-  <update id="batchUpdate" parameterType="java.util.List">
-    update TMSTRUCK_WEIGHT_RESULT
-    set
-    WEIGHT_TASK_RESULT_ID=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.weightTaskResultId,jdbcType=DECIMAL}
-    </foreach>
-    ,RESULT_TOTAL_ID=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
-    </foreach>
-    ,RESULT_POUND_NO=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultPoundNo,jdbcType=VARCHAR}
-    </foreach>
-    ,RESULT_GROSS_WEIGHT=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeight,jdbcType=DECIMAL}
-    </foreach>
-    ,RESULT_GROSS_WEIGHT_TIME=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeightTime,jdbcType=TIMESTAMP}
-    </foreach>
-    ,RESULT_TARE_WEIGHT=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeight,jdbcType=DECIMAL}
-    </foreach>
-    ,RESULT_TARE_WEIGHT_TIME=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeightTime,jdbcType=TIMESTAMP}
-    </foreach>
-    ,RESULT_NET_WEIGHT=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultNetWeight,jdbcType=DECIMAL}
-    </foreach>
-    ,INSERT_USERNAME=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
-    </foreach>
-    ,INSERT_TIME=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
-    </foreach>
-    ,UPDATE_USERNAME=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
-    </foreach>
-    ,UPDATE_TIME=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
-    </foreach>
-    ,INSERT_UPDATE_REMARK=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
-    </foreach>
-    ,DELETE_NAME=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
-    </foreach>
-    ,DELETE_TIME=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
-    </foreach>
-    ,RESULT_GROSS_PLACE_ID=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossPlaceId,jdbcType=DECIMAL}
-    </foreach>
-    ,RESULT_TARE_PLACE_ID=
-    <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
-      when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTarePlaceId,jdbcType=DECIMAL}
-    </foreach>
-    where WEIGHT_TASK_RESULT_ID in
-    <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
-      #{item.weightTaskResultId,jdbcType=DECIMAL}
-    </foreach>
-  </update>
-  <delete id="batchDelete" parameterType="java.util.List">
-    delete from TMSTRUCK_WEIGHT_RESULT
-    where WEIGHT_TASK_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>
-
-
-  <!--  通过运输订单号 查询实绩Id、总实绩ID -->
-  <select id="selectTotalIdByOrderNo" parameterType="java.lang.String" resultType="java.util.Map">
-    select
-           OO.ORDER_ID "orderId",
-           OO.ORDER_TYPE "orderTypee",
-           TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
-           TWR.RESULT_GROSS_WEIGHT "grossWeight",
-           TWR.RESULT_TARE_WEIGHT "tareWeight",
-           TTR.RESULT_TOTAL_ID "resultTotalId"
-    from OMSTRUCK_ORDER OO
-           left join TMSTRUCK_TOTAL_RESULT TTR
-                     on OO.ORDER_ID = TTR.ORDER_ID
-           left join TMSTRUCK_WEIGHT_RESULT TWR
-                     on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-    where OO.ORDER_NUMBER = #{orderNumber}
-  </select>
-
-  <!--  通过汽车衡编号查询对应的汽车衡ID  -->
-  <select id="selectTruckCalculateId" parameterType="java.lang.String" resultType="int">
-    select TRUCK_CALCULATE_ID
-    from RMS_TRUCK_CALCULATE
-    where TRUCK_CALCULATE_NUMBER = #{truckCalculateNumber}
-  </select>
-
-  <!--  查询所有的采购计毛实绩  -->
-  <select id="getCGAllJiMaoResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
-    select *
-    from (
-    select
-      TWR.WEIGHT_TASK_RESULT_ID    "weightTaskResultId",
-      APO.PURCHASE_ORDER_NO        "purchaseOrderNo",
-      RM.MATERIAL_NAME             "materialName",
-      OO.ORDER_NUMBER              "orderNumber",
-      RC.CAPACITY_NUMBER           "capacityNumber",
-      RTC.TRUCK_CALCULATE_NUMBER   "truckCalculateNumber",
-      TWR.RESULT_GROSS_WEIGHT      "resultGrossWeight",
-      TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
-      RS.SUPPLIER_NAME             "supplierName",
-    RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
-    from TMSTRUCK_WEIGHT_RESULT TWR
-    left join TMSTRUCK_TOTAL_RESULT TTR
-    on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-    left join OMSTRUCK_ORDER OO
-    on TTR.ORDER_ID = OO.ORDER_ID
-    left join AMS_PURCHASE_ORDER APO
-    on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
-        left join RMS_DRIVER_CAPACITY RDC
-            on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
-    left join RMS_CAPACITY RC
-    on RC.CAPACITY_ID = RDC.CAPACITY_ID
-    left join RMS_TRUCK_CALCULATE RTC
-    on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_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_SUPPLIER RS
-    on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
-    left join RMS_CONSIGNEE RCON
-    on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
-    where RESULT_GROSS_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
-    )
-    <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}%'
+    </sql>
+    <sql id="select">
+        SELECT
+        <include refid="columns"/>
+        FROM TMSTRUCK_WEIGHT_RESULT
+    </sql>
+    <sql id="select_alias">
+        SELECT
+        <include refid="columns_alias"/>
+        FROM TMSTRUCK_WEIGHT_RESULT t
+    </sql>
+    <sql id="where">
+        <where>
+            <if test="weightTaskResultId != null">
+                and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
+            </if>
+            <if test="resultTotalId != null">
+                and RESULT_TOTAL_ID = #{resultTotalId}
+            </if>
+            <if test="resultPoundNo != null and resultPoundNo != ''">
+                and RESULT_POUND_NO = #{resultPoundNo}
+            </if>
+            <if test="resultGrossWeight != null">
+                and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
+            </if>
+            <if test="resultGrossWeightTime != null">
+                and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
+            </if>
+            <if test="resultTareWeight != null">
+                and RESULT_TARE_WEIGHT = #{resultTareWeight}
+            </if>
+            <if test="resultTareWeightTime != null">
+                and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
+            </if>
+            <if test="resultNetWeight != null">
+                and RESULT_NET_WEIGHT = #{resultNetWeight}
+            </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="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="resultGrossPlaceId != null">
+                and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
+            </if>
+            <if test="resultTarePlaceId != null">
+                and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
+            </if>
+        </where>
+    </sql>
+    <sql id="whereLike">
+        <where>
+            <if test="weightTaskResultId != null">
+                and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
+            </if>
+            <if test="resultTotalId != null">
+                and RESULT_TOTAL_ID = #{resultTotalId}
+            </if>
+            <if test="resultPoundNo != null and resultPoundNo != ''">
+                and RESULT_POUND_NO LIKE '%${resultPoundNo}%'
+            </if>
+            <if test="resultGrossWeight != null">
+                and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
+            </if>
+            <if test="resultGrossWeightTime != null">
+                and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
+            </if>
+            <if test="resultTareWeight != null">
+                and RESULT_TARE_WEIGHT = #{resultTareWeight}
+            </if>
+            <if test="resultTareWeightTime != null">
+                and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
+            </if>
+            <if test="resultNetWeight != null">
+                and RESULT_NET_WEIGHT = #{resultNetWeight}
+            </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="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="resultGrossPlaceId != null">
+                and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
+            </if>
+            <if test="resultTarePlaceId != null">
+                and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
+            </if>
+        </where>
+    </sql>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
+        delete
+        from TMSTRUCK_WEIGHT_RESULT
+        where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
+    </delete>
+    <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+        delete from TMSTRUCK_WEIGHT_RESULT
+        where 1!=1
+        <if test="resultTotalId != null">
+            or RESULT_TOTAL_ID = #{resultTotalId}
+        </if>
+        <if test="resultPoundNo != null and resultPoundNo != ''">
+            or RESULT_POUND_NO = #{resultPoundNo}
+        </if>
+        <if test="resultGrossWeight != null">
+            or RESULT_GROSS_WEIGHT = #{resultGrossWeight}
+        </if>
+        <if test="resultGrossWeightTime != null">
+            or TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultGrossWeightTime}'
+        </if>
+        <if test="resultTareWeight != null">
+            or RESULT_TARE_WEIGHT = #{resultTareWeight}
+        </if>
+        <if test="resultTareWeightTime != null">
+            or TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultTareWeightTime}'
+        </if>
+        <if test="resultNetWeight != null">
+            or RESULT_NET_WEIGHT = #{resultNetWeight}
+        </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="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="resultGrossPlaceId != null">
+            or RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
+        </if>
+        <if test="resultTarePlaceId != null">
+            or RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
+        </if>
+    </delete>
+    <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
+        insert into TMSTRUCK_WEIGHT_RESULT (WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID,
+                                            RESULT_POUND_NO, RESULT_GROSS_WEIGHT,
+                                            RESULT_GROSS_WEIGHT_TIME, RESULT_TARE_WEIGHT,
+                                            RESULT_TARE_WEIGHT_TIME, RESULT_NET_WEIGHT,
+                                            INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
+                                            UPDATE_TIME, INSERT_UPDATE_REMARK, DELETE_NAME,
+                                            DELETE_TIME, RESULT_GROSS_PLACE_ID, RESULT_TARE_PLACE_ID)
+        values (#{weightTaskResultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL},
+                #{resultPoundNo,jdbcType=VARCHAR}, #{resultGrossWeight,jdbcType=DECIMAL},
+                #{resultGrossWeightTime,jdbcType=TIMESTAMP}, #{resultTareWeight,jdbcType=DECIMAL},
+                #{resultTareWeightTime,jdbcType=TIMESTAMP}, #{resultNetWeight,jdbcType=DECIMAL},
+                #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
+                #{updateUsername,jdbcType=VARCHAR},
+                #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
+                #{deleteName,jdbcType=VARCHAR},
+                #{deleteTime,jdbcType=TIMESTAMP}, #{resultGrossPlaceId,jdbcType=DECIMAL},
+                #{resultTarePlaceId,jdbcType=DECIMAL})
+    </insert>
+    <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
+        insert into TMSTRUCK_WEIGHT_RESULT
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="weightTaskResultId != null">
+                WEIGHT_TASK_RESULT_ID,
+            </if>
+            <if test="resultTotalId != null">
+                RESULT_TOTAL_ID,
+            </if>
+            <if test="resultPoundNo != null">
+                RESULT_POUND_NO,
+            </if>
+            <if test="resultGrossWeight != null">
+                RESULT_GROSS_WEIGHT,
+            </if>
+            <if test="resultGrossWeightTime != null">
+                RESULT_GROSS_WEIGHT_TIME,
+            </if>
+            <if test="resultTareWeight != null">
+                RESULT_TARE_WEIGHT,
+            </if>
+            <if test="resultTareWeightTime != null">
+                RESULT_TARE_WEIGHT_TIME,
+            </if>
+            <if test="resultNetWeight != null">
+                RESULT_NET_WEIGHT,
+            </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="deleteName != null">
+                DELETE_NAME,
+            </if>
+            <if test="deleteTime != null">
+                DELETE_TIME,
+            </if>
+            <if test="resultGrossPlaceId != null">
+                RESULT_GROSS_PLACE_ID,
+            </if>
+            <if test="resultTarePlaceId != null">
+                RESULT_TARE_PLACE_ID,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="weightTaskResultId != null">
+                #{weightTaskResultId,jdbcType=DECIMAL},
+            </if>
+            <if test="resultTotalId != null">
+                #{resultTotalId,jdbcType=DECIMAL},
+            </if>
+            <if test="resultPoundNo != null">
+                #{resultPoundNo,jdbcType=VARCHAR},
+            </if>
+            <if test="resultGrossWeight != null">
+                #{resultGrossWeight,jdbcType=DECIMAL},
+            </if>
+            <if test="resultGrossWeightTime != null">
+                #{resultGrossWeightTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="resultTareWeight != null">
+                #{resultTareWeight,jdbcType=DECIMAL},
+            </if>
+            <if test="resultTareWeightTime != null">
+                #{resultTareWeightTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="resultNetWeight != null">
+                #{resultNetWeight,jdbcType=DECIMAL},
+            </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="deleteName != null">
+                #{deleteName,jdbcType=VARCHAR},
+            </if>
+            <if test="deleteTime != null">
+                #{deleteTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="resultGrossPlaceId != null">
+                #{resultGrossPlaceId,jdbcType=DECIMAL},
+            </if>
+            <if test="resultTarePlaceId != null">
+                #{resultTarePlaceId,jdbcType=DECIMAL},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
+        update TMSTRUCK_WEIGHT_RESULT
+        set RESULT_TOTAL_ID          = #{resultTotalId,jdbcType=DECIMAL},
+            RESULT_POUND_NO          = #{resultPoundNo,jdbcType=VARCHAR},
+            RESULT_GROSS_WEIGHT      = #{resultGrossWeight,jdbcType=DECIMAL},
+            RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
+            RESULT_TARE_WEIGHT       = #{resultTareWeight,jdbcType=DECIMAL},
+            RESULT_TARE_WEIGHT_TIME  = #{resultTareWeightTime,jdbcType=TIMESTAMP},
+            RESULT_NET_WEIGHT        = #{resultNetWeight,jdbcType=DECIMAL},
+            INSERT_USERNAME          = #{insertUsername,jdbcType=VARCHAR},
+            INSERT_TIME              = #{insertTime,jdbcType=TIMESTAMP},
+            UPDATE_USERNAME          = #{updateUsername,jdbcType=VARCHAR},
+            UPDATE_TIME              = #{updateTime,jdbcType=TIMESTAMP},
+            INSERT_UPDATE_REMARK     = #{insertUpdateRemark,jdbcType=VARCHAR},
+            DELETE_NAME              = #{deleteName,jdbcType=VARCHAR},
+            DELETE_TIME              = #{deleteTime,jdbcType=TIMESTAMP},
+            RESULT_GROSS_PLACE_ID    = #{resultGrossPlaceId,jdbcType=DECIMAL},
+            RESULT_TARE_PLACE_ID     = #{resultTarePlaceId,jdbcType=DECIMAL}
+        where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
+    </update>
+    <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
+        update TMSTRUCK_WEIGHT_RESULT
+        <set>
+            <if test="resultTotalId != null">
+                RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+            </if>
+            <if test="resultPoundNo != null">
+                RESULT_POUND_NO = #{resultPoundNo,jdbcType=VARCHAR},
+            </if>
+            <if test="resultGrossWeight != null">
+                RESULT_GROSS_WEIGHT = #{resultGrossWeight,jdbcType=DECIMAL},
+            </if>
+            <if test="resultGrossWeightTime != null">
+                RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="resultTareWeight != null">
+                RESULT_TARE_WEIGHT = #{resultTareWeight,jdbcType=DECIMAL},
+            </if>
+            <if test="resultTareWeightTime != null">
+                RESULT_TARE_WEIGHT_TIME = #{resultTareWeightTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="resultNetWeight != null">
+                RESULT_NET_WEIGHT = #{resultNetWeight,jdbcType=DECIMAL},
+            </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="deleteName != null">
+                DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
+            </if>
+            <if test="deleteTime != null">
+                DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="resultGrossPlaceId != null">
+                RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId,jdbcType=DECIMAL},
+            </if>
+            <if test="resultTarePlaceId != null">
+                RESULT_TARE_PLACE_ID = #{resultTarePlaceId,jdbcType=DECIMAL},
+            </if>
+        </set>
+        where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
+    </update>
+    <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+        <include refid="select"/>
+        where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,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_WEIGHT_RESULT
+        (WEIGHT_TASK_RESULT_ID,
+        RESULT_TOTAL_ID, RESULT_POUND_NO,
+        RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
+        RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME,
+        RESULT_NET_WEIGHT, INSERT_USERNAME,
+        INSERT_TIME, UPDATE_USERNAME,
+        UPDATE_TIME, INSERT_UPDATE_REMARK,
+        DELETE_NAME, DELETE_TIME, RESULT_GROSS_PLACE_ID,
+        RESULT_TARE_PLACE_ID)
+        ( <foreach collection="list" item="item" separator="union all">
+        select
+        #{item.weightTaskResultId,jdbcType=DECIMAL},
+        #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultPoundNo,jdbcType=VARCHAR},
+        #{item.resultGrossWeight,jdbcType=DECIMAL}, #{item.resultGrossWeightTime,jdbcType=TIMESTAMP},
+        #{item.resultTareWeight,jdbcType=DECIMAL}, #{item.resultTareWeightTime,jdbcType=TIMESTAMP},
+        #{item.resultNetWeight,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
+        #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
+        #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
+        #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP},
+        #{item.resultGrossPlaceId,jdbcType=DECIMAL},
+        #{item.resultTarePlaceId,jdbcType=DECIMAL} from dual
+    </foreach> )
+    </insert>
+    <update id="batchUpdate" parameterType="java.util.List">
+        update TMSTRUCK_WEIGHT_RESULT
+        set
+        WEIGHT_TASK_RESULT_ID=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.weightTaskResultId,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="orderNumber != null">
-        and
-        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-          "orderNumber" like '%${item}%'
+        ,RESULT_TOTAL_ID=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="capacityNumber != null">
-        and
-        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
-          "capacityNumber" like '%${item}%'
+        ,RESULT_POUND_NO=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultPoundNo,jdbcType=VARCHAR}
         </foreach>
-      </if>
-      <if test="truckCalculateNumber != null">
-        and
-        <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
-          "truckCalculateNumber" like '%${item}%'
+        ,RESULT_GROSS_WEIGHT=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeight,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="resultGrossWeight != null">
-        and
-        <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
-          "resultGrossWeight" like '%${item}%'
+        ,RESULT_GROSS_WEIGHT_TIME=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeightTime,jdbcType=TIMESTAMP}
         </foreach>
-      </if>
-      <if test="supplierName != null">
-        and
-        <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
-          "supplierName" like '%${item}%'
+        ,RESULT_TARE_WEIGHT=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeight,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="resultGrossWeightTime != null">
-        and
-        <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
-          "resultGrossWeightTime" like '%${item}%'
+        ,RESULT_TARE_WEIGHT_TIME=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeightTime,jdbcType=TIMESTAMP}
         </foreach>
-      </if>
-    </where>
-    <include refid="orderBy"></include>
-    <if test="orderField == null  ">
-      order by "resultGrossWeightTime" desc
-    </if>
-  </select>
-
-  <!--  查询所有采购的计皮实绩  -->
-    <select id="getCGAllJiPiResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
-    select *
-    from (
-      select
-      TWR.WEIGHT_TASK_RESULT_ID    "weightTaskResultId",
-      APO.PURCHASE_ORDER_NO        "purchaseOrderNo",
-      RM.MATERIAL_NAME             "materialName",
-      OO.ORDER_NUMBER              "orderNumber",
-      RC.CAPACITY_NUMBER           "capacityNumber",
-      RTC.TRUCK_CALCULATE_NUMBER   "truckCalculateNumber",
-      TWR.RESULT_GROSS_WEIGHT      "resultGrossWeight",
-      TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
-      DB.RESULT_FOREIGN_SHIP_NAME  "resultForeignShipName",
-      TWR.RESULT_TARE_WEIGHT       "resultTareWeight",
-      TWR.RESULT_TARE_WEIGHT_TIME  "resultTareWeightTime",
-      TWR.RESULT_NET_WEIGHT        "resultNetWeight",
-      TWR.RESULT_POUND_NO          "resultPoundNo"
-    from TMSTRUCK_WEIGHT_RESULT TWR
-    left join TMSTRUCK_TOTAL_RESULT TTR
-    on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-    left join OMSTRUCK_ORDER OO
-    on TTR.ORDER_ID = OO.ORDER_ID
-    left join AMS_PURCHASE_ORDER APO
-    on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
-    left join DIL_BATCH DB
-    on DB.BATCH_ID = APO.BATCH_ID
-    left join RMS_DRIVER_CAPACITY RDC
-        on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
-    left join RMS_CAPACITY RC
-    on RC.CAPACITY_ID = RDC.CAPACITY_ID
-    left join RMS_TRUCK_CALCULATE RTC
-    on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_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
-        where RESULT_TARE_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
-    )
-    <where>
-      <if test="purchaseOrderNo != null">
-        <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
-          "purchaseOrderNo" like '%${item}%'
+        ,RESULT_NET_WEIGHT=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultNetWeight,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="materialName != null">
-        and
-        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-          "materialName" like '%${item}%'
+        ,INSERT_USERNAME=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
         </foreach>
-      </if>
-      <if test="orderNumber != null">
-        and
-        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
-          "orderNumber" like '%${item}%'
+        ,INSERT_TIME=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
         </foreach>
-      </if>
-      <if test="capacityNumber != null">
-        and
-        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
-          "capacityNumber" like '%${item}%'
+        ,UPDATE_USERNAME=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
         </foreach>
-      </if>
-      <if test="truckCalculateNumber != null">
-        and
-        <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
-          "truckCalculateNumber" like '%${item}%'
+        ,UPDATE_TIME=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
         </foreach>
-      </if>
-      <if test="resultGrossWeight != null">
-        and
-        <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
-          "resultGrossWeight" like '%${item}%'
+        ,INSERT_UPDATE_REMARK=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
         </foreach>
-      </if>
-      <if test="resultForeignShipName != null">
-        and
-        <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
-          "resultForeignShipName" like '%${item}%'
+        ,DELETE_NAME=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
         </foreach>
-      </if>
-      <if test="resultGrossWeightTime != null">
-        and
-        <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
-          "resultGrossWeightTime" like '%${item}%'
+        ,DELETE_TIME=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
         </foreach>
-      </if>
-      <if test="resultTareWeight != null">
-        and
-        <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
-          "resultTareWeight" like '%${item}%'
+        ,RESULT_GROSS_PLACE_ID=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossPlaceId,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="resultPoundNo != null">
-        and
-        <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
-          "resultPoundNo" like '%${item}%'
+        ,RESULT_TARE_PLACE_ID=
+        <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID"
+                 separator=" ">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTarePlaceId,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="resultTareWeightTime != null">
-        and
-        <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
-          "resultTareWeightTime" like '%${item}%'
+        where WEIGHT_TASK_RESULT_ID in
+        <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+            #{item.weightTaskResultId,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="resultNetWeight != null">
-        and
-        <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
-          "resultNetWeight" like '%${item}%'
+    </update>
+    <delete id="batchDelete" parameterType="java.util.List">
+        delete from TMSTRUCK_WEIGHT_RESULT
+        where WEIGHT_TASK_RESULT_ID in
+        <foreach close=")" collection="list" item="id" open="(" separator=",">
+            #{id}
         </foreach>
-      </if>
-    </where>
-    <include refid="orderBy"></include>
-    <if test="orderField == null  ">
-      order by "resultTareWeightTime" desc
-    </if>
-  </select>
+    </delete>
+    <!-- 友情提示!!!-->
+    <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+    <!--  进行排序 -->
+    <sql id="orderBy">
+        <if test="orderField != null and orderField != ''">
+            order by "${orderField}"
+            <if test="orderType != null and orderType != ''">
+                ${orderType}
+            </if>
+        </if>
+    </sql>
+
+
+    <!--  通过运输订单号 查询实绩Id、总实绩ID -->
+    <select id="selectTotalIdByOrderNo" parameterType="java.lang.String" resultType="java.util.Map">
+        select OO.ORDER_ID               "orderId",
+               OO.ORDER_TYPE             "orderTypee",
+               TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
+               TWR.RESULT_GROSS_WEIGHT   "grossWeight",
+               TWR.RESULT_TARE_WEIGHT    "tareWeight",
+               TTR.RESULT_TOTAL_ID       "resultTotalId"
+        from OMSTRUCK_ORDER OO
+                 left join TMSTRUCK_TOTAL_RESULT TTR
+                           on OO.ORDER_ID = TTR.ORDER_ID
+                 left join TMSTRUCK_WEIGHT_RESULT TWR
+                           on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        where OO.ORDER_NUMBER = #{orderNumber}
+    </select>
 
-<!-- 通过订单Id查询订单下所有的物资理重及件数 -->
-  <select id="getMaterialMes" parameterType="int" resultType="java.util.Map">
-    select
-           OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
-           RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight"
-    from OMSTRUCK_ORDER OO
-    left join OMSTRUCK_ORDER_MATERIAL OOM
-    on OO.ORDER_ID = OOM.ORDER_ID
-    left join RMS_MATERIAL RM
-    on RM.MATERIAL_ID = OOM.MATERIAL_ID
-    left join RMS_MATERIAL_STEEL RMS
-    on RMS.MATERIAL_ID = RM.MATERIAL_ID
-    where OO.ORDER_ID = #{orderId}
-  </select>
+    <!--  通过汽车衡编号查询对应的汽车衡ID  -->
+    <select id="selectTruckCalculateId" parameterType="java.lang.String" resultType="int">
+        select TRUCK_CALCULATE_ID
+        from RMS_TRUCK_CALCULATE
+        where TRUCK_CALCULATE_NUMBER = #{truckCalculateNumber}
+    </select>
+
+    <!--  查询所有的采购计毛实绩  -->
+    <select id="getCGAllJiMaoResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+        select *
+        from (
+        select
+        TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
+        APO.PURCHASE_ORDER_NO "purchaseOrderNo",
+        RM.MATERIAL_NAME "materialName",
+        OO.ORDER_NUMBER "orderNumber",
+        RC.CAPACITY_NUMBER "capacityNumber",
+        RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
+        TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
+        TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
+        RS.SUPPLIER_DUTY_PARAGRAPH "supplierName",
+        RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
+        from TMSTRUCK_WEIGHT_RESULT TWR
+        left join TMSTRUCK_TOTAL_RESULT TTR
+        on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER OO
+        on TTR.ORDER_ID = OO.ORDER_ID
+        left join AMS_PURCHASE_ORDER APO
+        on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
+        left join RMS_DRIVER_CAPACITY RDC
+        on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
+        left join RMS_CAPACITY RC
+        on RC.CAPACITY_ID = RDC.CAPACITY_ID
+        left join RMS_TRUCK_CALCULATE RTC
+        on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_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_SUPPLIER RS
+        on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
+        left join RMS_CONSIGNEE RCON
+        on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
+        where RESULT_GROSS_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
+        )
+        <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="truckCalculateNumber != null">
+                and
+                <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
+                    "truckCalculateNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultGrossWeight != null">
+                and
+                <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeight" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="supplierName != null">
+                and
+                <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
+                    "supplierName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultGrossWeightTime != null">
+                and
+                <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeightTime" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderBy"></include>
+        <if test="orderField == null  ">
+            order by "resultGrossWeightTime" desc
+        </if>
+    </select>
+
+    <!--  查询所有采购的计皮实绩  -->
+    <select id="getCGAllJiPiResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+        select *
+        from (
+        select
+        TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
+        APO.PURCHASE_ORDER_NO "purchaseOrderNo",
+        RM.MATERIAL_NAME "materialName",
+        OO.ORDER_NUMBER "orderNumber",
+        RC.CAPACITY_NUMBER "capacityNumber",
+        RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
+        TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
+        TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
+        DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
+        TWR.RESULT_TARE_WEIGHT "resultTareWeight",
+        TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
+        TWR.RESULT_NET_WEIGHT "resultNetWeight",
+        TWR.RESULT_POUND_NO "resultPoundNo"
+        from TMSTRUCK_WEIGHT_RESULT TWR
+        left join TMSTRUCK_TOTAL_RESULT TTR
+        on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER OO
+        on TTR.ORDER_ID = OO.ORDER_ID
+        left join AMS_PURCHASE_ORDER APO
+        on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
+        left join DIL_BATCH DB
+        on DB.BATCH_ID = APO.BATCH_ID
+        left join RMS_DRIVER_CAPACITY RDC
+        on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
+        left join RMS_CAPACITY RC
+        on RC.CAPACITY_ID = RDC.CAPACITY_ID
+        left join RMS_TRUCK_CALCULATE RTC
+        on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_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
+        where RESULT_TARE_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
+        )
+        <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="truckCalculateNumber != null">
+                and
+                <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
+                    "truckCalculateNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultGrossWeight != null">
+                and
+                <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeight" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultForeignShipName != null">
+                and
+                <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
+                    "resultForeignShipName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultGrossWeightTime != null">
+                and
+                <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeightTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultTareWeight != null">
+                and
+                <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
+                    "resultTareWeight" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultPoundNo != null">
+                and
+                <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
+                    "resultPoundNo" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultTareWeightTime != null">
+                and
+                <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultTareWeightTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultNetWeight != null">
+                and
+                <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
+                    "resultNetWeight" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderBy"></include>
+        <if test="orderField == null  ">
+            order by "resultTareWeightTime" desc
+        </if>
+    </select>
+
+    <!-- 通过订单Id查询订单下所有的物资理重及件数 -->
+    <select id="getMaterialMes" parameterType="int" resultType="java.util.Map">
+        select OOM.ORDER_MATERIAL_NUMBER       "orderMaterialNumber",
+               RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight"
+        from OMSTRUCK_ORDER OO
+                 left join OMSTRUCK_ORDER_MATERIAL OOM
+                           on OO.ORDER_ID = OOM.ORDER_ID
+                 left join RMS_MATERIAL RM
+                           on RM.MATERIAL_ID = OOM.MATERIAL_ID
+                 left join RMS_MATERIAL_STEEL RMS
+                           on RMS.MATERIAL_ID = RM.MATERIAL_ID
+        where OO.ORDER_ID = #{orderId}
+    </select>
 
-<!-- 通过物资ID查询可计量的汽车衡 -->
+    <!-- 通过物资ID查询可计量的汽车衡 -->
     <select id="getCalculateIdByMaterial" parameterType="java.math.BigDecimal" resultType="java.lang.Integer">
-      select  RTC.TRUCK_CALCULATE_ID
-      from RMS_MATERIAL RM
-      left join RMS_TRUCK_CALCULATE_MATERIAL RTCM
-      on RM.MATERIAL_TYPE_ID = RTCM.MATERIAL_TYPE_ID
-      join RMS_TRUCK_CALCULATE RTC
-      on RTC.TRUCK_CALCULATE_ID = RTCM.TRUCK_CALCULATE_ID and RTC.TRUCK_CALCULATE_STATUS = 0
-      where RM.MATERIAL_ID = #{materialId}
+        select RTC.TRUCK_CALCULATE_ID
+        from RMS_MATERIAL RM
+                 left join RMS_TRUCK_CALCULATE_MATERIAL RTCM
+                           on RM.MATERIAL_TYPE_ID = RTCM.MATERIAL_TYPE_ID
+                 join RMS_TRUCK_CALCULATE RTC
+                      on RTC.TRUCK_CALCULATE_ID = RTCM.TRUCK_CALCULATE_ID and RTC.TRUCK_CALCULATE_STATUS = 0
+        where RM.MATERIAL_ID = #{materialId}
     </select>
 
 
-<!--计量委托查询所需数据-->
-<!--销售查询计毛 -->
-  <select id="selectMakesureGrossForSaleByOrderNumber" parameterType="java.lang.String" resultType="java.util.Map">
-    SELECT
-      OO.ORDER_NUMBER "orderNumber",
-      RC.CAPACITY_NUMBER "capacityNumber",
-      ASO.SALE_NUMBER "saleNumber",
-      RTC.TRUCK_CALCULATE_NUMBER "calcuateNumber",
-      RM.MATERIAL_NAME "materialName",
-      RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoretialWeight",
-      RS.SHIPPER_NAME "shipperName",
-      RRA.ADDRESS_DELIVERY_ADDRESS "addressDelivery"
-    FROM
-      OMSTRUCK_ORDER OO
-        LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
-        LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
-        LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
-        LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-        LEFT JOIN RMS_TRUCK_CALCULATE RTC ON TWR.RESULT_GROSS_PLACE_ID = RTC.TRUCK_CALCULATE_ID
-        LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
-        LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = OOM.MATERIAL_ID
-        LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
-        LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
-        LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON RRA.ADDRESS_ID = ASO.RECEIVE_ID
-    WHERE
-      OO.ORDER_NUMBER = #{orderNumber} and  OO.ORDER_TYPE=1
-  </select>
-<!--销售物流查询计皮作业  -->
-  <select id="selectMakesureTareForSaleByOrderNumber" resultType="java.util.Map" parameterType="java.lang.String">
-    SELECT
-      OO.ORDER_NUMBER "orderNumber",
-      RC.CAPACITY_NUMBER "capacityNumber",
-      ASO.SALE_NUMBER "saleNumber",
-      RTC.TRUCK_CALCULATE_NUMBER "calcuateNumber",
-      RM.MATERIAL_NAME "materialName",
-      RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoretialWeight",
-      RS.SHIPPER_NAME "shipperName",
-      RRA.ADDRESS_DELIVERY_ADDRESS "addressDelivery"
-    FROM
-      OMSTRUCK_ORDER OO
-        LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
-        LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
-        LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
-        LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-        LEFT JOIN RMS_TRUCK_CALCULATE RTC ON TWR.RESULT_TARE_PLACE_ID = RTC.TRUCK_CALCULATE_ID
-        LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
-        LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = OOM.MATERIAL_ID
-        LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
-        LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
-        LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON RRA.ADDRESS_ID = ASO.RECEIVE_ID
-    WHERE
-      OO.ORDER_NUMBER = #{orderNumber} and OO.ORDER_TYPE=1
-  </select>
-<!--内转物流查询计皮作业 -->
-  <select id="selectMakesureTareForConvertedByOrderNumber" resultType="java.util.Map" parameterType="java.lang.String">
-      SELECT OO.ORDER_NUMBER "orderNumber",
-             ARP.REQUIREMENT_NUMBER "requirementNumber",
-             OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
-             OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
-             RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
-             RL.LINE_START_NODE_DESC "startNode",
-             RL.LINE_END_NODE_DESC "endNode",
-             RC.CAPACITY_NUMBER "capacityNumber",
-             RTC.TRUCK_CALCULATE_NUMBER "calculateNumber"
-      FROM  OMSTRUCK_ORDER OO
-      LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
-      LEFT JOIN  AMSTRUCK_INWARD_REQUIREMENT ARP  ON ARP.REQUIREMENT_ID=OO.ORDER_PLAN_ID
-      LEFT JOIN  RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
-      LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
-      LEFT JOIN  RMS_LINE RL ON ARP.LINE_ID = RL.LINE_ID
-      LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
-      LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-      LEFT JOIN RMS_TRUCK_CALCULATE  RTC
-      ON RTC.TRUCK_CALCULATE_ID=TWR.RESULT_TARE_PLACE_ID
-    WHERE OO.ORDER_NUMBER=#{orderNumber} and OO.ORDER_TYPE=11
-  </select>
-<!-- 内转物流查询计毛作业 -->
-  <select id="selectMakesureGrossForConvertedByOrderNumber" resultType="java.util.Map" parameterType="java.lang.String">
-    SELECT OO.ORDER_NUMBER "orderNumber",
-           ARP.REQUIREMENT_NUMBER "requirementNumber",
-           OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
-           OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
-           RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
-           RL.LINE_START_NODE_DESC "startNode",
-           RL.LINE_END_NODE_DESC "endNode",
-           RC.CAPACITY_NUMBER "capacityNumber",
-           RTC.TRUCK_CALCULATE_NUMBER "calculateNumber"
-    FROM  OMSTRUCK_ORDER OO
-            LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
-            LEFT JOIN  AMSTRUCK_INWARD_REQUIREMENT ARP  ON ARP.REQUIREMENT_ID=OO.ORDER_PLAN_ID
-            LEFT JOIN  RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
-            LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
-            LEFT JOIN  RMS_LINE RL ON ARP.LINE_ID = RL.LINE_ID
-            LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
-            LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-            LEFT JOIN RMS_TRUCK_CALCULATE  RTC   ON RTC.TRUCK_CALCULATE_ID=TWR.RESULT_GROSS_PLACE_ID
-    WHERE OO.ORDER_NUMBER=#{orderNumber} and OO.ORDER_TYPE=11
-  </select>
-<!-- 采购查询计皮 -->
-  <select id="selectMakesureGrossForPurchase" parameterType="java.lang.String" resultType="java.util.Map">
-    SELECT OO.ORDER_NUMBER "orderNumber",
-           APO.PURCHASE_ORDER_NO "purchaseOrderNo",
-           OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
-           OOM.ORDER_MATERIAL_NUMBER "materialNumber",
-           RTC.TRUCK_CALCULATE_NUMBER "calculateNumber",
-           RS.SHIPPER_NAME "shipperName",
-           RRA.ADDRESS_DELIVERY_ADDRESS "deliveryAdress",
-           RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
-           RC.CAPACITY_NUMBER "capacityNumber"
-    FROM OMSTRUCK_ORDER OO
-    LEFT JOIN AMS_PURCHASE_ORDER APO
-    ON OO.ORDER_PLAN_ID=APO.PURCHASE_ORDER_ID
-    LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
-    ON OO.ORDER_ID=OOM.ORDER_ID
-    LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
-    ON OO.ORDER_ID = TTR.ORDER_ID
-    LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
-    ON TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
-    LEFT JOIN RMS_TRUCK_CALCULATE RTC
-    ON RTC.TRUCK_CALCULATE_ID=TWR.RESULT_GROSS_PLACE_ID
-    LEFT JOIN RMS_SHIPPER RS
-    ON RS.SHIPPER_ID=APO.SUPPLIER_UNIT_ID
-    LEFT JOIN RMS_RECEIVE_ADDRESS RRA
-    ON RRA.ADDRESS_ID=APO.RECEIVE_UNIT_ID
-    LEFT JOIN RMS_MATERIAL_STEEL RMS
-    ON  RMS.MATERIAL_ID=OOM.MATERIAL_ID
-    LEFT JOIN RMS_CAPACITY RC
-    ON  RC.CAPACITY_ID=OO.CAPACITY_ID
-    WHERE OO.ORDER_NUMBER=#{orderNumber}
-  </select>
-  <!-- 采购查询计皮 -->
-  <select id="selectMakesureTareForPurchase" parameterType="java.lang.String" resultType="java.util.Map">
-    SELECT OO.ORDER_NUMBER "orderNumber",
-           APO.PURCHASE_ORDER_NO "purchaseOrderNo",
-           OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
-           OOM.ORDER_MATERIAL_NUMBER "materialNumber",
-           RTC.TRUCK_CALCULATE_NUMBER "calculateNumber",
-           RS.SHIPPER_NAME "shipperName",
-           RRA.ADDRESS_DELIVERY_ADDRESS "deliveryAdress",
-           RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
-           RC.CAPACITY_NUMBER "capacityNumber"
-    FROM   OMSTRUCK_ORDER OO
-           LEFT JOIN AMS_PURCHASE_ORDER APO
-           ON OO.ORDER_PLAN_ID=APO.PURCHASE_ORDER_ID
-           LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
-           ON OO.ORDER_ID=OOM.ORDER_ID
-           LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
-           ON OO.ORDER_ID = TTR.ORDER_ID
-           LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
-           ON TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
-           LEFT JOIN RMS_TRUCK_CALCULATE RTC
-           ON RTC.TRUCK_CALCULATE_ID=TWR.RESULT_TARE_PLACE_ID
-           LEFT JOIN RMS_SHIPPER RS
-           ON RS.SHIPPER_ID=APO.SUPPLIER_UNIT_ID
-           LEFT JOIN RMS_RECEIVE_ADDRESS RRA
-           ON RRA.ADDRESS_ID=APO.RECEIVE_UNIT_ID
-           LEFT JOIN RMS_MATERIAL_STEEL RMS
-           ON  RMS.MATERIAL_ID=OOM.MATERIAL_ID
-           LEFT JOIN RMS_CAPACITY RC
-           ON  RC.CAPACITY_ID=OO.CAPACITY_ID
-    WHERE OO.ORDER_NUMBER=#{orderNumber}
-  </select>
-<!--  //通过运输订单id获取路段顺序号、物资类型、计量实绩主键、line_id
-    Map<BigDecimal, String> selectByOrderId(BigDecimal orderId);-->
+    <!--计量委托查询所需数据-->
+    <!--销售查询计毛 -->
+    <select id="selectMakesureGrossForSaleByOrderNumber" parameterType="java.lang.String" resultType="java.util.Map">
+        SELECT OO.ORDER_NUMBER                 "orderNumber",
+               RC.CAPACITY_NUMBER              "capacityNumber",
+               ASO.SALE_NUMBER                 "saleNumber",
+               RTC.TRUCK_CALCULATE_NUMBER      "calcuateNumber",
+               RM.MATERIAL_NAME                "materialName",
+               RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoretialWeight",
+               RS.SHIPPER_NAME                 "shipperName",
+               RRA.ADDRESS_DELIVERY_ADDRESS    "addressDelivery"
+        FROM OMSTRUCK_ORDER OO
+                 LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
+                 LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
+                 LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
+                 LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+                 LEFT JOIN RMS_TRUCK_CALCULATE RTC ON TWR.RESULT_GROSS_PLACE_ID = RTC.TRUCK_CALCULATE_ID
+                 LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
+                 LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = OOM.MATERIAL_ID
+                 LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
+                 LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
+                 LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON RRA.ADDRESS_ID = ASO.RECEIVE_ID
+        WHERE OO.ORDER_NUMBER = #{orderNumber}
+          and OO.ORDER_TYPE = 1
+    </select>
+    <!--销售物流查询计皮作业  -->
+    <select id="selectMakesureTareForSaleByOrderNumber" resultType="java.util.Map" parameterType="java.lang.String">
+        SELECT OO.ORDER_NUMBER                 "orderNumber",
+               RC.CAPACITY_NUMBER              "capacityNumber",
+               ASO.SALE_NUMBER                 "saleNumber",
+               RTC.TRUCK_CALCULATE_NUMBER      "calcuateNumber",
+               RM.MATERIAL_NAME                "materialName",
+               RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoretialWeight",
+               RS.SHIPPER_NAME                 "shipperName",
+               RRA.ADDRESS_DELIVERY_ADDRESS    "addressDelivery"
+        FROM OMSTRUCK_ORDER OO
+                 LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
+                 LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
+                 LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
+                 LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+                 LEFT JOIN RMS_TRUCK_CALCULATE RTC ON TWR.RESULT_TARE_PLACE_ID = RTC.TRUCK_CALCULATE_ID
+                 LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
+                 LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = OOM.MATERIAL_ID
+                 LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
+                 LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
+                 LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON RRA.ADDRESS_ID = ASO.RECEIVE_ID
+        WHERE OO.ORDER_NUMBER = #{orderNumber}
+          and OO.ORDER_TYPE = 1
+    </select>
+    <!--内转物流查询计皮作业 -->
+    <select id="selectMakesureTareForConvertedByOrderNumber" resultType="java.util.Map"
+            parameterType="java.lang.String">
+        SELECT OO.ORDER_NUMBER                 "orderNumber",
+               ARP.REQUIREMENT_NUMBER          "requirementNumber",
+               OOM.ORDER_MATERIAL_NUMBER       "orderMaterialNumber",
+               OOM.ORDER_MATERIAL_WEIGHT       "materialWeight",
+               RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
+               RL.LINE_START_NODE_DESC         "startNode",
+               RL.LINE_END_NODE_DESC           "endNode",
+               RC.CAPACITY_NUMBER              "capacityNumber",
+               RTC.TRUCK_CALCULATE_NUMBER      "calculateNumber"
+        FROM OMSTRUCK_ORDER OO
+                 LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
+                 LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT ARP ON ARP.REQUIREMENT_ID = OO.ORDER_PLAN_ID
+                 LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
+                 LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
+                 LEFT JOIN RMS_LINE RL ON ARP.LINE_ID = RL.LINE_ID
+                 LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
+                 LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+                 LEFT JOIN RMS_TRUCK_CALCULATE RTC
+                           ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
+        WHERE OO.ORDER_NUMBER = #{orderNumber}
+          and OO.ORDER_TYPE = 11
+    </select>
+    <!-- 内转物流查询计毛作业 -->
+    <select id="selectMakesureGrossForConvertedByOrderNumber" resultType="java.util.Map"
+            parameterType="java.lang.String">
+        SELECT OO.ORDER_NUMBER                 "orderNumber",
+               ARP.REQUIREMENT_NUMBER          "requirementNumber",
+               OOM.ORDER_MATERIAL_NUMBER       "orderMaterialNumber",
+               OOM.ORDER_MATERIAL_WEIGHT       "materialWeight",
+               RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
+               RL.LINE_START_NODE_DESC         "startNode",
+               RL.LINE_END_NODE_DESC           "endNode",
+               RC.CAPACITY_NUMBER              "capacityNumber",
+               RTC.TRUCK_CALCULATE_NUMBER      "calculateNumber"
+        FROM OMSTRUCK_ORDER OO
+                 LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
+                 LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT ARP ON ARP.REQUIREMENT_ID = OO.ORDER_PLAN_ID
+                 LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
+                 LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
+                 LEFT JOIN RMS_LINE RL ON ARP.LINE_ID = RL.LINE_ID
+                 LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
+                 LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+                 LEFT JOIN RMS_TRUCK_CALCULATE RTC ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
+        WHERE OO.ORDER_NUMBER = #{orderNumber}
+          and OO.ORDER_TYPE = 11
+    </select>
+    <!-- 采购查询计皮 -->
+    <select id="selectMakesureGrossForPurchase" parameterType="java.lang.String" resultType="java.util.Map">
+        SELECT OO.ORDER_NUMBER                 "orderNumber",
+               APO.PURCHASE_ORDER_NO           "purchaseOrderNo",
+               OOM.ORDER_MATERIAL_WEIGHT       "materialWeight",
+               OOM.ORDER_MATERIAL_NUMBER       "materialNumber",
+               RTC.TRUCK_CALCULATE_NUMBER      "calculateNumber",
+               RS.SHIPPER_NAME                 "shipperName",
+               RRA.ADDRESS_DELIVERY_ADDRESS    "deliveryAdress",
+               RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
+               RC.CAPACITY_NUMBER              "capacityNumber"
+        FROM OMSTRUCK_ORDER OO
+                 LEFT JOIN AMS_PURCHASE_ORDER APO
+                           ON OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
+                 LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
+                           ON OO.ORDER_ID = OOM.ORDER_ID
+                 LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+                           ON OO.ORDER_ID = TTR.ORDER_ID
+                 LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
+                           ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+                 LEFT JOIN RMS_TRUCK_CALCULATE RTC
+                           ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
+                 LEFT JOIN RMS_SHIPPER RS
+                           ON RS.SHIPPER_ID = APO.SUPPLIER_UNIT_ID
+                 LEFT JOIN RMS_RECEIVE_ADDRESS RRA
+                           ON RRA.ADDRESS_ID = APO.RECEIVE_UNIT_ID
+                 LEFT JOIN RMS_MATERIAL_STEEL RMS
+                           ON RMS.MATERIAL_ID = OOM.MATERIAL_ID
+                 LEFT JOIN RMS_CAPACITY RC
+                           ON RC.CAPACITY_ID = OO.CAPACITY_ID
+        WHERE OO.ORDER_NUMBER = #{orderNumber}
+    </select>
+    <!-- 采购查询计皮 -->
+    <select id="selectMakesureTareForPurchase" parameterType="java.lang.String" resultType="java.util.Map">
+        SELECT OO.ORDER_NUMBER                 "orderNumber",
+               APO.PURCHASE_ORDER_NO           "purchaseOrderNo",
+               OOM.ORDER_MATERIAL_WEIGHT       "materialWeight",
+               OOM.ORDER_MATERIAL_NUMBER       "materialNumber",
+               RTC.TRUCK_CALCULATE_NUMBER      "calculateNumber",
+               RS.SHIPPER_NAME                 "shipperName",
+               RRA.ADDRESS_DELIVERY_ADDRESS    "deliveryAdress",
+               RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
+               RC.CAPACITY_NUMBER              "capacityNumber"
+        FROM OMSTRUCK_ORDER OO
+                 LEFT JOIN AMS_PURCHASE_ORDER APO
+                           ON OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
+                 LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
+                           ON OO.ORDER_ID = OOM.ORDER_ID
+                 LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+                           ON OO.ORDER_ID = TTR.ORDER_ID
+                 LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
+                           ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+                 LEFT JOIN RMS_TRUCK_CALCULATE RTC
+                           ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
+                 LEFT JOIN RMS_SHIPPER RS
+                           ON RS.SHIPPER_ID = APO.SUPPLIER_UNIT_ID
+                 LEFT JOIN RMS_RECEIVE_ADDRESS RRA
+                           ON RRA.ADDRESS_ID = APO.RECEIVE_UNIT_ID
+                 LEFT JOIN RMS_MATERIAL_STEEL RMS
+                           ON RMS.MATERIAL_ID = OOM.MATERIAL_ID
+                 LEFT JOIN RMS_CAPACITY RC
+                           ON RC.CAPACITY_ID = OO.CAPACITY_ID
+        WHERE OO.ORDER_NUMBER = #{orderNumber}
+    </select>
+    <!--  //通过运输订单id获取路段顺序号、物资类型、计量实绩主键、line_id
+        Map<BigDecimal, String> selectByOrderId(BigDecimal orderId);-->
     <select id="selectByOrderId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
-      select oo.ORDER_LINE_SEQUENCE as "orderLineSequence",
-             oo.LINE_ID as "lineId",
-             rm.material_type_id as "materialTypeId",
-             twr.weight_task_result_id as "weightTaskResultId"
+        select oo.ORDER_LINE_SEQUENCE    as "orderLineSequence",
+               oo.LINE_ID                as "lineId",
+               rm.material_type_id       as "materialTypeId",
+               twr.weight_task_result_id as "weightTaskResultId"
         from omstruck_order oo
-             join omstruck_order_material oom on oom.order_id=oo.order_id
-             left join rms_material rm on oom.material_id=rm.material_id
-             left join tmstruck_total_result ttr on oo.order_id=ttr.order_id
-             left join tmstruck_weight_result twr on ttr.result_total_id=twr.result_total_id
-      where oo.order_id=#{orderId} and rownum=1 order by twr.weight_task_result_id desc
+                 join omstruck_order_material oom on oom.order_id = oo.order_id
+                 left join rms_material rm on oom.material_id = rm.material_id
+                 left join tmstruck_total_result ttr on oo.order_id = ttr.order_id
+                 left join tmstruck_weight_result twr on ttr.result_total_id = twr.result_total_id
+        where oo.order_id = #{orderId}
+          and rownum = 1
+        order by twr.weight_task_result_id desc
     </select>
 
-<!--  * 通过物料、性质判断所去的汽车衡-->
-  <select id="getTruckCalculateNumber" resultType="java.math.BigDecimal">
-    select rtc.truck_calculate_id from rms_truck_calculate_material rtcm
-                                         left join rms_truck_calculate rtc on rtcm.truck_calculate_id=rtc.truck_calculate_id
-    where rtcm.material_type_id=#{materialTypeId} and rtc.nature=#{nature} and rownum=1 order by rtc.truck_calculate_priority
-  </select>
+    <!--  * 通过物料、性质判断所去的汽车衡-->
+    <select id="getTruckCalculateNumber" resultType="java.math.BigDecimal">
+        select rtc.truck_calculate_id
+        from rms_truck_calculate_material rtcm
+                 left join rms_truck_calculate rtc on rtcm.truck_calculate_id = rtc.truck_calculate_id
+        where rtcm.material_type_id = #{materialTypeId}
+          and rtc.nature = #{nature}
+          and rownum = 1
+        order by rtc.truck_calculate_priority
+    </select>
 
-  <!--    //返回下一步路段顺序号对应的终点type
-    BigDecimal getNextStep(BigDecimal lineId, int i);-->
-  <select id="getNextStep"  resultType="java.math.BigDecimal">
-    select rls.segment_end_node_type
-    from rms_line_segemnt rls
-    where rls.line_id = #{lineId}
-      and rls.segment_sqe = #{orderLineSequence}
-    union
-    select rls.segment_end_node_type
-    from rms_line_segemnt rls
-    where rls.line_id = 1
-      and rls.segment_sqe = #{orderLineSequence}+1
-    union
-    select rls.segment_end_node_type
-    from rms_line_segemnt rls
-    where rls.line_id = 1
-      and rls.segment_sqe = #{orderLineSequence}+2
+    <!--    //返回下一步路段顺序号对应的终点type
+      BigDecimal getNextStep(BigDecimal lineId, int i);-->
+    <select id="getNextStep" resultType="java.math.BigDecimal">
+        select rls.segment_end_node_type
+        from rms_line_segemnt rls
+        where rls.line_id = #{lineId}
+          and rls.segment_sqe = #{orderLineSequence}
+        union
+        select rls.segment_end_node_type
+        from rms_line_segemnt rls
+        where rls.line_id = 1
+          and rls.segment_sqe = #{orderLineSequence} + 1
+        union
+        select rls.segment_end_node_type
+        from rms_line_segemnt rls
+        where rls.line_id = 1
+          and rls.segment_sqe = #{orderLineSequence} + 2
 
-  </select>
+    </select>
 
-<!-- 查询销售所有计皮实绩 -->
-  <select id="getXSAllJiPiResult" parameterType="java.util.Map" resultType="java.util.Map">
-    select *
-    from (
-    select
-    TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
-    ASO.SALE_NUMBER "saleNumber",
-    RM.MATERIAL_NAME "materialName",
-    OO.ORDER_NUMBER "orderNumber",
-    RC.CAPACITY_NUMBER "capacityNumber",
-    RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
-    OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
-    RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
-    TWR.RESULT_TARE_WEIGHT "resultTareWeight",
-    TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
-    TWR.RESULT_POUND_NO "resultPoundNo",
-    RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
-    RS.SHIPPER_NAME            "shipperName"
+    <!-- 查询销售所有计皮实绩 -->
+    <select id="getXSAllJiPiResult" parameterType="java.util.Map" resultType="java.util.Map">
+        select *
+        from (
+        select
+        TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
+        ASO.SALE_NUMBER "saleNumber",
+        RM.MATERIAL_NAME "materialName",
+        OO.ORDER_NUMBER "orderNumber",
+        RC.CAPACITY_NUMBER "capacityNumber",
+        RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
+        OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
+        RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
+        TWR.RESULT_TARE_WEIGHT "resultTareWeight",
+        TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
+        TWR.RESULT_POUND_NO "resultPoundNo",
+        RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+        RS.SHIPPER_NAME "shipperName"
 
-    from TMSTRUCK_WEIGHT_RESULT TWR
-    left join TMSTRUCK_TOTAL_RESULT TTR
-    on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-    left join OMSTRUCK_ORDER OO
-    on TTR.ORDER_ID = OO.ORDER_ID
-    left join AMS_SALE_ORDER ASO
-    on ASO.SALE_ORDER_ID = OO.ORDER_PLAN_ID
-    left join RMS_DRIVER_CAPACITY RDC
-    on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
-    left join RMS_CAPACITY RC
-    on RC.CAPACITY_ID = RDC.CAPACITY_ID
-    left join RMS_TRUCK_CALCULATE RTC
-    on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
-    left join OMSTRUCK_ORDER_MATERIAL OOM
-    on OOM.ORDER_ID = OO.ORDER_ID
-    left join RMS_MATERIAL_STEEL RMS
-    on OOM.MATERIAL_ID = RMS.MATERIAL_STEEL_ID
-    left join RMS_MATERIAL RM
-    on RM.MATERIAL_ID = RMS.MATERIAL_ID
-    left join RMS_SHIPPER RS
-    on RS.SHIPPER_ID = ASO.SHIPPER_ID
-    left join RMS_CONSIGNEE RCON
-    on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
+        from TMSTRUCK_WEIGHT_RESULT TWR
+        left join TMSTRUCK_TOTAL_RESULT TTR
+        on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER OO
+        on TTR.ORDER_ID = OO.ORDER_ID
+        left join AMS_SALE_ORDER ASO
+        on ASO.SALE_ORDER_ID = OO.ORDER_PLAN_ID
+        left join RMS_DRIVER_CAPACITY RDC
+        on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
+        left join RMS_CAPACITY RC
+        on RC.CAPACITY_ID = RDC.CAPACITY_ID
+        left join RMS_TRUCK_CALCULATE RTC
+        on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
+        left join OMSTRUCK_ORDER_MATERIAL OOM
+        on OOM.ORDER_ID = OO.ORDER_ID
+        left join RMS_MATERIAL_STEEL RMS
+        on OOM.MATERIAL_ID = RMS.MATERIAL_STEEL_ID
+        left join RMS_MATERIAL RM
+        on RM.MATERIAL_ID = RMS.MATERIAL_ID
+        left join RMS_SHIPPER RS
+        on RS.SHIPPER_ID = ASO.SHIPPER_ID
+        left join RMS_CONSIGNEE RCON
+        on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
 
-    where RESULT_TARE_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
-    )
-    <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="truckCalculateNumber != null">
-        and
-        <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
-          "truckCalculateNumber" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultGrossWeight != null">
-        and
-        <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
-          "resultGrossWeight" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultForeignShipName != null">
-        and
-        <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
-          "resultForeignShipName" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultGrossWeightTime != null">
-        and
-        <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
-          "resultGrossWeightTime" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultTareWeight != null">
-        and
-        <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
-          "resultTareWeight" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultPoundNo != null">
-        and
-        <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
-          "resultPoundNo" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultTareWeightTime != null">
-        and
-        <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
-          "resultTareWeightTime" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultNetWeight != null">
-        and
-        <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
-          "resultNetWeight" like '%${item}%'
-        </foreach>
-      </if>
-    </where>
-    <include refid="orderBy"></include>
-    <if test="orderField == null  ">
-      order by "resultTareWeightTime" desc
-    </if>
-  </select>
+        where RESULT_TARE_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
+        )
+        <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="truckCalculateNumber != null">
+                and
+                <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
+                    "truckCalculateNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultGrossWeight != null">
+                and
+                <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeight" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultForeignShipName != null">
+                and
+                <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
+                    "resultForeignShipName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultGrossWeightTime != null">
+                and
+                <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeightTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultTareWeight != null">
+                and
+                <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
+                    "resultTareWeight" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultPoundNo != null">
+                and
+                <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
+                    "resultPoundNo" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultTareWeightTime != null">
+                and
+                <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultTareWeightTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultNetWeight != null">
+                and
+                <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
+                    "resultNetWeight" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderBy"></include>
+        <if test="orderField == null  ">
+            order by "resultTareWeightTime" desc
+        </if>
+    </select>
 
-<!-- 查询销售计毛实绩 -->
-  <select id="getXSAllJiMaoResult" parameterType="java.util.Map" resultType="java.util.Map">
-    select *
-    from (
-    select
-    TWR.WEIGHT_TASK_RESULT_ID    "weightTaskResultId",
-    ASO.SALE_NUMBER              "saleNumber",
-    RM.MATERIAL_NAME             "materialName",
-    OO.ORDER_NUMBER              "orderNumber",
-    RC.CAPACITY_NUMBER           "capacityNumber",
-    RTC.TRUCK_CALCULATE_NUMBER   "truckCalculateNumber",
-    TWR.RESULT_GROSS_WEIGHT      "resultGrossWeight",
-    TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
-           OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
-           TWR.RESULT_TARE_WEIGHT "resultTareWeight",
-           TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
-           TWR.RESULT_NET_WEIGHT "resultNetWeight",
-           TWR.RESULT_POUND_NO "resultPoundNo",
-           TWR.INSERT_UPDATE_REMARK "insertUpdateRemark",
-           RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
-    RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
-    RS.SHIPPER_NAME            "shipperName"
-    from TMSTRUCK_WEIGHT_RESULT TWR
-    left join TMSTRUCK_TOTAL_RESULT TTR
-    on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
-    left join OMSTRUCK_ORDER OO
-    on TTR.ORDER_ID = OO.ORDER_ID
-    left join AMS_SALE_ORDER ASO
-    on ASO.SALE_ORDER_ID = OO.ORDER_PLAN_ID
-    left join RMS_DRIVER_CAPACITY RDC
-    on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
-    left join RMS_CAPACITY RC
-    on RC.CAPACITY_ID = RDC.CAPACITY_ID
-    left join RMS_TRUCK_CALCULATE RTC
-    on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
-    left join OMSTRUCK_ORDER_MATERIAL OOM
-    on OOM.ORDER_ID = OO.ORDER_ID
-    left join RMS_MATERIAL_STEEL RMS
-    on RMS.MATERIAL_STEEL_ID = OOM.MATERIAL_ID
-    left join RMS_MATERIAL RM
-    on RM.MATERIAL_ID = RMS.MATERIAL_ID
-    left join RMS_SHIPPER RS
-    on RS.SHIPPER_ID = ASO.SHIPPER_ID
-    left join RMS_CONSIGNEE RCON
-    on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
-    where RESULT_GROSS_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
-    )
-    <where>
-      <if test="saleNumber != null">
-        <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
-          "saleNumber" 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="resultTareWeight != null">
-        and
-        <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
-          "resultTareWeight" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultPoundNo != null">
-        and
-        <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
-          "resultPoundNo" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultTareWeightTime != null">
-        and
-        <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
-          "resultTareWeightTime" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultNetWeight != null">
-        and
-        <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
-          "resultNetWeight" 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="consigneeCompanyName != null">
-        and
-        <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
-          "consigneeCompanyName" 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="truckCalculateNumber != null">
-        and
-        <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
-          "truckCalculateNumber" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultGrossWeight != null">
-        and
-        <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
-          "resultGrossWeight" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="shipperName != null">
-        and
-        <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
-          "shipperName" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultGrossWeightTime != null">
-        and
-        <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
-          "resultGrossWeightTime" like '%${item}%'
-        </foreach>
-      </if>
-    </where>
-    <include refid="orderBy"></include>
-    <if test="orderField == null  ">
-      order by "resultGrossWeightTime" desc
-    </if>
-  </select>
+    <!-- 查询销售计毛实绩 -->
+    <select id="getXSAllJiMaoResult" parameterType="java.util.Map" resultType="java.util.Map">
+        select *
+        from (
+        select
+        TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
+        ASO.SALE_NUMBER "saleNumber",
+        RM.MATERIAL_NAME "materialName",
+        OO.ORDER_NUMBER "orderNumber",
+        RC.CAPACITY_NUMBER "capacityNumber",
+        RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
+        TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
+        TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
+        OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
+        TWR.RESULT_TARE_WEIGHT "resultTareWeight",
+        TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
+        TWR.RESULT_NET_WEIGHT "resultNetWeight",
+        TWR.RESULT_POUND_NO "resultPoundNo",
+        TWR.INSERT_UPDATE_REMARK "insertUpdateRemark",
+        RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
+        RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+        RS.SHIPPER_NAME "shipperName"
+        from TMSTRUCK_WEIGHT_RESULT TWR
+        left join TMSTRUCK_TOTAL_RESULT TTR
+        on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        left join OMSTRUCK_ORDER OO
+        on TTR.ORDER_ID = OO.ORDER_ID
+        left join AMS_SALE_ORDER ASO
+        on ASO.SALE_ORDER_ID = OO.ORDER_PLAN_ID
+        left join RMS_DRIVER_CAPACITY RDC
+        on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
+        left join RMS_CAPACITY RC
+        on RC.CAPACITY_ID = RDC.CAPACITY_ID
+        left join RMS_TRUCK_CALCULATE RTC
+        on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
+        left join OMSTRUCK_ORDER_MATERIAL OOM
+        on OOM.ORDER_ID = OO.ORDER_ID
+        left join RMS_MATERIAL_STEEL RMS
+        on RMS.MATERIAL_STEEL_ID = OOM.MATERIAL_ID
+        left join RMS_MATERIAL RM
+        on RM.MATERIAL_ID = RMS.MATERIAL_ID
+        left join RMS_SHIPPER RS
+        on RS.SHIPPER_ID = ASO.SHIPPER_ID
+        left join RMS_CONSIGNEE RCON
+        on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
+        where RESULT_GROSS_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
+        )
+        <where>
+            <if test="saleNumber != null">
+                <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
+                    "saleNumber" 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="resultTareWeight != null">
+                and
+                <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
+                    "resultTareWeight" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultPoundNo != null">
+                and
+                <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
+                    "resultPoundNo" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultTareWeightTime != null">
+                and
+                <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultTareWeightTime" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultNetWeight != null">
+                and
+                <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
+                    "resultNetWeight" 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="consigneeCompanyName != null">
+                and
+                <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
+                    "consigneeCompanyName" 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="truckCalculateNumber != null">
+                and
+                <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
+                    "truckCalculateNumber" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultGrossWeight != null">
+                and
+                <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeight" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="shipperName != null">
+                and
+                <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
+                    "shipperName" like '%${item}%'
+                </foreach>
+            </if>
+            <if test="resultGrossWeightTime != null">
+                and
+                <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
+                    "resultGrossWeightTime" like '%${item}%'
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderBy"></include>
+        <if test="orderField == null  ">
+            order by "resultGrossWeightTime" desc
+        </if>
+    </select>
 
 </mapper>