Browse Source

'app端运输预约'

HUJIANGUO 3 years ago
parent
commit
54cb24457a

+ 1 - 1
pom.xml

@@ -111,7 +111,7 @@
                     <!--包名-->
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
                     <tables>
-                        <param>AMS_SALE_PLAN</param><!--销售计划-->
+                        <param>AMS_DISPATCH_SALE_ORDER</param><!--销售计划-->
 <!--                        <param>AMS_SALE_PLAN_MATERIAL</param>&lt;!&ndash;销售计划物资中间表&ndash;&gt;-->
 <!--                        <param>AMS_SALE_PLAN_MATERIAL</param>&lt;!&ndash;销售计划物资中间表&ndash;&gt;-->
 <!--                        <param>AMS_SALE_ORDER</param>&lt;!&ndash;销售订单&ndash;&gt;-->
 <!--                        <param>AMS_SALE_ORDER</param>&lt;!&ndash;销售订单&ndash;&gt;-->
 <!--                        <param>AMS_SALE_ORDER_MATERIAL</param>&lt;!&ndash;销售订单车序号表&ndash;&gt;-->
 <!--                        <param>AMS_SALE_ORDER_MATERIAL</param>&lt;!&ndash;销售订单车序号表&ndash;&gt;-->

+ 59 - 0
src/main/java/com/steerinfo/dil/controller/AmsDispatchSaleOrderController.java

@@ -0,0 +1,59 @@
+package com.steerinfo.dil.controller;
+
+import com.steerinfo.dil.feign.ColumnDataFeign;
+import com.steerinfo.dil.service.impl.AmsDispatchSaleOrderServiceImpl;
+import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.PageListAdd;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageHelper;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmsSaleOrder RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:10
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:AmsSaleOrder RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/amsdispatchsaleorders")
+public class AmsDispatchSaleOrderController extends BaseRESTfulController {
+
+    @Autowired
+    AmsDispatchSaleOrderServiceImpl amsDispatchSaleOrderService;
+    @Autowired
+    ColumnDataFeign columnDataFeign;
+    @Autowired
+    ColumnDataUtil columnDataUtil;
+
+    @ApiOperation(value="查询app端公开抢单")
+    @PostMapping("/getDispatchSaleOrderList")
+    public RESTfulResult getDispatchSaleOrderList(){
+        List<Map<String, Object>> list = amsDispatchSaleOrderService.getDispatchSaleOrderList();
+        return success(list);
+    }
+
+    @ApiOperation(value="抢单/接收订单锁定")
+    @PostMapping("/lockDispatchSaleOrder")
+    public RESTfulResult lockDispatchSaleOrder(@RequestParam Integer dispatchId,
+                                               @RequestParam Integer carrierId) {
+        int result = amsDispatchSaleOrderService.lockDispatchSaleOrder(new BigDecimal(dispatchId),new BigDecimal(carrierId));
+        return success(result);
+    }
+
+}

+ 5 - 0
src/main/java/com/steerinfo/dil/mapper/AmsDispatchSaleOrderMapper.java

@@ -17,4 +17,9 @@ public interface AmsDispatchSaleOrderMapper extends IBaseMapper<AmsDispatchSaleO
     //查询序列号主键
     //查询序列号主键
     @Select("select seq_AMS_OTHER.nextval from dual")
     @Select("select seq_AMS_OTHER.nextval from dual")
     BigDecimal selectOtherId();
     BigDecimal selectOtherId();
+
+    // app端公开抢单
+    List<Map<String, Object>> getDispatchSaleOrderList();
+
+    List<Map<String,Object>> getMaterialMessages(BigDecimal dispatchId);
 }
 }

+ 0 - 1
src/main/java/com/steerinfo/dil/model/AmsDispatchSaleOrder.java

@@ -3,7 +3,6 @@ package com.steerinfo.dil.model;
 import com.steerinfo.framework.model.IBasePO;
 import com.steerinfo.framework.model.IBasePO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
