Prechádzať zdrojové kódy

'收获客户权限'

HUJIANGUO 3 rokov pred
rodič
commit
46b0db1972

+ 0 - 32
src/main/java/com/steerinfo/dil/mapper/TmstruckReceiptResultMapper.java

@@ -1,32 +0,0 @@
-package com.steerinfo.dil.mapper;
-
-import com.steerinfo.dil.model.TmstruckReceiptResult;
-import com.steerinfo.framework.mapper.IBaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Select;
-
-import java.math.BigDecimal;
-import java.util.List;
-import java.util.Map;
-
-@Mapper
-public interface TmstruckReceiptResultMapper extends IBaseMapper<TmstruckReceiptResult, BigDecimal> {
-    //查询最大ID值
-    @Select("select seq_tmstruck_receipt.nextval from dual")
-    BigDecimal selectMaxId();
-
-    //通过总实绩Id查询主键Id
-    BigDecimal getIdByTotalResultId(Integer totalResultId);
-
-    //计皮完成后 通过总实绩ID 更新状态 为 1
-    int updateByTotalResultId(TmstruckReceiptResult tmstruckReceiptResult);
-
-    //查询所有收货实绩
-    List<Map<String, Object>> getCGReceiptResult(Map<String, Object> map);
-
-    //查询内转钢材到异地库收货实绩
-    List<Map<String, Object>> getSteelNzReceiptResult(Map<String, Object> map);
-
-    //获取内转收货实绩
-    List<Map<String, Object>> getInwardReceipt(Map<String, Object> map);
-}

+ 19 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckReceiveResultMapper.java

@@ -0,0 +1,19 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.TmstruckReceiveResult;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.math.BigDecimal;
+
+
+@Mapper
+public interface TmstruckReceiveResultMapper extends IBaseMapper<TmstruckReceiveResult, BigDecimal> {
+
+    //通过总实绩Id查询主键Id
+    BigDecimal getReceiveResult(BigDecimal totalResultId);
+
+    //计皮完成后 通过总实绩ID 更新状态 为 1
+    int updateByTotalResultId(TmstruckReceiveResult tmstruckReceiveResult);
+
+}

+ 38 - 68
src/main/java/com/steerinfo/dil/model/TmstruckReceiptResult.java → src/main/java/com/steerinfo/dil/model/TmstruckReceiveResult.java

@@ -7,25 +7,31 @@ import io.swagger.annotations.ApiModelProperty;
 import java.math.BigDecimal;
 import java.util.Date;
 
