|
@@ -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>
|