-
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.Date;
 
 

+ 14 - 0
src/main/java/com/steerinfo/dil/service/IAmsDispatchSaleOrderService.java

@@ -29,4 +29,18 @@ public interface IAmsDispatchSaleOrderService{
     BigDecimal selectMaxId();
     BigDecimal selectMaxId();
     //新增固定派单
     //新增固定派单
     int insert(AmsDispatchSaleOrder ad);
     int insert(AmsDispatchSaleOrder ad);
+
+    /**
+     * app端公开抢单
+     * @return
+     */
+    List<Map<String, Object>> getDispatchSaleOrderList();
+
+    /**
+     * 抢单
+     * @param dispatchId
+     * @param carrierId
+     * @return
+     */
+    int lockDispatchSaleOrder(BigDecimal dispatchId,BigDecimal carrierId);
 }
 }

+ 49 - 3
src/main/java/com/steerinfo/dil/service/impl/AmsDispatchSaleOrderServiceImpl.java

@@ -3,15 +3,14 @@ package com.steerinfo.dil.service.impl;
 import com.steerinfo.dil.mapper.AmsDispatchSaleOrderMapper;
 import com.steerinfo.dil.mapper.AmsDispatchSaleOrderMapper;
 import com.steerinfo.dil.model.AmsDispatchSaleOrder;
 import com.steerinfo.dil.model.AmsDispatchSaleOrder;
 import com.steerinfo.dil.service.IAmsDispatchSaleOrderService;
 import com.steerinfo.dil.service.IAmsDispatchSaleOrderService;
+import com.steerinfo.dil.util.MapRemoveUtil;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.framework.service.impl.BaseServiceImpl;
 import com.steerinfo.framework.service.impl.BaseServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 
 /**
 /**
  * AmsDispatchSaleOrder服务实现:
  * AmsDispatchSaleOrder服务实现:
@@ -57,4 +56,51 @@ public class AmsDispatchSaleOrderServiceImpl extends BaseServiceImpl<AmsDispatch
         ad.setInsertUsername("admin");
         ad.setInsertUsername("admin");
         return amsDispatchSaleOrderMapper.insertSelective(ad);
         return amsDispatchSaleOrderMapper.insertSelective(ad);
     }
     }
+
+    /**
+     * 查询app端公开抢单
+     * @return
+     */
+    @Override
+    public List<Map<String, Object>> getDispatchSaleOrderList() {
+        List<Map<String, Object>> dispatchSaleOrderList = amsDispatchSaleOrderMapper.getDispatchSaleOrderList();
+        for (Map<String,Object> map: dispatchSaleOrderList) {
+            Date dispatchDealTime = (Date) map.get("dispatchDealTime");
+            BigDecimal dispatchId = (BigDecimal) map.get("dispatchId");
+            String isDeal;
+            if (dispatchDealTime == null) {
+                isDeal = "已成交";
+            }
+            else {
+                isDeal = "未成交";
+            }
+            map.put("isDeal",isDeal);
+            // 先把map中的key-value放到新的saleMap里面
+            Map<String,Object> saleMap = new HashMap<>();
+            saleMap.putAll(map);
+            // 使用Map清空工具迭代删除map中的所有key-value
+            MapRemoveUtil.removeMap(map);
+            List<Map<String, Object>> materialMessages = amsDispatchSaleOrderMapper.getMaterialMessages(dispatchId);
+            // 将已经清空的map里面put进一个map和一个list<Map>
+            map.put("materialMessages",materialMessages);
+            map.put("saleMap",saleMap);
+        }
+        return dispatchSaleOrderList;
+    }
+
+    /**
+     * 抢单/接收订单
+     * @param dispatchId
+     * @param carrierId
+     * @return
+     */
+    @Override
+    public int lockDispatchSaleOrder(BigDecimal dispatchId, BigDecimal carrierId) {
+        AmsDispatchSaleOrder amsDispatchSaleOrder = amsDispatchSaleOrderMapper.selectByPrimaryKey(dispatchId);
+        amsDispatchSaleOrder.setDispatchDealTime(new Date());
+        amsDispatchSaleOrder.setCarrierId(carrierId);
+        amsDispatchSaleOrder.setDispatchStatus(new BigDecimal(1));
+        int result = amsDispatchSaleOrderMapper.updateByPrimaryKeySelective(amsDispatchSaleOrder);
+        return result;
+    }
 }
 }