-@ApiModel(value="收实绩")
-public class TmstruckReceiptResult implements IBasePO<BigDecimal> {
+@ApiModel(value="收实绩")
+public class TmstruckReceiveResult implements IBasePO<BigDecimal> {
     /**
-     * 主键ID(RESULT_ID,DECIMAL,38)
+     * 主键id(RESULT_RECEIVE_ID,DECIMAL,0)
      */
-    @ApiModelProperty(value="主键ID",required=true)
-    private BigDecimal resultId;
+    @ApiModelProperty(value="主键id",required=true)
+    private BigDecimal resultReceiveId;
 
     /**
-     * 总实绩ID(RESULT_TOTAL_ID,DECIMAL,38)
+     * 实绩总表id(RESULT_TOTAL_ID,DECIMAL,0)
      */
-    @ApiModelProperty(value="总实绩ID",required=false)
+    @ApiModelProperty(value="实绩总表id",required=false)
     private BigDecimal resultTotalId;
 
     /**
-     * 异地库ID(WAREHOUSE_ID,DECIMAL,38)
+     * 签收时间(RESULT_RECEIVE_TIME,TIMESTAMP,7)
      */
-    @ApiModelProperty(value="异地库ID",required=false)
-    private BigDecimal warehouseId;
+    @ApiModelProperty(value="签收时间",required=false)
+    private Date resultReceiveTime;
+
+    /**
+     * 签收人id(RECEIVE_SINGER_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="签收人id",required=false)
+    private BigDecimal receiveSingerId;
 
     /**
      * 记录创建人(INSERT_USERNAME,VARCHAR,20)
@@ -63,42 +69,24 @@ public class TmstruckReceiptResult implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="状态:0 为卸货后新增虚拟收货实绩  1 为计皮完成后真实收货实绩",required=false)
     private BigDecimal status;
 
-    /**
-     * 空货箱照片(RESULT_EMPTY_CONTAINER_PHOTO,BLOB,4000)
-     */
-    @ApiModelProperty(value="空货箱照片",required=false)
-    private byte[] resultEmptyContainerPhoto;
-
-    /**
-     * 已签字的送货单照片(RESULT_SIGNED_NOTE_PHOTO,BLOB,4000)
-     */
-    @ApiModelProperty(value="已签字的送货单照片",required=false)
-    private byte[] resultSignedNotePhoto;
-
-    /**
-     * 客户签收单照片(RESULT_RECEIVE_NOTE_PHOTO,BLOB,4000)
-     */
-    @ApiModelProperty(value="客户签收单照片",required=false)
-    private byte[] resultReceiveNotePhoto;
-
     private static final long serialVersionUID = 1L;
 
     @Override
     public BigDecimal getId() {
-        return this.resultId;
+        return this.resultReceiveId;
     }
 
     @Override
-    public void setId(BigDecimal resultId) {
-        this.resultId = resultId;
+    public void setId(BigDecimal resultReceiveId) {
+        this.resultReceiveId = resultReceiveId;
     }
 
-    public BigDecimal getResultId() {
-        return resultId;
+    public BigDecimal getResultReceiveId() {
+        return resultReceiveId;
     }
 
-    public void setResultId(BigDecimal resultId) {
-        this.resultId = resultId;
+    public void setResultReceiveId(BigDecimal resultReceiveId) {
+        this.resultReceiveId = resultReceiveId;
     }
 
     public BigDecimal getResultTotalId() {
@@ -109,12 +97,20 @@ public class TmstruckReceiptResult implements IBasePO<BigDecimal> {
         this.resultTotalId = resultTotalId;
     }
 
-    public BigDecimal getWarehouseId() {
-        return warehouseId;
+    public Date getResultReceiveTime() {
+        return resultReceiveTime;
+    }
+
+    public void setResultReceiveTime(Date resultReceiveTime) {
+        this.resultReceiveTime = resultReceiveTime;
     }
 
-    public void setWarehouseId(BigDecimal warehouseId) {
-        this.warehouseId = warehouseId;
+    public BigDecimal getReceiveSingerId() {
+        return receiveSingerId;
+    }
+
+    public void setReceiveSingerId(BigDecimal receiveSingerId) {
+        this.receiveSingerId = receiveSingerId;
     }
 
     public String getInsertUsername() {
@@ -165,48 +161,22 @@ public class TmstruckReceiptResult implements IBasePO<BigDecimal> {
         this.status = status;
     }
 
-    public byte[] getResultEmptyContainerPhoto() {
-        return resultEmptyContainerPhoto;
-    }
-
-    public void setResultEmptyContainerPhoto(byte[] resultEmptyContainerPhoto) {
-        this.resultEmptyContainerPhoto = resultEmptyContainerPhoto;
-    }
-
-    public byte[] getResultSignedNotePhoto() {
-        return resultSignedNotePhoto;
-    }
-
-    public void setResultSignedNotePhoto(byte[] resultSignedNotePhoto) {
-        this.resultSignedNotePhoto = resultSignedNotePhoto;
-    }
-
-    public byte[] getResultReceiveNotePhoto() {
-        return resultReceiveNotePhoto;
-    }
-
-    public void setResultReceiveNotePhoto(byte[] resultReceiveNotePhoto) {
-        this.resultReceiveNotePhoto = resultReceiveNotePhoto;
-    }
-
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append(getClass().getSimpleName());
         sb.append(" [");
         sb.append("Hash = ").append(hashCode());
-        sb.append(", resultId=").append(resultId);
+        sb.append(", resultReceiveId=").append(resultReceiveId);
         sb.append(", resultTotalId=").append(resultTotalId);
-        sb.append(", warehouseId=").append(warehouseId);
+        sb.append(", resultReceiveTime=").append(resultReceiveTime);
+        sb.append(", receiveSingerId=").append(receiveSingerId);
         sb.append(", insertUsername=").append(insertUsername);
         sb.append(", insertTime=").append(insertTime);
         sb.append(", updateUsername=").append(updateUsername);
         sb.append(", updateTime=").append(updateTime);
         sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
         sb.append(", status=").append(status);
-        sb.append(", resultEmptyContainerPhoto=").append(resultEmptyContainerPhoto);
-        sb.append(", resultSignedNotePhoto=").append(resultSignedNotePhoto);
-        sb.append(", resultReceiveNotePhoto=").append(resultReceiveNotePhoto);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 10 - 12
src/main/java/com/steerinfo/dil/service/impl/TmstruckWeightResultServiceImpl.java

@@ -3,13 +3,10 @@ package com.steerinfo.dil.service.impl;
 import com.steerinfo.dil.feign.BmsTruckFeign;
 import com.steerinfo.dil.feign.OmsFeign;
 import com.steerinfo.dil.feign.TmstruckFeign;
-import com.steerinfo.dil.mapper.TmstrainWeightResultMapper;
-import com.steerinfo.dil.mapper.TmstruckReceiptResultMapper;
-import com.steerinfo.dil.mapper.UtilsMapper;
+import com.steerinfo.dil.mapper.*;
 import com.steerinfo.dil.model.TmstrainWeightResult;
-import com.steerinfo.dil.model.TmstruckReceiptResult;
+import com.steerinfo.dil.model.TmstruckReceiveResult;
 import com.steerinfo.dil.model.TmstruckWeightResult;
-import com.steerinfo.dil.mapper.TmstruckWeightResultMapper;
 import com.steerinfo.dil.service.ITmstruckWeightResultService;
 import com.steerinfo.dil.util.DataChange;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -56,7 +53,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
     TmstruckFeign tmstruckFeign;
 
     @Autowired
-    TmstruckReceiptResultMapper tmstruckReceiptResultMapper;
+    TmstruckReceiveResultMapper tmstruckReceiveResultMapper;
 
     @Autowired
     TmstrainWeightResultMapper tmstrainWeightResultMapper;
@@ -372,13 +369,13 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
      * @return
      */
     public void autoReceipt(String orderNumber, Object tareWeightTime){
-        TmstruckReceiptResult tmstruckReceiptResult = new TmstruckReceiptResult();
+        TmstruckReceiveResult tmstruckReceiveResult = new TmstruckReceiveResult();
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         //通过运输订单号查询总实绩ID
         BigDecimal resultTotalId = utilsMapper.getTotalIdByOrderNumber(orderNumber);
-        tmstruckReceiptResult.setResultTotalId(resultTotalId);
-        tmstruckReceiptResult.setStatus(new BigDecimal(1));
-        tmstruckReceiptResult.setInsertUsername("admin");
+        tmstruckReceiveResult.setResultTotalId(resultTotalId);
+        tmstruckReceiveResult.setStatus(new BigDecimal(1));
+        tmstruckReceiveResult.setInsertUsername("admin");
         Date receiptTime;
         try {
             //取皮重时间为收货时间
@@ -387,8 +384,9 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
             receiptTime = new Date();
             System.out.println(e.getMessage());
         }
-        tmstruckReceiptResult.setInsertTime(receiptTime);
-        int i = tmstruckReceiptResultMapper.updateByTotalResultId(tmstruckReceiptResult);
+        tmstruckReceiveResult.setInsertTime(receiptTime);
+        tmstruckReceiveResult.setUpdateTime(receiptTime);
+        int i = tmstruckReceiveResultMapper.updateByTotalResultId(tmstruckReceiveResult);
         if(i == 1) {
             System.out.println(orderNumber + "收货成功");
         }else {

+ 0 - 715
src/main/resources/com/steerinfo/dil/mapper/TmstruckReceiptResultMapper.xml

@@ -1,715 +0,0 @@
-<?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.TmstruckReceiptResultMapper">
-  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckReceiptResult">
-    <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
-    <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
-    <result column="WAREHOUSE_ID" jdbcType="DECIMAL" property="warehouseId" />
-    <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_EMPTY_CONTAINER_PHOTO" jdbcType="BLOB" property="resultEmptyContainerPhoto" />
-    <result column="RESULT_SIGNED_NOTE_PHOTO" jdbcType="BLOB" property="resultSignedNotePhoto" />
-    <result column="RESULT_RECEIVE_NOTE_PHOTO" jdbcType="BLOB" property="resultReceiveNotePhoto" />
-  </resultMap>
-  <sql id="columns">
-    RESULT_ID, RESULT_TOTAL_ID, WAREHOUSE_ID, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
-    UPDATE_TIME, INSERT_UPDATE_REMARK, STATUS, RESULT_EMPTY_CONTAINER_PHOTO, RESULT_SIGNED_NOTE_PHOTO, 
-    RESULT_RECEIVE_NOTE_PHOTO
-  </sql>
-  <sql id="columns_alias">
-    t.RESULT_ID, t.RESULT_TOTAL_ID, t.WAREHOUSE_ID, t.INSERT_USERNAME, t.INSERT_TIME, 
-    t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.STATUS, t.RESULT_EMPTY_CONTAINER_PHOTO, 
-    t.RESULT_SIGNED_NOTE_PHOTO, t.RESULT_RECEIVE_NOTE_PHOTO
-  </sql>
-  <sql id="select">
-    SELECT <include refid="columns"/> FROM TMSTRUCK_RECEIPT_RESULT
-  </sql>
-  <sql id="select_alias">
-    SELECT <include refid="columns_alias"/> FROM TMSTRUCK_RECEIPT_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="warehouseId != null">
-        and WAREHOUSE_ID = #{warehouseId}
-      </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="resultEmptyContainerPhoto != null">
-        and RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
-      </if>
-      <if test="resultSignedNotePhoto != null">
-        and RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
-      </if>
-      <if test="resultReceiveNotePhoto != null">
-        and RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
-      </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="warehouseId != null">
-        and WAREHOUSE_ID = #{warehouseId}
-      </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="resultEmptyContainerPhoto != null">
-        and RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
-      </if>
-      <if test="resultSignedNotePhoto != null">
-        and RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
-      </if>
-      <if test="resultReceiveNotePhoto != null">
-        and RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
-      </if>
-    </where>
-  </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
-    delete from TMSTRUCK_RECEIPT_RESULT
-    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
-  </delete>
-  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
-    delete from TMSTRUCK_RECEIPT_RESULT
-    where 1!=1 
-      <if test="resultTotalId != null">
-        or RESULT_TOTAL_ID = #{resultTotalId}
-      </if>
-      <if test="warehouseId != null">
-        or WAREHOUSE_ID = #{warehouseId}
-      </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="resultEmptyContainerPhoto != null">
-        or RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
-      </if>
-      <if test="resultSignedNotePhoto != null">
-        or RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
-      </if>
-      <if test="resultReceiveNotePhoto != null">
-        or RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
-      </if>
-  </delete>
-  <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
-    insert into TMSTRUCK_RECEIPT_RESULT (RESULT_ID, RESULT_TOTAL_ID, WAREHOUSE_ID, 
-      INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
-      UPDATE_TIME, INSERT_UPDATE_REMARK, STATUS, 
-      RESULT_EMPTY_CONTAINER_PHOTO, RESULT_SIGNED_NOTE_PHOTO, 
-      RESULT_RECEIVE_NOTE_PHOTO)
-    values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{warehouseId,jdbcType=DECIMAL}, 
-      #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{status,jdbcType=DECIMAL}, 
-      #{resultEmptyContainerPhoto,jdbcType=BLOB}, #{resultSignedNotePhoto,jdbcType=BLOB}, 
-      #{resultReceiveNotePhoto,jdbcType=BLOB})
-  </insert>
-  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
-    insert into TMSTRUCK_RECEIPT_RESULT
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="resultId != null">
-        RESULT_ID,
-      </if>
-      <if test="resultTotalId != null">
-        RESULT_TOTAL_ID,
-      </if>
-      <if test="warehouseId != null">
-        WAREHOUSE_ID,
-      </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="resultEmptyContainerPhoto != null">
-        RESULT_EMPTY_CONTAINER_PHOTO,
-      </if>
-      <if test="resultSignedNotePhoto != null">
-        RESULT_SIGNED_NOTE_PHOTO,
-      </if>
-      <if test="resultReceiveNotePhoto != null">
-        RESULT_RECEIVE_NOTE_PHOTO,
-      </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="warehouseId != null">
-        #{warehouseId,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="status != null">
-        #{status,jdbcType=DECIMAL},
-      </if>
-      <if test="resultEmptyContainerPhoto != null">
-        #{resultEmptyContainerPhoto,jdbcType=BLOB},
-      </if>
-      <if test="resultSignedNotePhoto != null">
-        #{resultSignedNotePhoto,jdbcType=BLOB},
-      </if>
-      <if test="resultReceiveNotePhoto != null">
-        #{resultReceiveNotePhoto,jdbcType=BLOB},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
-    update TMSTRUCK_RECEIPT_RESULT
-    set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
-      WAREHOUSE_ID = #{warehouseId,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},
-      STATUS = #{status,jdbcType=DECIMAL},
-      RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=BLOB},
-      RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=BLOB},
-      RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=BLOB}
-    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
-    update TMSTRUCK_RECEIPT_RESULT
-    <set>
-      <if test="resultTotalId != null">
-        RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
-      </if>
-      <if test="warehouseId != null">
-        WAREHOUSE_ID = #{warehouseId,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="status != null">
-        STATUS = #{status,jdbcType=DECIMAL},
-      </if>
-      <if test="resultEmptyContainerPhoto != null">
-        RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=BLOB},
-      </if>
-      <if test="resultSignedNotePhoto != null">
-        RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=BLOB},
-      </if>
-      <if test="resultReceiveNotePhoto != null">
-        RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=BLOB},
-      </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_RECEIPT_RESULT 
-      (RESULT_ID, 
-      RESULT_TOTAL_ID, WAREHOUSE_ID, INSERT_USERNAME, 
-      INSERT_TIME, UPDATE_USERNAME, 
-      UPDATE_TIME, INSERT_UPDATE_REMARK, 
-      STATUS, RESULT_EMPTY_CONTAINER_PHOTO, 
-      RESULT_SIGNED_NOTE_PHOTO, RESULT_RECEIVE_NOTE_PHOTO
-      )
-    ( <foreach collection="list" item="item" separator="union all"> 
-   select  
-      #{item.resultId,jdbcType=DECIMAL}, 
-      #{item.resultTotalId,jdbcType=DECIMAL}, #{item.warehouseId,jdbcType=DECIMAL}, #{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.resultEmptyContainerPhoto,jdbcType=BLOB}, 
-      #{item.resultSignedNotePhoto,jdbcType=BLOB}, #{item.resultReceiveNotePhoto,jdbcType=BLOB}
-       from dual  
-   </foreach> )
-  </insert>
-  <update id="batchUpdate" parameterType="java.util.List">
-     update TMSTRUCK_RECEIPT_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>
-       ,WAREHOUSE_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.warehouseId,jdbcType=DECIMAL}
-       </foreach>
-       ,INSERT_USERNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
-       </foreach>
-       ,INSERT_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,UPDATE_USERNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
-       </foreach>
-       ,UPDATE_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,INSERT_UPDATE_REMARK=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
-       </foreach>
-       ,STATUS=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
-       </foreach>
-       ,RESULT_EMPTY_CONTAINER_PHOTO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEmptyContainerPhoto,jdbcType=BLOB}
-       </foreach>
-       ,RESULT_SIGNED_NOTE_PHOTO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultSignedNotePhoto,jdbcType=BLOB}
-       </foreach>
-       ,RESULT_RECEIVE_NOTE_PHOTO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultReceiveNotePhoto,jdbcType=BLOB}
-       </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_RECEIPT_RESULT
-    where RESULT_ID in 
-    <foreach collection="list" item="id" open="(" close=")" separator=",">
-      #{id}
-    </foreach>
-  </delete>
-  <!-- 友情提示!!!-->
-  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-  <!--  获取最大ID值  -->
-
-<!--  通过总实绩ID 查询签收实绩ID -->
-  <select id="getIdByTotalResultId" parameterType="int" resultType="int">
-    select TRR.RESULT_ID from TMSTRUCK_RECEIPT_RESULT TRR where TRR.RESULT_TOTAL_ID = #{totalResultId}
-  </select>
-
-<!--通过总实绩Id 更新 状态码 为 1 已签收-->
-  <update id="updateByTotalResultId" parameterType="java.util.Map">
-    update TMSTRUCK_RECEIPT_RESULT
-    <set>
-      <if test="warehouseId != null">
-        WAREHOUSE_ID = #{warehouseId,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="status != null">
-        STATUS = #{status,jdbcType=DECIMAL},
-      </if>
-      <if test="resultEmptyContainerPhoto != null">
-        RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=BLOB},
-      </if>
-      <if test="resultSignedNotePhoto != null">
-        RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=BLOB},
-      </if>
-      <if test="resultReceiveNotePhoto != null">
-        RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=BLOB},
-      </if>
-    </set>
-    where RESULT_TOTAL_ID = #{resultTotalId}
-  </update>
-
-  <!--  通过签收时间排序 -->
-  <sql id="orderBy">
-    <if test="orderField != null and orderField != ''">
-      order by "${orderField}"
-      <if test="orderType != null and orderType != ''">
-        ${orderType}
-      </if>
-    </if>
-    <if test="orderField == null  ">
-      order by "insertTime" desc
-    </if>
-  </sql>
-
-<!--  查询所有签收实绩 -->
-  <select id="getCGReceiptResult" parameterType="java.util.Map" resultType="java.util.Map">
-    select
-           *
-    from (
-           select
-                  OO.ORDER_ID                  "orderId",
-                    TRR.RESULT_ID               "resultId",
-                  APO.PURCHASE_ORDER_NO       "purchaseOrderNo",
-                  RM.MATERIAL_NAME            "materialName",
-                  OO.ORDER_NUMBER             "orderNumber",
-                  RC.CAPACITY_NUMBER          "capacityNumber",
-                  DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
-                  TUR.UNLOAD_STATUS           "unloadStatus",
-                  TWR.RESULT_NET_WEIGHT       "resultNetWeight",
-                  RW.WAREHOUSE_NAME           "warehouseName",
-                  TRR.INSERT_USERNAME         "insertUsername",
-                  TRR.INSERT_TIME             "insertTime"
-           from TMSTRUCK_RECEIPT_RESULT TRR
-                  left join TMSTRUCK_TOTAL_RESULT TTR
-                            on TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
-                  left join OMSTRUCK_ORDER OO
-                            on OO.ORDER_ID = TTR.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_CAPACITY RC
-                            on RC.CAPACITY_ID = OO.CAPACITY_ID
-                  left join TMSTRUCK_WEIGHT_RESULT TWR
-                            on TWR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
-                  left join TMSTRUCK_UNLOAD_RESULT TUR
-                            on TUR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
-                  left 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 RMS_WAREHOUSE RW
-                            on RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
-                where TRR.STATUS = 1 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="resultForeignShipName != null">
-            and
-            <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
-              "resultForeignShipName" like '%${item}%'
-            </foreach>
-          </if>
-          <if test="unloadStatus != null">
-            and
-            <foreach collection="unloadStatus" item="item" open="(" separator="or" close=")">
-              "unloadStatus" 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="warehouseName != null">
-            and
-            <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
-              "warehouseName" like '%${item}%'
-            </foreach>
-          </if>
-          <if test="insertUsername != null">
-            and
-            <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
-              "insertUsername" like '%${item}%'
-            </foreach>
-          </if>
-        </where>
-        <include refid="orderBy"></include>
-  </select>
-
-<!--  查询内转钢材到异地库收货实绩-->
-    <select id="getSteelNzReceiptResult" parameterType="java.util.Map" resultType="java.util.Map">
-
-      SELECT *
-      FROM (
-             SELECT TRR.RESULT_ID       "resultId",
-                    OO.ORDER_NUMBER     "orderNumber",
-                    RC.CAPACITY_NUMBER  "capacityNumber",
-                    RW.WAREHOUSE_NAME   "warehouseName",
-                    TRR.INSERT_TIME     "insertTime",
-                    TRR.INSERT_USERNAME "insertUsername"
-             FROM TMSTRUCK_RECEIPT_RESULT TRR
-                    LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
-                              ON TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
-                    LEFT JOIN OMSTRUCK_ORDER OO
-                              ON OO.ORDER_ID = TTR.ORDER_ID
-                    LEFT JOIN RMS_WAREHOUSE RW
-                              ON RW.WAREHOUSE_ID = TRR.WAREHOUSE_ID
-                    LEFT JOIN RMS_CAPACITY RC
-                              ON RC.CAPACITY_ID = OO.CAPACITY_ID
-            WHERE OO.ORDER_TYPE = 4 AND TRR.STATUS = 1
-           )
-    <where>
-      <if test="orderNumber != null">
-        <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="insertTime != null">
-        and
-        <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
-          "insertTime" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="insertUsername != null">
-        and
-        <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
-          "insertUsername" like '%${item}%'
-        </foreach>
-      </if>
-    </where>
-      <include refid="orderBy"></include>
-    </select>
-
-  <select id="getInwardReceipt" parameterType="java.util.Map" resultType="java.util.Map">
-
-    select *
-    from (
-           select TRR.RESULT_ID               "resultId",
-                  APO.PURCHASE_ORDER_NO       "purchaseOrderNo",
-                  RM.MATERIAL_NAME            "materialName",
-                  OO.ORDER_NUMBER             "orderNumber",
-                  RC.CAPACITY_NUMBER          "capacityNumber",
-                  DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
-                  TUR.UNLOAD_STATUS           "unloadStatus",
-                  TWR.RESULT_NET_WEIGHT       "resultNetWeight",
-                  tqr.result_issampling       "issampling",
-                  TRR.INSERT_USERNAME         "insertUsername",
-                  TRR.INSERT_TIME             "insertTime",
-                  RW.WAREHOUSE_NAME           "warehouseName"
-           from TMSTRUCK_RECEIPT_RESULT TRR
-                  left join TMSTRUCK_TOTAL_RESULT TTR
-                            on TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
-                  left join OMSTRUCK_ORDER OO
-                            on OO.ORDER_ID = TTR.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_CAPACITY RC
-                            on RC.CAPACITY_ID = OO.CAPACITY_ID
-                  left join TMSTRUCK_WEIGHT_RESULT TWR
-                            on TWR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
-                  left join TMSTRUCK_UNLOAD_RESULT TUR
-                            on TUR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
-                  left 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_quality_result tqr
-                            on tqr.total_result_id = ttr.result_total_id
-                  left join RMS_WAREHOUSE RW
-                            on TUR.RESULT_UNLOAD_PLACE_ID = RW.WAREHOUSE_ID
-           where TRR.STATUS = 1
-             and OO.ORDER_TYPE = #{orderTypee}
-         )
-    <where>
-      <if test="materialName != null">
-        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-          "materialName" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="purchaseOrderNo != null">
-        and
-        <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
-          "purchaseOrderNo" 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="resultForeignShipName != null">
-        and
-        <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
-          "resultForeignShipName" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="unloadStatus != null">
-        and
-        <foreach collection="unloadStatus" item="item" open="(" separator="or" close=")">
-          "unloadStatus" 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="issampling != null">
-        and
-        <foreach collection="issampling" item="item" open="(" separator="or" close=")">
-          "issampling" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="insertUsername != null">
-        and
-        <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
-          "insertUsername" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="insertTime != null">
-        and
-        <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
-          "insertTime" like '%${item}%'
-        </foreach>
-      </if>
-    </where>
-    <include refid="orderBy"></include>
-  </select>
-</mapper>

+ 388 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckReceiveResultMapper.xml

@@ -0,0 +1,388 @@
+<?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.TmstruckReceiveResultMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckReceiveResult">
+    <id column="RESULT_RECEIVE_ID" jdbcType="DECIMAL" property="resultReceiveId" />
+    <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
+    <result column="RESULT_RECEIVE_TIME" jdbcType="TIMESTAMP" property="resultReceiveTime" />
+    <result column="RECEIVE_SINGER_ID" jdbcType="DECIMAL" property="receiveSingerId" />
+    <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" />
+  </resultMap>
+  <sql id="columns">
+    RESULT_RECEIVE_ID, RESULT_TOTAL_ID, RESULT_RECEIVE_TIME, RECEIVE_SINGER_ID, INSERT_USERNAME, 
+    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, STATUS
+  </sql>
+  <sql id="columns_alias">
+    t.RESULT_RECEIVE_ID, t.RESULT_TOTAL_ID, t.RESULT_RECEIVE_TIME, t.RECEIVE_SINGER_ID, 
+    t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, 
+    t.STATUS
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM TMSTRUCK_RECEIVE_RESULT
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM TMSTRUCK_RECEIVE_RESULT t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="resultReceiveId != null">
+        and RESULT_RECEIVE_ID = #{resultReceiveId}
+      </if>
+      <if test="resultTotalId != null">
+        and RESULT_TOTAL_ID = #{resultTotalId}
+      </if>
+      <if test="resultReceiveTime != null">
+        and TO_CHAR(RESULT_RECEIVE_TIME,'yyyy-MM-dd') = #{resultReceiveTime}
+      </if>
+      <if test="receiveSingerId != null">
+        and RECEIVE_SINGER_ID = #{receiveSingerId}
+      </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>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="resultReceiveId != null">
+        and RESULT_RECEIVE_ID = #{resultReceiveId}
+      </if>
+      <if test="resultTotalId != null">
+        and RESULT_TOTAL_ID = #{resultTotalId}
+      </if>
+      <if test="resultReceiveTime != null">
+        and TO_CHAR(RESULT_RECEIVE_TIME,'yyyy-MM-dd') = #{resultReceiveTime}
+      </if>
+      <if test="receiveSingerId != null">
+        and RECEIVE_SINGER_ID = #{receiveSingerId}
+      </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>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from TMSTRUCK_RECEIVE_RESULT
+    where RESULT_RECEIVE_ID = #{resultReceiveId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from TMSTRUCK_RECEIVE_RESULT
+    where 1!=1 
+      <if test="resultTotalId != null">
+        or RESULT_TOTAL_ID = #{resultTotalId}
+      </if>
+      <if test="resultReceiveTime != null">
+        or TO_CHAR(RESULT_RECEIVE_TIME,'yyyy-MM-dd') = '#{resultReceiveTime}'
+      </if>
+      <if test="receiveSingerId != null">
+        or RECEIVE_SINGER_ID = #{receiveSingerId}
+      </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>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckReceiveResult">
+    insert into TMSTRUCK_RECEIVE_RESULT (RESULT_RECEIVE_ID, RESULT_TOTAL_ID, RESULT_RECEIVE_TIME, 
+      RECEIVE_SINGER_ID, INSERT_USERNAME, INSERT_TIME, 
+      UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, 
+      STATUS)
+    values (#{resultReceiveId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{resultReceiveTime,jdbcType=TIMESTAMP}, 
+      #{receiveSingerId,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, 
+      #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, 
+      #{status,jdbcType=DECIMAL})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckReceiveResult">
+    insert into TMSTRUCK_RECEIVE_RESULT
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="resultReceiveId != null">
+        RESULT_RECEIVE_ID,
+      </if>
+      <if test="resultTotalId != null">
+        RESULT_TOTAL_ID,
+      </if>
+      <if test="resultReceiveTime != null">
+        RESULT_RECEIVE_TIME,
+      </if>
+      <if test="receiveSingerId != null">
+        RECEIVE_SINGER_ID,
+      </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>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="resultReceiveId != null">
+        #{resultReceiveId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultTotalId != null">
+        #{resultTotalId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultReceiveTime != null">
+        #{resultReceiveTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="receiveSingerId != null">
+        #{receiveSingerId,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="status != null">
+        #{status,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckReceiveResult">
+    update TMSTRUCK_RECEIVE_RESULT
+    set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+      RESULT_RECEIVE_TIME = #{resultReceiveTime,jdbcType=TIMESTAMP},
+      RECEIVE_SINGER_ID = #{receiveSingerId,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},
+      STATUS = #{status,jdbcType=DECIMAL}
+    where RESULT_RECEIVE_ID = #{resultReceiveId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckReceiveResult">
+    update TMSTRUCK_RECEIVE_RESULT
+    <set>
+      <if test="resultTotalId != null">
+        RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultReceiveTime != null">
+        RESULT_RECEIVE_TIME = #{resultReceiveTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="receiveSingerId != null">
+        RECEIVE_SINGER_ID = #{receiveSingerId,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="status != null">
+        STATUS = #{status,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where RESULT_RECEIVE_ID = #{resultReceiveId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select" />
+    where RESULT_RECEIVE_ID = #{resultReceiveId,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_RECEIVE_RESULT 
+      (RESULT_RECEIVE_ID, 
+      RESULT_TOTAL_ID, RESULT_RECEIVE_TIME, 
+      RECEIVE_SINGER_ID, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, 
+      STATUS)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.resultReceiveId,jdbcType=DECIMAL}, 
+      #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultReceiveTime,jdbcType=TIMESTAMP}, 
+      #{item.receiveSingerId,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR}, 
+      #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR}, 
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}, 
+      #{item.status,jdbcType=DECIMAL} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update TMSTRUCK_RECEIVE_RESULT
+     set
+       RESULT_RECEIVE_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
+          when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.resultReceiveId,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_TOTAL_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
+          when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_RECEIVE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
+          when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.resultReceiveTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,RECEIVE_SINGER_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
+          when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.receiveSingerId,jdbcType=DECIMAL}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
+          when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
+          when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
+          when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
+          when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
+          when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+       ,STATUS=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
+          when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
+       </foreach>
+     where RESULT_RECEIVE_ID in 
+     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+    #{item.resultReceiveId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from TMSTRUCK_RECEIVE_RESULT
+    where RESULT_RECEIVE_ID in 
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+  <!-- 查询是否已收过货 -->
+  <select id="getReceiveResult" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
+    select TRR.RESULT_RECEIVE_ID
+    from TMSTRUCK_RECEIVE_RESULT TRR
+    where TRR.RESULT_TOTAL_ID = #{resultTotalId}
+  </select>
+
+  <!--通过总实绩Id 更新 状态码 为 1 已签收-->
+  <update id="updateByTotalResultId" parameterType="com.steerinfo.dil.model.TmstruckReceiveResult">
+    update TMSTRUCK_RECEIVE_RESULT
+    <set>
+      <if test="resultTotalId != null">
+        RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultReceiveTime != null">
+        RESULT_RECEIVE_TIME = #{resultReceiveTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="receiveSingerId != null">
+        RECEIVE_SINGER_ID = #{receiveSingerId,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="status != null">
+        STATUS = #{status,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where RESULT_TOTAL_ID = #{resultTotalId}
+  </update>
+
+</mapper>

+ 2 - 2
src/main/resources/com/steerinfo/dil/mapper/UtilsMapper.xml

@@ -145,11 +145,11 @@
 <!--  查询运输订单是否已经签收过  -->
     <select id="checkoutReceipt" parameterType="string" resultType="int">
         select
-               TRR.RESULT_ID
+               TRR.RESULT_RECEIVE_ID
         from OMSTRUCK_ORDER OO
         join TMSTRUCK_TOTAL_RESULT TTR
             on TTR.ORDER_ID = OO.ORDER_ID
-        join TMSTRUCK_RECEIPT_RESULT TRR
+        join TMSTRUCK_RECEIVE_RESULT TRR
             on TRR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
         where OO.ORDER_NUMBER = #{orderNumber} and TRR.status = 1
     </select>