+ 21 - 0
src/main/java/com/steerinfo/dil/util/MapRemoveUtil.java

@@ -0,0 +1,21 @@
+package com.steerinfo.dil.util;
+
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * 清空map工具类
+ * @Description:
+ * @Author:HuJianGuo
+ * @GreateTime:2021/11/18 23:37
+ * @Version:V2.0
+ */
+public class MapRemoveUtil {
+
+    public static void removeMap(Map<String,Object> map) {
+        for (Iterator<Map.Entry<String, Object>> it = map.entrySet().iterator(); it.hasNext(); ) {//删除HashMAP元素
+            Map.Entry<String, Object> item = it.next();//找到下一节点
+            it.remove();
+        }
+    }
+}

+ 397 - 350
src/main/resources/com/steerinfo/dil/mapper/AmsDispatchSaleOrderMapper.xml

@@ -1,357 +1,404 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?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">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.steerinfo.dil.mapper.AmsDispatchSaleOrderMapper">
 <mapper namespace="com.steerinfo.dil.mapper.AmsDispatchSaleOrderMapper">
-  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmsDispatchSaleOrder">
-    <id column="DISPATCH_ID" jdbcType="DECIMAL" property="dispatchId" />
-    <result column="SALE_ORDER_ID" jdbcType="DECIMAL" property="saleOrderId" />
-    <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
-    <result column="DISPATCH_TIME" jdbcType="TIMESTAMP" property="dispatchTime" />
-    <result column="DISPATCH_DEAL_TIME" jdbcType="TIMESTAMP" property="dispatchDealTime" />
-    <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">
-    DISPATCH_ID, SALE_ORDER_ID, CARRIER_ID, DISPATCH_TIME, DISPATCH_DEAL_TIME, INSERT_USERNAME, 
+    <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmsDispatchSaleOrder">
+        <id column="DISPATCH_ID" jdbcType="DECIMAL" property="dispatchId"/>
+        <result column="SALE_ORDER_ID" jdbcType="DECIMAL" property="saleOrderId"/>
+        <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId"/>
+        <result column="DISPATCH_TIME" jdbcType="TIMESTAMP" property="dispatchTime"/>
+        <result column="DISPATCH_DEAL_TIME" jdbcType="TIMESTAMP" property="dispatchDealTime"/>
+        <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">
+        DISPATCH_ID, SALE_ORDER_ID, CARRIER_ID, DISPATCH_TIME, DISPATCH_DEAL_TIME, INSERT_USERNAME,
     INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
     INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
-  </sql>
-  <sql id="columns_alias">
-    t.DISPATCH_ID, t.SALE_ORDER_ID, t.CARRIER_ID, t.DISPATCH_TIME, t.DISPATCH_DEAL_TIME, 
+    </sql>
+    <sql id="columns_alias">
+        t.DISPATCH_ID, t.SALE_ORDER_ID, t.CARRIER_ID, t.DISPATCH_TIME, t.DISPATCH_DEAL_TIME,
     t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
     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 AMS_DISPATCH_SALE_ORDER
-  </sql>
-  <sql id="select_alias">
-    SELECT <include refid="columns_alias"/> FROM AMS_DISPATCH_SALE_ORDER t
-  </sql>
-  <sql id="where">
-    <where> 
-      <if test="dispatchId != null">
-        and DISPATCH_ID = #{dispatchId}
-      </if>
-      <if test="saleOrderId != null">
-        and SALE_ORDER_ID = #{saleOrderId}
-      </if>
-      <if test="carrierId != null">
-        and CARRIER_ID = #{carrierId}
-      </if>
-      <if test="dispatchTime != null">
-        and TO_CHAR(DISPATCH_TIME,'yyyy-MM-dd') = #{dispatchTime}
-      </if>
-      <if test="dispatchDealTime != null">
-        and TO_CHAR(DISPATCH_DEAL_TIME,'yyyy-MM-dd') = #{dispatchDealTime}
-      </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="dispatchId != null">
-        and DISPATCH_ID = #{dispatchId}
-      </if>
-      <if test="saleOrderId != null">
-        and SALE_ORDER_ID = #{saleOrderId}
-      </if>
-      <if test="carrierId != null">
-        and CARRIER_ID = #{carrierId}
-      </if>
-      <if test="dispatchTime != null">
-        and TO_CHAR(DISPATCH_TIME,'yyyy-MM-dd') = #{dispatchTime}
-      </if>
-      <if test="dispatchDealTime != null">
-        and TO_CHAR(DISPATCH_DEAL_TIME,'yyyy-MM-dd') = #{dispatchDealTime}
-      </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 AMS_DISPATCH_SALE_ORDER
-    where DISPATCH_ID = #{dispatchId,jdbcType=DECIMAL}
-  </delete>
-  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
-    delete from AMS_DISPATCH_SALE_ORDER
-    where 1!=1 
-      <if test="saleOrderId != null">
-        or SALE_ORDER_ID = #{saleOrderId}
-      </if>
-      <if test="carrierId != null">
-        or CARRIER_ID = #{carrierId}
-      </if>
-      <if test="dispatchTime != null">
-        or TO_CHAR(DISPATCH_TIME,'yyyy-MM-dd') = '#{dispatchTime}'
-      </if>
-      <if test="dispatchDealTime != null">
-        or TO_CHAR(DISPATCH_DEAL_TIME,'yyyy-MM-dd') = '#{dispatchDealTime}'
-      </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.AmsDispatchSaleOrder">
-    insert into AMS_DISPATCH_SALE_ORDER (DISPATCH_ID, SALE_ORDER_ID, CARRIER_ID, 
-      DISPATCH_TIME, DISPATCH_DEAL_TIME, INSERT_USERNAME, 
-      INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, 
-      INSERT_UPDATE_REMARK)
-    values (#{dispatchId,jdbcType=DECIMAL}, #{saleOrderId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL}, 
-      #{dispatchTime,jdbcType=TIMESTAMP}, #{dispatchDealTime,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR}, 
-      #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
-      #{insertUpdateRemark,jdbcType=VARCHAR})
-  </insert>
-  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsDispatchSaleOrder">
-    insert into AMS_DISPATCH_SALE_ORDER
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="dispatchId != null">
-        DISPATCH_ID,
-      </if>
-      <if test="saleOrderId != null">
-        SALE_ORDER_ID,
-      </if>
-      <if test="carrierId != null">
-        CARRIER_ID,
-      </if>
-      <if test="dispatchTime != null">
-        DISPATCH_TIME,
-      </if>
-      <if test="dispatchDealTime != null">
-        DISPATCH_DEAL_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>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="dispatchId != null">
-        #{dispatchId,jdbcType=DECIMAL},
-      </if>
-      <if test="saleOrderId != null">
-        #{saleOrderId,jdbcType=DECIMAL},
-      </if>
-      <if test="carrierId != null">
-        #{carrierId,jdbcType=DECIMAL},
-      </if>
-      <if test="dispatchTime != null">
-        #{dispatchTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="dispatchDealTime != null">
-        #{dispatchDealTime,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>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsDispatchSaleOrder">
-    update AMS_DISPATCH_SALE_ORDER
-    set SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL},
-      CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
-      DISPATCH_TIME = #{dispatchTime,jdbcType=TIMESTAMP},
-      DISPATCH_DEAL_TIME = #{dispatchDealTime,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}
-    where DISPATCH_ID = #{dispatchId,jdbcType=DECIMAL}
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsDispatchSaleOrder">
-    update AMS_DISPATCH_SALE_ORDER
-    <set>
-      <if test="saleOrderId != null">
-        SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL},
-      </if>
-      <if test="carrierId != null">
-        CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
-      </if>
-      <if test="dispatchTime != null">
-        DISPATCH_TIME = #{dispatchTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="dispatchDealTime != null">
-        DISPATCH_DEAL_TIME = #{dispatchDealTime,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>
-    </set>
-    where DISPATCH_ID = #{dispatchId,jdbcType=DECIMAL}
-  </update>
-  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
-    <include refid="select"/>
-    where DISPATCH_ID = #{dispatchId,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 AMS_DISPATCH_SALE_ORDER 
-      (DISPATCH_ID, 
-      SALE_ORDER_ID, CARRIER_ID, DISPATCH_TIME, 
-      DISPATCH_DEAL_TIME, INSERT_USERNAME, 
-      INSERT_TIME, UPDATE_USERNAME, 
-      UPDATE_TIME, INSERT_UPDATE_REMARK
-      )
-    ( <foreach collection="list" item="item" separator="union all"> 
-   select  
-      #{item.dispatchId,jdbcType=DECIMAL}, 
-      #{item.saleOrderId,jdbcType=DECIMAL}, #{item.carrierId,jdbcType=DECIMAL}, #{item.dispatchTime,jdbcType=TIMESTAMP}, 
-      #{item.dispatchDealTime,jdbcType=TIMESTAMP}, #{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 AMS_DISPATCH_SALE_ORDER
-     set
-       DISPATCH_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
-          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.dispatchId,jdbcType=DECIMAL}
-       </foreach>
-       ,SALE_ORDER_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
-          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.saleOrderId,jdbcType=DECIMAL}
-       </foreach>
-       ,CARRIER_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
-          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
-       </foreach>
-       ,DISPATCH_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
-          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.dispatchTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,DISPATCH_DEAL_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
-          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.dispatchDealTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,INSERT_USERNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
-          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
-       </foreach>
-       ,INSERT_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
-          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,UPDATE_USERNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
-          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
-       </foreach>
-       ,UPDATE_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
-          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,INSERT_UPDATE_REMARK=
-       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
-          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
-       </foreach>
-     where DISPATCH_ID in 
-     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
-    #{item.dispatchId,jdbcType=DECIMAL}
-     </foreach> 
-  </update>
-  <delete id="batchDelete" parameterType="java.util.List">
-    delete from AMS_DISPATCH_SALE_ORDER
-    where DISPATCH_ID in 
-    <foreach collection="list" item="id" open="(" close=")" separator=",">
-      #{id}
-    </foreach>
-  </delete>
-  <!-- 友情提示!!!-->
-  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-  <!-- 展示所有公开抢单的销售订单的车序号 -->
-  <select id="getOpenDispatchSaleOrder" parameterType="java.util.Map" resultType="java.util.Map">
-    select asom.sale_order_id as "saleOrderId",
-           asom.sale_order_material_truck_no as "saleOrderMaterialTruckNo",
-           rra.address_delivery_address as "addressDeliveryAddress",
-           asom.sale_date_of_receipt as "saleDateOfReceipt",
-           asom.sale_order_consignee as "saleOrderConsignee",
-           asom.sale_order_consignee_tel as "saleOrderConsigneeTel"
-    from ams_dispatch_sale_order adso
-           left join ams_sale_order_material asom on adso.sale_order_material_id=asom.sale_order_material_id
-           left join rms_receive_address rra on asom.sale_shipping_address_id=rra.address_id
-    where adso.carrier_id is null and adso.dispatch_status=0
-  </select>
+    </sql>
+    <sql id="select">
+        SELECT
+        <include refid="columns"/>
+        FROM AMS_DISPATCH_SALE_ORDER
+    </sql>
+    <sql id="select_alias">
+        SELECT
+        <include refid="columns_alias"/>
+        FROM AMS_DISPATCH_SALE_ORDER t
+    </sql>
+    <sql id="where">
+        <where>
+            <if test="dispatchId != null">
+                and DISPATCH_ID = #{dispatchId}
+            </if>
+            <if test="saleOrderId != null">
+                and SALE_ORDER_ID = #{saleOrderId}
+            </if>
+            <if test="carrierId != null">
+                and CARRIER_ID = #{carrierId}
+            </if>
+            <if test="dispatchTime != null">
+                and TO_CHAR(DISPATCH_TIME,'yyyy-MM-dd') = #{dispatchTime}
+            </if>
+            <if test="dispatchDealTime != null">
+                and TO_CHAR(DISPATCH_DEAL_TIME,'yyyy-MM-dd') = #{dispatchDealTime}
+            </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="dispatchId != null">
+                and DISPATCH_ID = #{dispatchId}
+            </if>
+            <if test="saleOrderId != null">
+                and SALE_ORDER_ID = #{saleOrderId}
+            </if>
+            <if test="carrierId != null">
+                and CARRIER_ID = #{carrierId}
+            </if>
+            <if test="dispatchTime != null">
+                and TO_CHAR(DISPATCH_TIME,'yyyy-MM-dd') = #{dispatchTime}
+            </if>
+            <if test="dispatchDealTime != null">
+                and TO_CHAR(DISPATCH_DEAL_TIME,'yyyy-MM-dd') = #{dispatchDealTime}
+            </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 AMS_DISPATCH_SALE_ORDER
+        where DISPATCH_ID = #{dispatchId,jdbcType=DECIMAL}
+    </delete>
+    <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+        delete from AMS_DISPATCH_SALE_ORDER
+        where 1!=1
+        <if test="saleOrderId != null">
+            or SALE_ORDER_ID = #{saleOrderId}
+        </if>
+        <if test="carrierId != null">
+            or CARRIER_ID = #{carrierId}
+        </if>
+        <if test="dispatchTime != null">
+            or TO_CHAR(DISPATCH_TIME,'yyyy-MM-dd') = '#{dispatchTime}'
+        </if>
+        <if test="dispatchDealTime != null">
+            or TO_CHAR(DISPATCH_DEAL_TIME,'yyyy-MM-dd') = '#{dispatchDealTime}'
+        </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.AmsDispatchSaleOrder">
+        insert into AMS_DISPATCH_SALE_ORDER (DISPATCH_ID, SALE_ORDER_ID, CARRIER_ID,
+                                             DISPATCH_TIME, DISPATCH_DEAL_TIME, INSERT_USERNAME,
+                                             INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
+                                             INSERT_UPDATE_REMARK)
+        values (#{dispatchId,jdbcType=DECIMAL}, #{saleOrderId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL},
+                #{dispatchTime,jdbcType=TIMESTAMP}, #{dispatchDealTime,jdbcType=TIMESTAMP},
+                #{insertUsername,jdbcType=VARCHAR},
+                #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
+                #{insertUpdateRemark,jdbcType=VARCHAR})
+    </insert>
+    <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsDispatchSaleOrder">
+        insert into AMS_DISPATCH_SALE_ORDER
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="dispatchId != null">
+                DISPATCH_ID,
+            </if>
+            <if test="saleOrderId != null">
+                SALE_ORDER_ID,
+            </if>
+            <if test="carrierId != null">
+                CARRIER_ID,
+            </if>
+            <if test="dispatchTime != null">
+                DISPATCH_TIME,
+            </if>
+            <if test="dispatchDealTime != null">
+                DISPATCH_DEAL_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>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="dispatchId != null">
+                #{dispatchId,jdbcType=DECIMAL},
+            </if>
+            <if test="saleOrderId != null">
+                #{saleOrderId,jdbcType=DECIMAL},
+            </if>
+            <if test="carrierId != null">
+                #{carrierId,jdbcType=DECIMAL},
+            </if>
+            <if test="dispatchTime != null">
+                #{dispatchTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="dispatchDealTime != null">
+                #{dispatchDealTime,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>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsDispatchSaleOrder">
+        update AMS_DISPATCH_SALE_ORDER
+        set SALE_ORDER_ID        = #{saleOrderId,jdbcType=DECIMAL},
+            CARRIER_ID           = #{carrierId,jdbcType=DECIMAL},
+            DISPATCH_TIME        = #{dispatchTime,jdbcType=TIMESTAMP},
+            DISPATCH_DEAL_TIME   = #{dispatchDealTime,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}
+        where DISPATCH_ID = #{dispatchId,jdbcType=DECIMAL}
+    </update>
+    <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsDispatchSaleOrder">
+        update AMS_DISPATCH_SALE_ORDER
+        <set>
+            <if test="saleOrderId != null">
+                SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL},
+            </if>
+            <if test="carrierId != null">
+                CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
+            </if>
+            <if test="dispatchTime != null">
+                DISPATCH_TIME = #{dispatchTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="dispatchDealTime != null">
+                DISPATCH_DEAL_TIME = #{dispatchDealTime,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>
+        </set>
+        where DISPATCH_ID = #{dispatchId,jdbcType=DECIMAL}
+    </update>
+    <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+        <include refid="select"/>
+        where DISPATCH_ID = #{dispatchId,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 AMS_DISPATCH_SALE_ORDER
+        (DISPATCH_ID,
+        SALE_ORDER_ID, CARRIER_ID, DISPATCH_TIME,
+        DISPATCH_DEAL_TIME, INSERT_USERNAME,
+        INSERT_TIME, UPDATE_USERNAME,
+        UPDATE_TIME, INSERT_UPDATE_REMARK
+        )
+        ( <foreach collection="list" item="item" separator="union all">
+        select
+        #{item.dispatchId,jdbcType=DECIMAL},
+        #{item.saleOrderId,jdbcType=DECIMAL}, #{item.carrierId,jdbcType=DECIMAL},
+        #{item.dispatchTime,jdbcType=TIMESTAMP},
+        #{item.dispatchDealTime,jdbcType=TIMESTAMP}, #{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 AMS_DISPATCH_SALE_ORDER
+        set
+        DISPATCH_ID=
+        <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+            when #{item.dispatchId,jdbcType=DECIMAL} then #{item.dispatchId,jdbcType=DECIMAL}
+        </foreach>
+        ,SALE_ORDER_ID=
+        <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+            when #{item.dispatchId,jdbcType=DECIMAL} then #{item.saleOrderId,jdbcType=DECIMAL}
+        </foreach>
+        ,CARRIER_ID=
+        <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+            when #{item.dispatchId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
+        </foreach>
+        ,DISPATCH_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+            when #{item.dispatchId,jdbcType=DECIMAL} then #{item.dispatchTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,DISPATCH_DEAL_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+            when #{item.dispatchId,jdbcType=DECIMAL} then #{item.dispatchDealTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,INSERT_USERNAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+            when #{item.dispatchId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+        </foreach>
+        ,INSERT_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+            when #{item.dispatchId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,UPDATE_USERNAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+            when #{item.dispatchId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+        </foreach>
+        ,UPDATE_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+            when #{item.dispatchId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,INSERT_UPDATE_REMARK=
+        <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+            when #{item.dispatchId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+        </foreach>
+        where DISPATCH_ID in
+        <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+            #{item.dispatchId,jdbcType=DECIMAL}
+        </foreach>
+    </update>
+    <delete id="batchDelete" parameterType="java.util.List">
+        delete from AMS_DISPATCH_SALE_ORDER
+        where DISPATCH_ID in
+        <foreach collection="list" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+    </delete>
+    <!-- 友情提示!!!-->
+    <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+    <!-- 展示所有公开抢单的销售订单的车序号 -->
+    <select id="getOpenDispatchSaleOrder" parameterType="java.util.Map" resultType="java.util.Map">
+        select asom.sale_order_id                as "saleOrderId",
+               asom.sale_order_material_truck_no as "saleOrderMaterialTruckNo",
+               rra.address_delivery_address      as "addressDeliveryAddress",
+               asom.sale_date_of_receipt         as "saleDateOfReceipt",
+               asom.sale_order_consignee         as "saleOrderConsignee",
+               asom.sale_order_consignee_tel     as "saleOrderConsigneeTel"
+        from ams_dispatch_sale_order adso
+                 left join ams_sale_order_material asom on adso.sale_order_material_id = asom.sale_order_material_id
+                 left join rms_receive_address rra on asom.sale_shipping_address_id = rra.address_id
+        where adso.carrier_id is null
+          and adso.dispatch_status = 0
+    </select>
 
 
+    <!-- app端展示公开抢单信息 -->
+    <select id="getDispatchSaleOrderList" resultType="java.util.Map">
+        SELECT ADSO.DISPATCH_ID                  AS "dispatchId",
+               ASOM.SALE_ORDER_MATERIAL_TRUCK_NO AS "saleOrderMaterialTruckNo",
+               ASO.SALE_NUMBER                   AS "saleNumber",
+               ADSO.DISPATCH_DEAL_TIME           AS "dispatchDealTime",
+               RSH.SHIPPER_NAME                  AS "shipperName",
+               RC.CONSIGNEE_COMPANY_NAME         AS "consigneeCompanyName",
+               RRA.ADDRESS_DELIVERY_ADDRESS      AS "addressDeliveryAddress",
+               ASOM.SALE_ORDER_CONSIGNEE         AS "saleOrderConsignee",
+               ASOM.SALE_ORDER_CONSIGNEE_TEL     AS "saleOrderConsigneeTel"
+        FROM AMS_DISPATCH_SALE_ORDER ADSO
+                 LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
+                           ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
+                 LEFT JOIN AMS_SALE_ORDER ASO
+                           ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
+                 LEFT JOIN RMS_SHIPPER RSH
+                           ON RSH.SHIPPER_ID = ASO.SHIPPER_ID
+                 LEFT JOIN RMS_CONSIGNEE RC
+                           ON RC.CONSIGNEE_ID = ASO.RECEIVE_ID
+                 LEFT JOIN RMS_RECEIVE_ADDRESS RRA
+                           ON ASOM.SALE_SHIPPING_ADDRESS_ID = RRA.ADDRESS_ID
+        WHERE ADSO.DISPATCH_TYPE = 1
+          AND ADSO.DISPATCH_STATUS = 0
+    </select>
+
+    <select id="getMaterialMessages" parameterType="DECIMAL" resultType="java.util.Map">
+        SELECT RM.MATERIAL_NAME                 AS "materialName",
+               ASTM.MATERIAL_THEORETICAL_WEIGHT AS "materialTheoreticalWeight",
+               ASTM.SALE_ORDER_MATERIAL_NUMBER  AS "saleOrderMaterialNumber"
+        FROM AMS_DISPATCH_SALE_ORDER ADSO
+                 LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
+                           ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
+                 LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
+                           ON ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
+                 LEFT JOIN RMS_MATERIAL RM
+                           ON RM.MATERIAL_ID = ASTM.MATERIAL_ID
+        WHERE ADSO.DISPATCH_ID = #{dispatchId}
+    </select>
 </mapper>
 </mapper>