|
@@ -0,0 +1,2211 @@
|
|
|
+<?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.OmstruckOrderMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.OmstruckOrder">
|
|
|
+ <id column="ORDER_ID" jdbcType="DECIMAL" property="orderId"/>
|
|
|
+ <result column="ORDER_PLAN_ID" jdbcType="DECIMAL" property="orderPlanId"/>
|
|
|
+ <result column="ORDER_NUMBER" jdbcType="VARCHAR" property="orderNumber"/>
|
|
|
+ <result column="CAPACITY_ID" jdbcType="DECIMAL" property="capacityId"/>
|
|
|
+ <result column="ORDER_ISSUE_TIME" jdbcType="TIMESTAMP" property="orderIssueTime"/>
|
|
|
+ <result column="ORDER_RECEIVE_STATUS" jdbcType="DECIMAL" property="orderReceiveStatus"/>
|
|
|
+ <result column="ORDER_RECEIVE_REFUSE_TIME" jdbcType="TIMESTAMP" property="orderReceiveRefuseTime"/>
|
|
|
+ <result column="ORDER_COMMUNICATION_DURATION" jdbcType="DECIMAL" property="orderCommunicationDuration"/>
|
|
|
+ <result column="ORDER_STATUS" jdbcType="DECIMAL" property="orderStatus"/>
|
|
|
+ <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="DELETED" jdbcType="DECIMAL" property="deleted"/>
|
|
|
+ <result column="ORDER_TYPE" jdbcType="DECIMAL" property="orderType"/>
|
|
|
+ <result column="ORDER_LINE_SEQUENCE" jdbcType="DECIMAL" property="orderLineSequence"/>
|
|
|
+ <result column="LINE_ID" jdbcType="DECIMAL" property="lineId"/>
|
|
|
+ <result column="ORDER_ENTRY_TIME" jdbcType="TIMESTAMP" property="orderEntryTime"/>
|
|
|
+ <result column="DRIVER_CAPACITY_ID" jdbcType="DECIMAL" property="driverCapacityId"/>
|
|
|
+ <result column="UNLOAD_POINT_ID" jdbcType="DECIMAL" property="unloadPointId"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="columns">
|
|
|
+ ORDER_ID, ORDER_PLAN_ID, ORDER_NUMBER, CAPACITY_ID, ORDER_ISSUE_TIME, ORDER_RECEIVE_STATUS,
|
|
|
+ ORDER_RECEIVE_REFUSE_TIME, ORDER_COMMUNICATION_DURATION, ORDER_STATUS, INSERT_USERNAME,
|
|
|
+ INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, ORDER_TYPE,
|
|
|
+ ORDER_LINE_SEQUENCE, LINE_ID, ORDER_ENTRY_TIME, DRIVER_CAPACITY_ID, UNLOAD_POINT_ID
|
|
|
+ </sql>
|
|
|
+ <sql id="columns_alias">
|
|
|
+ t.ORDER_ID, t.ORDER_PLAN_ID, t.ORDER_NUMBER, t.CAPACITY_ID, t.ORDER_ISSUE_TIME, t.ORDER_RECEIVE_STATUS,
|
|
|
+ t.ORDER_RECEIVE_REFUSE_TIME, t.ORDER_COMMUNICATION_DURATION, t.ORDER_STATUS, t.INSERT_USERNAME,
|
|
|
+ t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED,
|
|
|
+ t.ORDER_TYPE, t.ORDER_LINE_SEQUENCE, t.LINE_ID, t.ORDER_ENTRY_TIME, t.DRIVER_CAPACITY_ID,
|
|
|
+ t.UNLOAD_POINT_ID
|
|
|
+ </sql>
|
|
|
+ <sql id="select">
|
|
|
+ SELECT
|
|
|
+ <include refid="columns"/>
|
|
|
+ FROM OMSTRUCK_ORDER
|
|
|
+ </sql>
|
|
|
+ <sql id="select_alias">
|
|
|
+ SELECT
|
|
|
+ <include refid="columns_alias"/>
|
|
|
+ FROM OMSTRUCK_ORDER t
|
|
|
+ </sql>
|
|
|
+ <sql id="where">
|
|
|
+ <where>
|
|
|
+ <if test="orderId != null">
|
|
|
+ and ORDER_ID = #{orderId}
|
|
|
+ </if>
|
|
|
+ <if test="orderPlanId != null">
|
|
|
+ and ORDER_PLAN_ID = #{orderPlanId}
|
|
|
+ </if>
|
|
|
+ <if test="orderNumber != null and orderNumber != ''">
|
|
|
+ and ORDER_NUMBER = #{orderNumber}
|
|
|
+ </if>
|
|
|
+ <if test="capacityId != null">
|
|
|
+ and CAPACITY_ID = #{capacityId}
|
|
|
+ </if>
|
|
|
+ <if test="orderIssueTime != null">
|
|
|
+ and TO_CHAR(ORDER_ISSUE_TIME,'yyyy-MM-dd') = #{orderIssueTime}
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveStatus != null">
|
|
|
+ and ORDER_RECEIVE_STATUS = #{orderReceiveStatus}
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveRefuseTime != null">
|
|
|
+ and TO_CHAR(ORDER_RECEIVE_REFUSE_TIME,'yyyy-MM-dd') = #{orderReceiveRefuseTime}
|
|
|
+ </if>
|
|
|
+ <if test="orderCommunicationDuration != null">
|
|
|
+ and ORDER_COMMUNICATION_DURATION = #{orderCommunicationDuration}
|
|
|
+ </if>
|
|
|
+ <if test="orderStatus != null">
|
|
|
+ and ORDER_STATUS = #{orderStatus}
|
|
|
+ </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="deleted != null">
|
|
|
+ and DELETED = #{deleted}
|
|
|
+ </if>
|
|
|
+ <if test="orderType != null">
|
|
|
+ and ORDER_TYPE = #{orderType}
|
|
|
+ </if>
|
|
|
+ <if test="orderLineSequence != null">
|
|
|
+ and ORDER_LINE_SEQUENCE = #{orderLineSequence}
|
|
|
+ </if>
|
|
|
+ <if test="lineId != null">
|
|
|
+ and LINE_ID = #{lineId}
|
|
|
+ </if>
|
|
|
+ <if test="orderEntryTime != null">
|
|
|
+ and TO_CHAR(ORDER_ENTRY_TIME,'yyyy-MM-dd') = #{orderEntryTime}
|
|
|
+ </if>
|
|
|
+ <if test="driverCapacityId != null">
|
|
|
+ and DRIVER_CAPACITY_ID = #{driverCapacityId}
|
|
|
+ </if>
|
|
|
+ <if test="unloadPointId != null">
|
|
|
+ and UNLOAD_POINT_ID = #{unloadPointId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <sql id="whereLike">
|
|
|
+ <where>
|
|
|
+ <if test="orderId != null">
|
|
|
+ and ORDER_ID = #{orderId}
|
|
|
+ </if>
|
|
|
+ <if test="orderPlanId != null">
|
|
|
+ and ORDER_PLAN_ID = #{orderPlanId}
|
|
|
+ </if>
|
|
|
+ <if test="orderNumber != null and orderNumber != ''">
|
|
|
+ and ORDER_NUMBER LIKE '%${orderNumber}%'
|
|
|
+ </if>
|
|
|
+ <if test="capacityId != null">
|
|
|
+ and CAPACITY_ID = #{capacityId}
|
|
|
+ </if>
|
|
|
+ <if test="orderIssueTime != null">
|
|
|
+ and TO_CHAR(ORDER_ISSUE_TIME,'yyyy-MM-dd') = #{orderIssueTime}
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveStatus != null">
|
|
|
+ and ORDER_RECEIVE_STATUS = #{orderReceiveStatus}
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveRefuseTime != null">
|
|
|
+ and TO_CHAR(ORDER_RECEIVE_REFUSE_TIME,'yyyy-MM-dd') = #{orderReceiveRefuseTime}
|
|
|
+ </if>
|
|
|
+ <if test="orderCommunicationDuration != null">
|
|
|
+ and ORDER_COMMUNICATION_DURATION = #{orderCommunicationDuration}
|
|
|
+ </if>
|
|
|
+ <if test="orderStatus != null">
|
|
|
+ and ORDER_STATUS = #{orderStatus}
|
|
|
+ </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="deleted != null">
|
|
|
+ and DELETED = #{deleted}
|
|
|
+ </if>
|
|
|
+ <if test="orderType != null">
|
|
|
+ and ORDER_TYPE = #{orderType}
|
|
|
+ </if>
|
|
|
+ <if test="orderLineSequence != null">
|
|
|
+ and ORDER_LINE_SEQUENCE = #{orderLineSequence}
|
|
|
+ </if>
|
|
|
+ <if test="lineId != null">
|
|
|
+ and LINE_ID = #{lineId}
|
|
|
+ </if>
|
|
|
+ <if test="orderEntryTime != null">
|
|
|
+ and TO_CHAR(ORDER_ENTRY_TIME,'yyyy-MM-dd') = #{orderEntryTime}
|
|
|
+ </if>
|
|
|
+ <if test="driverCapacityId != null">
|
|
|
+ and DRIVER_CAPACITY_ID = #{driverCapacityId}
|
|
|
+ </if>
|
|
|
+ <if test="unloadPointId != null">
|
|
|
+ and UNLOAD_POINT_ID = #{unloadPointId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
|
|
|
+ delete
|
|
|
+ from OMSTRUCK_ORDER
|
|
|
+ where ORDER_ID = #{orderId,jdbcType=DECIMAL}
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
|
+ delete from OMSTRUCK_ORDER
|
|
|
+ where 1!=1
|
|
|
+ <if test="orderPlanId != null">
|
|
|
+ or ORDER_PLAN_ID = #{orderPlanId}
|
|
|
+ </if>
|
|
|
+ <if test="orderNumber != null and orderNumber != ''">
|
|
|
+ or ORDER_NUMBER = #{orderNumber}
|
|
|
+ </if>
|
|
|
+ <if test="capacityId != null">
|
|
|
+ or CAPACITY_ID = #{capacityId}
|
|
|
+ </if>
|
|
|
+ <if test="orderIssueTime != null">
|
|
|
+ or TO_CHAR(ORDER_ISSUE_TIME,'yyyy-MM-dd') = '#{orderIssueTime}'
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveStatus != null">
|
|
|
+ or ORDER_RECEIVE_STATUS = #{orderReceiveStatus}
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveRefuseTime != null">
|
|
|
+ or TO_CHAR(ORDER_RECEIVE_REFUSE_TIME,'yyyy-MM-dd') = '#{orderReceiveRefuseTime}'
|
|
|
+ </if>
|
|
|
+ <if test="orderCommunicationDuration != null">
|
|
|
+ or ORDER_COMMUNICATION_DURATION = #{orderCommunicationDuration}
|
|
|
+ </if>
|
|
|
+ <if test="orderStatus != null">
|
|
|
+ or ORDER_STATUS = #{orderStatus}
|
|
|
+ </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="deleted != null">
|
|
|
+ or DELETED = #{deleted}
|
|
|
+ </if>
|
|
|
+ <if test="orderType != null">
|
|
|
+ or ORDER_TYPE = #{orderType}
|
|
|
+ </if>
|
|
|
+ <if test="orderLineSequence != null">
|
|
|
+ or ORDER_LINE_SEQUENCE = #{orderLineSequence}
|
|
|
+ </if>
|
|
|
+ <if test="lineId != null">
|
|
|
+ or LINE_ID = #{lineId}
|
|
|
+ </if>
|
|
|
+ <if test="orderEntryTime != null">
|
|
|
+ or TO_CHAR(ORDER_ENTRY_TIME,'yyyy-MM-dd') = '#{orderEntryTime}'
|
|
|
+ </if>
|
|
|
+ <if test="driverCapacityId != null">
|
|
|
+ or DRIVER_CAPACITY_ID = #{driverCapacityId}
|
|
|
+ </if>
|
|
|
+ <if test="unloadPointId != null">
|
|
|
+ or UNLOAD_POINT_ID = #{unloadPointId}
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.steerinfo.dil.model.OmstruckOrder">
|
|
|
+ insert into OMSTRUCK_ORDER (ORDER_ID, ORDER_PLAN_ID, ORDER_NUMBER,
|
|
|
+ CAPACITY_ID, ORDER_ISSUE_TIME, ORDER_RECEIVE_STATUS,
|
|
|
+ ORDER_RECEIVE_REFUSE_TIME, ORDER_COMMUNICATION_DURATION,
|
|
|
+ ORDER_STATUS, INSERT_USERNAME, INSERT_TIME,
|
|
|
+ UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
|
|
|
+ DELETED, ORDER_TYPE, ORDER_LINE_SEQUENCE,
|
|
|
+ LINE_ID, ORDER_ENTRY_TIME, DRIVER_CAPACITY_ID,
|
|
|
+ UNLOAD_POINT_ID)
|
|
|
+ values (#{orderId,jdbcType=DECIMAL}, #{orderPlanId,jdbcType=DECIMAL}, #{orderNumber,jdbcType=VARCHAR},
|
|
|
+ #{capacityId,jdbcType=DECIMAL}, #{orderIssueTime,jdbcType=TIMESTAMP},
|
|
|
+ #{orderReceiveStatus,jdbcType=DECIMAL},
|
|
|
+ #{orderReceiveRefuseTime,jdbcType=TIMESTAMP}, #{orderCommunicationDuration,jdbcType=DECIMAL},
|
|
|
+ #{orderStatus,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
|
|
|
+ #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ #{insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
+ #{deleted,jdbcType=DECIMAL}, #{orderType,jdbcType=DECIMAL}, #{orderLineSequence,jdbcType=DECIMAL},
|
|
|
+ #{lineId,jdbcType=DECIMAL}, #{orderEntryTime,jdbcType=TIMESTAMP}, #{driverCapacityId,jdbcType=DECIMAL},
|
|
|
+ #{unloadPointId,jdbcType=DECIMAL})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.steerinfo.dil.model.OmstruckOrder">
|
|
|
+ insert into OMSTRUCK_ORDER
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="orderId != null">
|
|
|
+ ORDER_ID,
|
|
|
+ </if>
|
|
|
+ <if test="orderPlanId != null">
|
|
|
+ ORDER_PLAN_ID,
|
|
|
+ </if>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ ORDER_NUMBER,
|
|
|
+ </if>
|
|
|
+ <if test="capacityId != null">
|
|
|
+ CAPACITY_ID,
|
|
|
+ </if>
|
|
|
+ <if test="orderIssueTime != null">
|
|
|
+ ORDER_ISSUE_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveStatus != null">
|
|
|
+ ORDER_RECEIVE_STATUS,
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveRefuseTime != null">
|
|
|
+ ORDER_RECEIVE_REFUSE_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="orderCommunicationDuration != null">
|
|
|
+ ORDER_COMMUNICATION_DURATION,
|
|
|
+ </if>
|
|
|
+ <if test="orderStatus != null">
|
|
|
+ ORDER_STATUS,
|
|
|
+ </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="deleted != null">
|
|
|
+ DELETED,
|
|
|
+ </if>
|
|
|
+ <if test="orderType != null">
|
|
|
+ ORDER_TYPE,
|
|
|
+ </if>
|
|
|
+ <if test="orderLineSequence != null">
|
|
|
+ ORDER_LINE_SEQUENCE,
|
|
|
+ </if>
|
|
|
+ <if test="lineId != null">
|
|
|
+ LINE_ID,
|
|
|
+ </if>
|
|
|
+ <if test="orderEntryTime != null">
|
|
|
+ ORDER_ENTRY_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="driverCapacityId != null">
|
|
|
+ DRIVER_CAPACITY_ID,
|
|
|
+ </if>
|
|
|
+ <if test="unloadPointId != null">
|
|
|
+ UNLOAD_POINT_ID,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="orderId != null">
|
|
|
+ #{orderId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderPlanId != null">
|
|
|
+ #{orderPlanId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ #{orderNumber,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="capacityId != null">
|
|
|
+ #{capacityId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderIssueTime != null">
|
|
|
+ #{orderIssueTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveStatus != null">
|
|
|
+ #{orderReceiveStatus,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveRefuseTime != null">
|
|
|
+ #{orderReceiveRefuseTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="orderCommunicationDuration != null">
|
|
|
+ #{orderCommunicationDuration,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderStatus != null">
|
|
|
+ #{orderStatus,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="deleted != null">
|
|
|
+ #{deleted,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderType != null">
|
|
|
+ #{orderType,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderLineSequence != null">
|
|
|
+ #{orderLineSequence,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="lineId != null">
|
|
|
+ #{lineId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderEntryTime != null">
|
|
|
+ #{orderEntryTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="driverCapacityId != null">
|
|
|
+ #{driverCapacityId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="unloadPointId != null">
|
|
|
+ #{unloadPointId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.OmstruckOrder">
|
|
|
+ update OMSTRUCK_ORDER
|
|
|
+ set ORDER_PLAN_ID = #{orderPlanId,jdbcType=DECIMAL},
|
|
|
+ ORDER_NUMBER = #{orderNumber,jdbcType=VARCHAR},
|
|
|
+ CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
|
|
|
+ ORDER_ISSUE_TIME = #{orderIssueTime,jdbcType=TIMESTAMP},
|
|
|
+ ORDER_RECEIVE_STATUS = #{orderReceiveStatus,jdbcType=DECIMAL},
|
|
|
+ ORDER_RECEIVE_REFUSE_TIME = #{orderReceiveRefuseTime,jdbcType=TIMESTAMP},
|
|
|
+ ORDER_COMMUNICATION_DURATION = #{orderCommunicationDuration,jdbcType=DECIMAL},
|
|
|
+ ORDER_STATUS = #{orderStatus,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},
|
|
|
+ DELETED = #{deleted,jdbcType=DECIMAL},
|
|
|
+ ORDER_TYPE = #{orderType,jdbcType=DECIMAL},
|
|
|
+ ORDER_LINE_SEQUENCE = #{orderLineSequence,jdbcType=DECIMAL},
|
|
|
+ LINE_ID = #{lineId,jdbcType=DECIMAL},
|
|
|
+ ORDER_ENTRY_TIME = #{orderEntryTime,jdbcType=TIMESTAMP},
|
|
|
+ DRIVER_CAPACITY_ID = #{driverCapacityId,jdbcType=DECIMAL},
|
|
|
+ UNLOAD_POINT_ID = #{unloadPointId,jdbcType=DECIMAL}
|
|
|
+ where ORDER_ID = #{orderId,jdbcType=DECIMAL}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.OmstruckOrder">
|
|
|
+ update OMSTRUCK_ORDER
|
|
|
+ <set>
|
|
|
+ <if test="orderPlanId != null">
|
|
|
+ ORDER_PLAN_ID = #{orderPlanId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ ORDER_NUMBER = #{orderNumber,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="capacityId != null">
|
|
|
+ CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderIssueTime != null">
|
|
|
+ ORDER_ISSUE_TIME = #{orderIssueTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveStatus != null">
|
|
|
+ ORDER_RECEIVE_STATUS = #{orderReceiveStatus,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveRefuseTime != null">
|
|
|
+ ORDER_RECEIVE_REFUSE_TIME = #{orderReceiveRefuseTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="orderCommunicationDuration != null">
|
|
|
+ ORDER_COMMUNICATION_DURATION = #{orderCommunicationDuration,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderStatus != null">
|
|
|
+ ORDER_STATUS = #{orderStatus,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="deleted != null">
|
|
|
+ DELETED = #{deleted,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderType != null">
|
|
|
+ ORDER_TYPE = #{orderType,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderLineSequence != null">
|
|
|
+ ORDER_LINE_SEQUENCE = #{orderLineSequence,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="lineId != null">
|
|
|
+ LINE_ID = #{lineId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderEntryTime != null">
|
|
|
+ ORDER_ENTRY_TIME = #{orderEntryTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="driverCapacityId != null">
|
|
|
+ DRIVER_CAPACITY_ID = #{driverCapacityId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="unloadPointId != null">
|
|
|
+ UNLOAD_POINT_ID = #{unloadPointId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where ORDER_ID = #{orderId,jdbcType=DECIMAL}
|
|
|
+ </update>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
|
|
|
+ <include refid="select"/>
|
|
|
+ where ORDER_ID = #{orderId,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 OMSTRUCK_ORDER
|
|
|
+ (ORDER_ID,
|
|
|
+ ORDER_PLAN_ID, ORDER_NUMBER, CAPACITY_ID,
|
|
|
+ ORDER_ISSUE_TIME, ORDER_RECEIVE_STATUS,
|
|
|
+ ORDER_RECEIVE_REFUSE_TIME, ORDER_COMMUNICATION_DURATION,
|
|
|
+ ORDER_STATUS, INSERT_USERNAME,
|
|
|
+ INSERT_TIME, UPDATE_USERNAME,
|
|
|
+ UPDATE_TIME, INSERT_UPDATE_REMARK,
|
|
|
+ DELETED, ORDER_TYPE, ORDER_LINE_SEQUENCE,
|
|
|
+ LINE_ID, ORDER_ENTRY_TIME, DRIVER_CAPACITY_ID,
|
|
|
+ UNLOAD_POINT_ID)
|
|
|
+ ( <foreach collection="list" item="item" separator="union all">
|
|
|
+ select
|
|
|
+ #{item.orderId,jdbcType=DECIMAL},
|
|
|
+ #{item.orderPlanId,jdbcType=DECIMAL}, #{item.orderNumber,jdbcType=VARCHAR}, #{item.capacityId,jdbcType=DECIMAL},
|
|
|
+ #{item.orderIssueTime,jdbcType=TIMESTAMP}, #{item.orderReceiveStatus,jdbcType=DECIMAL},
|
|
|
+ #{item.orderReceiveRefuseTime,jdbcType=TIMESTAMP}, #{item.orderCommunicationDuration,jdbcType=DECIMAL},
|
|
|
+ #{item.orderStatus,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
|
|
|
+ #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
|
|
|
+ #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
+ #{item.deleted,jdbcType=DECIMAL}, #{item.orderType,jdbcType=DECIMAL},
|
|
|
+ #{item.orderLineSequence,jdbcType=DECIMAL},
|
|
|
+ #{item.lineId,jdbcType=DECIMAL}, #{item.orderEntryTime,jdbcType=TIMESTAMP},
|
|
|
+ #{item.driverCapacityId,jdbcType=DECIMAL},
|
|
|
+ #{item.unloadPointId,jdbcType=DECIMAL} from dual
|
|
|
+ </foreach> )
|
|
|
+ </insert>
|
|
|
+ <update id="batchUpdate" parameterType="java.util.List">
|
|
|
+ update OMSTRUCK_ORDER
|
|
|
+ set
|
|
|
+ ORDER_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.orderId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,ORDER_PLAN_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.orderPlanId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,ORDER_NUMBER=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.orderNumber,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,CAPACITY_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.capacityId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,ORDER_ISSUE_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.orderIssueTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,ORDER_RECEIVE_STATUS=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.orderReceiveStatus,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,ORDER_RECEIVE_REFUSE_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.orderReceiveRefuseTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,ORDER_COMMUNICATION_DURATION=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.orderCommunicationDuration,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,ORDER_STATUS=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.orderStatus,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_USERNAME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,UPDATE_USERNAME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,UPDATE_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_UPDATE_REMARK=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,DELETED=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,ORDER_TYPE=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.orderType,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,ORDER_LINE_SEQUENCE=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.orderLineSequence,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,LINE_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.lineId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,ORDER_ENTRY_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.orderEntryTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,DRIVER_CAPACITY_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.driverCapacityId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,UNLOAD_POINT_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
|
|
|
+ when #{item.orderId,jdbcType=DECIMAL} then #{item.unloadPointId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ where ORDER_ID in
|
|
|
+ <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
|
+ #{item.orderId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+ <delete id="batchDelete" parameterType="java.util.List">
|
|
|
+ delete from OMSTRUCK_ORDER
|
|
|
+ where ORDER_ID in
|
|
|
+ <foreach collection="list" item="id" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+ <!-- 友情提示!!!-->
|
|
|
+ <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
+ <!-- 根据插入时间排序 -->
|
|
|
+ <sql id="orderBy">
|
|
|
+ <if test="orderField != null and orderField != ''">
|
|
|
+ order by "${orderField}"
|
|
|
+ <if test="orderType != null and orderType != ''">
|
|
|
+ ${orderType}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 查询运输订单 -->
|
|
|
+ <select id="getAllTruckOrder" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ *
|
|
|
+ from
|
|
|
+ (
|
|
|
+ select
|
|
|
+ OO.ORDER_ID "orderId",
|
|
|
+ APO.PURCHASE_ORDER_ID "purchaseOrderId",
|
|
|
+ AP.PLAN_ID "planId",
|
|
|
+ APO.PURCHASE_ORDER_NO "purchaseOrderNo",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ AP.PLAN_NO "planNo",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ RC.CAPACITY_ID "capacityId",
|
|
|
+ RCD.DRIVER_NAME "driverName",
|
|
|
+ OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
|
|
|
+ AP.PLAN_TRUCK_TIME "planTruckTime",
|
|
|
+ AP.PLAN_INCOMING_TIME "planIncomingTime",
|
|
|
+ OO.INSERT_USERNAME "insertUsername",
|
|
|
+ OO.INSERT_TIME "insertTime",
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RW.WAREHOUSE_NAME "warehouseName", --卸货点
|
|
|
+ OO.ORDER_ENTRY_TIME "orderEntryTime", --进厂时间
|
|
|
+ RS.SUPPLIER_NAME "supplierName", --发货单位
|
|
|
+ RCSE.CONSIGNEE_COMPANY_NAME "consigneeCompanyName" --收货单位
|
|
|
+
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ left join AMS_PURCHASE_ORDER APO
|
|
|
+ on OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
|
|
|
+ left join AMSTRUCK_PURPLAN AP
|
|
|
+ on AP.BATCH_ID = APO.BATCH_ID and AP.PLAN_STATUS != 3
|
|
|
+ left join RMS_DRIVER_CAPACITY RDC
|
|
|
+ on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = RDC.CAPACITY_ID
|
|
|
+ left join RMS_CAR_DRIVER RCD
|
|
|
+ on RCD.DRIVER_ID = RDC.DRIVER_ID
|
|
|
+ left join OMSTRUCK_ORDER_MATERIAL OOM
|
|
|
+ on OOM.ORDER_ID = OO.ORDER_ID
|
|
|
+ left join RMS_MATERIAL RM
|
|
|
+ on RM.MATERIAL_ID = OOM.MATERIAL_ID
|
|
|
+ left join RMS_WAREHOUSE RW
|
|
|
+ on OO.UNLOAD_POINT_ID = RW.WAREHOUSE_ID
|
|
|
+ left join RMS_SUPPLIER RS
|
|
|
+ on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
|
|
|
+ left join RMS_CONSIGNEE RCSE
|
|
|
+ on APO.RECEIVE_UNIT_ID = RCSE.CONSIGNEE_ID
|
|
|
+ <where>
|
|
|
+ <choose>
|
|
|
+ <when test="orderStatus != 8">
|
|
|
+ and OO.ORDER_STATUS = #{orderStatus}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and OO.ORDER_STATUS in (1, 2, 4, 5, 6)
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ <if test="planId != null ">
|
|
|
+ and AP.PLAN_ID = #{planId}
|
|
|
+ </if>
|
|
|
+ <if test="orderType != null">
|
|
|
+ and OO.ORDER_TYPE = #{orderType}
|
|
|
+ </if>
|
|
|
+ <if test="fuelOrder != null">
|
|
|
+ and OO.ORDER_TYPE in (6, 7)
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="materialName != null">
|
|
|
+ <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
+ "materialName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderMaterialWeight != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderMaterialWeight" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="planNo != null">
|
|
|
+ and
|
|
|
+ <foreach collection="planNo" item="item" open="(" separator="or" close=")">
|
|
|
+ "planNo" 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="driverName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="driverName" item="item" open="(" separator="or" close=")">
|
|
|
+ "driverName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="planTruckTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="planTruckTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "planTruckTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="planIncomingTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="planIncomingTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "planIncomingTime" 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>
|
|
|
+ <if test="warehouseName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
|
|
|
+ "warehouseName" 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="orderEntryTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderEntryTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderEntryTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="supplierName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
|
|
|
+ "supplierName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="consigneeCompanyName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
|
|
|
+ "consigneeCompanyName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy">
|
|
|
+ </include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "insertTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 通过运输订单Id查询运输订单号 -->
|
|
|
+ <select id="getOrderNumberByOrderId" parameterType="int" resultType="string">
|
|
|
+ select OO.ORDER_NUMBER "orderNumber"
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ where OO.ORDER_ID = #{orderId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 获取所有的运力信息 -->
|
|
|
+ <select id="getAllCapacity" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ *
|
|
|
+ from
|
|
|
+ (
|
|
|
+ select
|
|
|
+ RDC.DRIVER_CAPACITY_ID "driverCapacityId",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ RCD.DRIVER_NAME "driverName",
|
|
|
+ RC.CAPACITY_VIP "capacityVip",
|
|
|
+ RCA.CARRIER_NAME "carrierName",
|
|
|
+ RCT.CAPACITY_TYPE_NAME "capacityTypeName",
|
|
|
+ RC.CAPACITY_BLACKLIST "capacityBlacklist",
|
|
|
+ RDC.INSERT_TIME "insertTime"
|
|
|
+ from RMS_DRIVER_CAPACITY RDC
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = RDC.CAPACITY_ID
|
|
|
+ left join RMS_CARRIER RCA
|
|
|
+ on RC.CARRIER_ID = RCA.CARRIER_ID
|
|
|
+ left join RMS_CAR_DRIVER RCD
|
|
|
+ on RCD.DRIVER_ID = RDC.DRIVER_ID
|
|
|
+ left join RMS_CAPACITY_TYPE RCT
|
|
|
+ on RCT.CAPACITY_TYPE_ID = RC.CAPACITY_TYPE_ID
|
|
|
+ <where>
|
|
|
+ <if test="capacityTypeId != null">
|
|
|
+ RC.CAPACITY_TYPE_ID = #{capacityTypeId}
|
|
|
+ </if>
|
|
|
+ <if test="capacityStatus != null">
|
|
|
+ and RC.CAPACITY_STATUS = #{capacityStatus}
|
|
|
+ </if>
|
|
|
+ <if test="carrierId != null">
|
|
|
+ and RC.CARRIER_ID = #{carrierId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="capacityTypeName != null">
|
|
|
+ <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityTypeName" 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="driverName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="driverName" item="item" open="(" separator="or" close=")">
|
|
|
+ "driverName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityVip != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityVip" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityVip" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="carrierName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
|
|
|
+ "carrierName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityBlacklist != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityBlacklist" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityBlacklist" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy">
|
|
|
+ </include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "insertTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 通过Id查询派发时间 -->
|
|
|
+ <select id="getInsertTimeById" parameterType="int" resultType="java.util.Date">
|
|
|
+ select ORDER_ISSUE_TIME
|
|
|
+ from OMSTRUCK_ORDER
|
|
|
+ where ORDER_ID = #{orderId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 通过车牌号匹配运力Id -->
|
|
|
+ <select id="getCapacityIdByCapacityNum" parameterType="string" resultType="java.math.BigDecimal">
|
|
|
+ select CAPACITY_ID
|
|
|
+ from RMS_CAPACITY
|
|
|
+ where CAPACITY_NUMBER = #{capacityNumber}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 通过运输订单ID 或运输订单号 查询 运力ID -->
|
|
|
+ <select id="getCapacityIdByOrderOrNum" parameterType="java.util.Map" resultType="java.math.BigDecimal">
|
|
|
+ select CAPACITY_ID
|
|
|
+ from OMSTRUCK_ORDER
|
|
|
+ <where>
|
|
|
+ <if test="orderId != null">
|
|
|
+ ORDER_ID = #{orderId}
|
|
|
+ </if>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ and ORDER_NUMBER = #{orderNumber}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 通过运力ID 或车牌号 修改 运力状态 -->
|
|
|
+ <update id="updateCapacityByCarIdOrNum" parameterType="java.util.Map">
|
|
|
+ update RMS_CAPACITY RC
|
|
|
+ set RC.CAPACITY_STATUS = #{capacityStatus}
|
|
|
+ where
|
|
|
+ <if test="capacityId != null">
|
|
|
+ RC.CAPACITY_ID = #{capacityId}
|
|
|
+ </if>
|
|
|
+ <if test="capacityNumber != null">
|
|
|
+ RC.CAPACITY_NUMBER = #{capacityNumber}
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 销售物流,通过运力id修改运力状态 -->
|
|
|
+ <update id="updateCapacityById" parameterType="java.util.Map">
|
|
|
+ update RMS_CAPACITY RC
|
|
|
+ set RC.CAPACITY_STATUS = #{capacityStatus}
|
|
|
+ where
|
|
|
+ <if test="driverCapacityId != null">
|
|
|
+ RC.CAPACITY_ID = #{driverCapacityId}
|
|
|
+ </if>
|
|
|
+ <if test="capacityNumber != null">
|
|
|
+ RC.CAPACITY_NUMBER = #{capacityNumber}
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 通过运力ID 查询采购司机接单数据 、通过运单号查询所有运单信息-->
|
|
|
+ <select id="getTruckOrderByCapacityNum" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ select *
|
|
|
+ from (
|
|
|
+ select OO.ORDER_NUMBER "orderNumber",
|
|
|
+ OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
|
|
|
+ OO.ORDER_RECEIVE_REFUSE_TIME "orderReceiveRefuseTime",
|
|
|
+ RW.WAREHOUSE_NAME "warehouseName",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ RW2.WAREHOUSE_NAME "warehouseName2"
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ left join RMS_DRIVER_CAPACITY RDC on OO.DRIVER_CAPACITY_ID = RDC.DRIVER_CAPACITY_ID
|
|
|
+ left join RMS_CAPACITY RC on RC.CAPACITY_ID = RDC.CAPACITY_ID
|
|
|
+ left join OMSTRUCK_ORDER_MATERIAL OOM on OOM.ORDER_ID = OO.ORDER_ID
|
|
|
+ left join RMS_MATERIAL RM on RM.MATERIAL_ID = OOM.MATERIAL_ID
|
|
|
+ left join RMS_WAREHOUSE RW on RW.WAREHOUSE_ID = OO.UNLOAD_POINT_ID
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR on TTR.ORDER_ID = OO.ORDER_ID
|
|
|
+ left join TMSTRUCK_LOAD_RESULT TLR on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ left join RMS_WAREHOUSE RW2 on RW2.WAREHOUSE_ID = TLR.LOADING_ID
|
|
|
+ where OO.ORDER_RECEIVE_STATUS = #{orderReceiveStatus}
|
|
|
+ and OO.ORDER_TYPE = #{orderTypee}
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderMaterialWeight != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderMaterialWeight" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveRefuseTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderReceiveRefuseTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderReceiveRefuseTime" 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="capacityNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="warehouseName2 != null">
|
|
|
+ and
|
|
|
+ <foreach collection="warehouseName2" item="item" open="(" separator="or" close=")">
|
|
|
+ "warehouseName2" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy">
|
|
|
+ </include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "orderReceiveRefuseTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 通过运力ID 查询销售司机接单数据 、通过运单号查询所有运单信息-->
|
|
|
+ <select id="getSaleTruckOrderByCapacityNum" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ distinct *
|
|
|
+ from(
|
|
|
+ select
|
|
|
+ OO.INSERT_TIME "insertTime",
|
|
|
+ OO.ORDER_ID "orderId",
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RC.CAPACITY_NUMBER "carNumber",
|
|
|
+ ASO.SALE_NUMBER "saleNumber",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
|
|
|
+ RS.SHIPPER_NAME "shipperName",
|
|
|
+ RCO.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
|
|
|
+ RRA.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
|
|
|
+ ASOM.SALE_DATE_OF_RECEIPT "saleDateOfReceipt"
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ left join AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
|
|
|
+ left join AMS_SALE_ORDER ASO
|
|
|
+ on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
|
|
|
+ left join RMS_SHIPPER RS
|
|
|
+ on RS.SHIPPER_ID = ASO.SHIPPER_ID
|
|
|
+ left join RMS_CONSIGNEE RCO
|
|
|
+ on RCO.CONSIGNEE_ID = ASO.RECEIVE_ID
|
|
|
+ left join RMS_RECEIVE_ADDRESS RRA
|
|
|
+ on RRA.ADDRESS_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
|
|
|
+ left join RMS_CAPACITY RC --车牌号
|
|
|
+ on RC.CAPACITY_ID = OO.CAPACITY_ID
|
|
|
+ left join OMSTRUCK_ORDER_MATERIAL OOM --物资重量
|
|
|
+ on OOM.ORDER_ID = OO.ORDER_ID
|
|
|
+ left join RMS_MATERIAL RM --物资名称
|
|
|
+ on RM.MATERIAL_ID = OOM.MATERIAL_ID
|
|
|
+
|
|
|
+ <where>
|
|
|
+ <if test="capacityId != null">
|
|
|
+ and OO.CAPACITY_ID = #{capacityId}
|
|
|
+ </if>
|
|
|
+ <if test="orderStatus != null">
|
|
|
+ and OO.ORDER_STATUS = #{orderStatus}
|
|
|
+ </if>
|
|
|
+ <if test="orderId != null">
|
|
|
+ and OO.ORDER_ID = #{orderId}
|
|
|
+ </if>
|
|
|
+ <if test="orderType != null">
|
|
|
+ and OO.ORDER_TYPE = #{orderType}
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveStatus != null">
|
|
|
+ and OO.ORDER_RECEIVE_STATUS = #{orderReceiveStatus}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="carNumber != null">
|
|
|
+ <foreach collection="carNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "carNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="saleNumber != null">
|
|
|
+ <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="materialName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
+ "materialName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderMaterialWeight != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderMaterialWeight" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="shipperName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
|
|
|
+ "shipperName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="consigneeCompanyName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
|
|
|
+ "consigneeCompanyName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="addressDeliveryAddress != null">
|
|
|
+ and
|
|
|
+ <foreach collection="addressDeliveryAddress" item="item" open="(" separator="or" close=")">
|
|
|
+ "addressDeliveryAddress" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="saleDateOfReceipt != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleDateOfReceipt" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleDateOfReceipt" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy">
|
|
|
+ </include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "insertTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询五个作业点名称sql片段 -->
|
|
|
+ <sql id="columnSql">
|
|
|
+ RG1.GATEPOST_NAME "gatepostName1",
|
|
|
+ RG2.GATEPOST_NAME "gatepostName2",
|
|
|
+ RTC1.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
|
|
|
+ RW.WAREHOUSE_NAME "warehouseName",
|
|
|
+ RTC2.TRUCK_CALCULATE_NUMBER "truckCalculateNum",
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="placeSql">
|
|
|
+ left join RMS_GATEPOST RG1 --进厂门岗
|
|
|
+ on RG1.GATEPOST_ID = RL.LINE_START_NODE_ID
|
|
|
+ left join RMS_GATEPOST RG2 --出厂门岗
|
|
|
+ on RG2.GATEPOST_ID = RL.LINE_END_NODE_ID
|
|
|
+
|
|
|
+ left join RMS_LINE_SEGEMNT RLS1
|
|
|
+ on RL.LINE_ID = RLS1.LINE_ID and RLS1.SEGMENT_END_NODE_TYPE = 1
|
|
|
+ left join RMS_TRUCK_CALCULATE RTC1 -- 计毛汽车衡
|
|
|
+ on RLS1.SEGMENT_END_NODE_ID = RTC1.TRUCK_CALCULATE_ID
|
|
|
+
|
|
|
+ left join RMS_LINE_SEGEMNT RLS2
|
|
|
+ on RL.LINE_ID = RLS2.LINE_ID and RLS2.SEGMENT_END_NODE_TYPE = 3
|
|
|
+ left join RMS_WAREHOUSE RW -- 卸货仓库
|
|
|
+ on RW.WAREHOUSE_ID = RLS2.SEGMENT_END_NODE_ID
|
|
|
+
|
|
|
+ left join RMS_LINE_SEGEMNT RLS3
|
|
|
+ on RL.LINE_ID = RLS3.LINE_ID and RLS3.SEGMENT_END_NODE_TYPE = 2
|
|
|
+ left join RMS_TRUCK_CALCULATE RTC2 -- 计皮汽车衡
|
|
|
+ on RLS3.SEGMENT_END_NODE_ID = RTC2.TRUCK_CALCULATE_ID
|
|
|
+ </sql>
|
|
|
+ <!-- 通过运力ID 查询司机所有已拒绝已接收的订单 -->
|
|
|
+ <select id="getReceiveRefuseOrderByCapacityId" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ select OO.ORDER_ID "orderId",
|
|
|
+ OO.ORDER_NUMBER "orderNumber"
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ where CAPACITY_ID = #{capacityId}
|
|
|
+ and ORDER_RECEIVE_STATUS = 0
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询实绩流程 -->
|
|
|
+ <select id="selectPlaceAndTime" parameterType="DECIMAL" resultType="java.util.Map">
|
|
|
+ SELECT ERG.GATEPOST_NAME as "entryGatepost",
|
|
|
+ TER.RESULT_ENTRY_GATE_TIME as "entryTime",
|
|
|
+ GRTC.TRUCK_CALCULATE_NUMBER as "grossCalculate",
|
|
|
+ TWR.RESULT_GROSS_WEIGHT_TIME as "grossTime",
|
|
|
+ RW.WAREHOUSE_NAME as "unloadWarhouse",
|
|
|
+ TUR.RESULT_START_TIME as "unloadTime",
|
|
|
+ TRTC.TRUCK_CALCULATE_NUMBER as "tareCalculate",
|
|
|
+ TWR.RESULT_TARE_WEIGHT_TIME as "tareTime",
|
|
|
+ LRG.GATEPOST_NAME as "leaveGatepost",
|
|
|
+ TLFR.RESULT_OUT_GATE_TIME as "outTime",
|
|
|
+ RWR.WAREHOUSE_NAME as "receiptWarhouse",
|
|
|
+ TRR.INSERT_TIME as "receiptTime",
|
|
|
+ OO.ORDER_LINE_SEQUENCE as "orderLineSequence",
|
|
|
+ OO.ORDER_TYPE as "orderType"
|
|
|
+ FROM OMSTRUCK_ORDER OO
|
|
|
+ LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ ON TTR.ORDER_ID = OO.ORDER_ID
|
|
|
+ LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER
|
|
|
+ ON TTR.RESULT_TOTAL_ID = TER.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN RMS_GATEPOST ERG --进厂门岗
|
|
|
+ ON ERG.GATEPOST_ID = TER.GATEPOST_ID
|
|
|
+ LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
|
|
|
+ ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN RMS_TRUCK_CALCULATE GRTC --毛重汽车衡
|
|
|
+ ON TWR.RESULT_GROSS_PLACE_ID = GRTC.TRUCK_CALCULATE_ID
|
|
|
+ LEFT JOIN RMS_TRUCK_CALCULATE TRTC --皮重汽车衡
|
|
|
+ ON TWR.RESULT_TARE_PLACE_ID = TRTC.TRUCK_CALCULATE_ID
|
|
|
+ LEFT JOIN TMSTRUCK_UNLOAD_RESULT TUR
|
|
|
+ ON TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN RMS_WAREHOUSE RW --卸货点
|
|
|
+ ON RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
|
|
|
+ LEFT JOIN TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
|
|
|
+ ON TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN RMS_GATEPOST LRG --出厂门岗
|
|
|
+ ON LRG.GATEPOST_ID = TLFR.GATEPOST_ID
|
|
|
+ LEFT JOIN TMSTRUCK_RECEIPT_RESULT TRR
|
|
|
+ ON TRR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN RMS_WAREHOUSE RWR --异地库
|
|
|
+ ON TRR.WAREHOUSE_ID = RWR.WAREHOUSE_ID
|
|
|
+ WHERE OO.ORDER_ID = #{orderId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 通过运输订单ID查询运输订单相关信息 -->
|
|
|
+ <select id="getOrderByOrderId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
|
|
|
+ SELECT APO.PURCHASE_ORDER_NO "purchaseOrderNo",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ RM.MATERIAL_ID "materialId",
|
|
|
+ OO.ORDER_ENTRY_TIME "orderEntryTime",
|
|
|
+ OO.ORDER_TYPE "orderType",
|
|
|
+ OO.UNLOAD_POINT_ID "unloadPointId"
|
|
|
+ FROM OMSTRUCK_ORDER OO
|
|
|
+ left join RMS_DRIVER_CAPACITY RDC
|
|
|
+ on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
|
|
|
+ LEFT JOIN RMS_CAPACITY RC
|
|
|
+ ON RDC.CAPACITY_ID = RC.CAPACITY_ID
|
|
|
+ left join AMS_PURCHASE_ORDER APO
|
|
|
+ on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
|
|
|
+ left join OMSTRUCK_ORDER_MATERIAL OOM
|
|
|
+ on OOM.ORDER_ID = OO.ORDER_ID
|
|
|
+ left join RMS_MATERIAL RM
|
|
|
+ on RM.MATERIAL_ID = OOM.MATERIAL_ID
|
|
|
+ WHERE OO.ORDER_ID = #{orderId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 通过运输订单号查询各路段预设作业点 以及总实绩ID -->
|
|
|
+ <select id="getPointIdByOrderNum" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ RL.LINE_START_NODE_ID "lineStartNodeId",
|
|
|
+ RL.LINE_END_NODE_ID "lineEndNodeId",
|
|
|
+ RLS1.SEGMENT_END_NODE_ID "truckCalculateIdMao",
|
|
|
+ RLS2.SEGMENT_END_NODE_ID "truckCalculateIdPi",
|
|
|
+ RLS3.SEGMENT_END_NODE_ID "resultUnloadPlaceId",
|
|
|
+ TTR.RESULT_TOTAL_ID "resultTotalId",
|
|
|
+ OO.ORDER_TYPE "orderType"
|
|
|
+
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ left join RMS_LINE RL
|
|
|
+ on RL.LINE_ID = OO.LINE_ID
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on TTR.ORDER_ID = OO.ORDER_ID
|
|
|
+ left join RMS_LINE_SEGEMNT RLS1 --查询计毛汽车衡
|
|
|
+ on RL.LINE_ID = RLS1.LINE_ID and RLS1.SEGMENT_END_NODE_TYPE = 1
|
|
|
+ left join RMS_LINE_SEGEMNT RLS2 --查询计皮汽车衡
|
|
|
+ on RL.LINE_ID = RLS2.LINE_ID and RLS2.SEGMENT_END_NODE_TYPE = 2
|
|
|
+ left join RMS_LINE_SEGEMNT RLS3 --查询卸货点
|
|
|
+ on RL.LINE_ID = RLS3.LINE_ID and RLS3.SEGMENT_END_NODE_TYPE = 3
|
|
|
+
|
|
|
+ <where>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ OO.ORDER_NUMBER = #{orderNumber}
|
|
|
+ </if>
|
|
|
+ <if test="orderId != null">
|
|
|
+ and OO.ORDER_ID = #{orderId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询运输派单信息 -->
|
|
|
+ <select id="getTransportDispatch" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ *
|
|
|
+ from(
|
|
|
+ select
|
|
|
+ APO.PURCHASE_ORDER_NO "purchaseOrderNo",
|
|
|
+ RS.SUPPLIER_NAME "supplierName",
|
|
|
+ RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
|
|
|
+ RW.WAREHOUSE_NAME "warehouseName",
|
|
|
+ RCON.CONSIGNEE_CONTACT_NAME "consigneeContactName",
|
|
|
+ RCON.CONSIGNEE_CONTACT_TEL "consigneeContactTel",
|
|
|
+ APO.PUCHASE_ORDER_DELIVERY_DATE "puchaseOrderDeliveryDate",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
|
|
|
+ OO.ORDER_ISSUE_TIME "orderIssueTime",
|
|
|
+ OO.ORDER_RECEIVE_REFUSE_TIME "orderReceiveRefuseTime",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ RCD.DRIVER_NAME "driverName"
|
|
|
+
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ left join AMS_PURCHASE_ORDER APO
|
|
|
+ on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
|
|
|
+ left join OMSTRUCK_ORDER_MATERIAL OOM
|
|
|
+ on OOM.ORDER_ID = OO.ORDER_ID
|
|
|
+ left join RMS_MATERIAL RM
|
|
|
+ on RM.MATERIAL_ID = OOM.MATERIAL_ID
|
|
|
+ left join RMS_SUPPLIER RS
|
|
|
+ on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
|
|
|
+ left join RMS_CONSIGNEE RCON
|
|
|
+ on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
|
|
|
+ left join RMS_WAREHOUSE RW
|
|
|
+ on RW.WAREHOUSE_ID = OO.UNLOAD_POINT_ID
|
|
|
+ left join RMS_DRIVER_CAPACITY RDC
|
|
|
+ on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = RDC.CAPACITY_ID
|
|
|
+ left join RMS_CAR_DRIVER RCD
|
|
|
+ on RCD.DRIVER_ID = RDC.DRIVER_ID
|
|
|
+ <where>
|
|
|
+ <if test="orderStatus != null">
|
|
|
+ OO.ORDER_STATUS = #{orderStatus}
|
|
|
+ </if>
|
|
|
+ <if test="orderTypee != null">
|
|
|
+ and OO.ORDER_TYPE = #{orderTypee}
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveStatus != null">
|
|
|
+ and OO.ORDER_RECEIVE_STATUS = #{orderReceiveStatus}
|
|
|
+ </if>
|
|
|
+ <if test="fuelOrder != null">
|
|
|
+ and OO.ORDER_TYPE in (6, 7)
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="purchaseOrderNo != null">
|
|
|
+ <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
|
|
|
+ "purchaseOrderNo" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="supplierName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
|
|
|
+ "supplierName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="consigneeCompanyName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
|
|
|
+ "consigneeCompanyName" 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="consigneeContactName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="consigneeContactName" item="item" open="(" separator="or" close=")">
|
|
|
+ "consigneeContactName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="consigneeContactTel != null">
|
|
|
+ and
|
|
|
+ <foreach collection="consigneeContactTel" item="item" open="(" separator="or" close=")">
|
|
|
+ "consigneeContactTel" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="puchaseOrderDeliveryDate != null">
|
|
|
+ and
|
|
|
+ <foreach collection="puchaseOrderDeliveryDate" item="item" open="(" separator="or" close=")">
|
|
|
+ "puchaseOrderDeliveryDate" 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="orderMaterialWeight != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderMaterialWeight" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderReceiveRefuseTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderReceiveRefuseTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderReceiveRefuseTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderIssueTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderIssueTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderIssueTime" 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="driverName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="driverName" item="item" open="(" separator="or" close=")">
|
|
|
+ "driverName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy">
|
|
|
+ </include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "orderReceiveRefuseTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询已下发已接受的销售订单信息 -->
|
|
|
+ <select id="getOrderReceived" parameterType="DECIMAL" resultType="java.util.Map">
|
|
|
+ SELECT aso.SALE_NUMBER as "saleNumber",
|
|
|
+ oo.ORDER_NUMBER as "orderNumber",
|
|
|
+ oo.INSERT_USERNAME as "insertUsername",
|
|
|
+ rc.CAPACITY_NUMBER as "capacityNumber"
|
|
|
+ FROM OMSTRUCK_ORDER oo
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL asom
|
|
|
+ ON asom.SALE_ORDER_MATERIAL_ID = oo.ORDER_PLAN_ID
|
|
|
+ LEFT JOIN AMS_SALE_ORDER aso
|
|
|
+ ON aso.SALE_ORDER_ID = asom.SALE_ORDER_ID
|
|
|
+ LEFT JOIN RMS_CAPACITY rc
|
|
|
+ ON rc.CAPACITY_ID = oo.CAPACITY_ID
|
|
|
+ WHERE oo.ORDER_ISSUE_TIME IS NOT NULL
|
|
|
+ AND oo.ORDER_RECEIVE_STATUS = 1
|
|
|
+ AND oo.ORDER_TYPE = #{orderType}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--查询司机排班信息-->
|
|
|
+ <select id="selectCapacityAndDriver" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ RDC.CAPACITY_ID "capacityId",
|
|
|
+ RDC.DRIVER_CAPACITY_ID "driverCapacityId",
|
|
|
+ RC.CAPACITY_NUMBER "number",
|
|
|
+ RCT.CAPACITY_TYPE_NAME "capacityTypeName",
|
|
|
+ RCD.DRIVER_NAME "name"
|
|
|
+
|
|
|
+ FROM
|
|
|
+ RMS_DRIVER_CAPACITY RDC
|
|
|
+ LEFT JOIN RMS_CAPACITY RC ON RDC.CAPACITY_ID = RC.CAPACITY_ID
|
|
|
+ LEFT JOIN RMS_CAPACITY_TYPE RCT ON RCT.CAPACITY_TYPE_ID = RC.CAPACITY_TYPE_ID
|
|
|
+ LEFT JOIN RMS_CAR_DRIVER RCD ON RCD.DRIVER_ID = RDC.DRIVER_ID
|
|
|
+ WHERE
|
|
|
+ RC.CAPACITY_STATUS =0 and RC.CARRIER_ID=#{carrierId}
|
|
|
+ <where>
|
|
|
+ <if test="capacityId != null">
|
|
|
+ <foreach collection="capacityId" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityId" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="number != null">
|
|
|
+ <foreach collection="number" item="item" open="(" separator="or" close=")">
|
|
|
+ "number" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityTypeName != null">
|
|
|
+ <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityTypeName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ <foreach collection="name" item="item" open="(" separator="or" close=")">
|
|
|
+ "name" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--根据id查找用户名 -->
|
|
|
+ <select id="selectPersonNameByPersonnelId" resultType="java.lang.String" parameterType="java.lang.Integer">
|
|
|
+ select RP.PERSONNEL_NAME "personnelName"
|
|
|
+ from RMS_PERSONNEL RP
|
|
|
+ where RP.PERSONNEL_ID = #{personnelId}
|
|
|
+ </select>
|
|
|
+ <!-- 通过车牌号、承运商匹配最新的运力id-->
|
|
|
+ <select id="selectCapacityId" parameterType="java.util.Map" resultType="java.math.BigDecimal">
|
|
|
+ select t.CAPACITY_ID
|
|
|
+ from RMS_CAPACITY t
|
|
|
+ where t.CAPACITY_ID = #{capacityId}
|
|
|
+ and t.CAPACITY_NUMBER = #{capacityNumber}
|
|
|
+ </select>
|
|
|
+ <!-- 通过运输订单号或运输订单ID查询总实绩ID和订单类型 -->
|
|
|
+ <select id="getResultTotalIdByOrderNumAndId" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ TTR.RESULT_TOTAL_ID "resultTotalId",
|
|
|
+ OO.ORDER_TYPE "orderType"
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on TTR.ORDER_ID = OO.ORDER_ID
|
|
|
+ <where>
|
|
|
+ <if test="orderId != null">
|
|
|
+ OO.ORDER_ID= #{orderId}
|
|
|
+ </if>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ and OO.ORDER_NUMBER = #{orderNumber}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--通过运输订单ID查询数据 用于websocket推送数据 如果订单实绩中有卸货点 没有卸货点通过传入的卸货点进行查询-->
|
|
|
+ <select id="pushMesToWebsocket" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ select OO.ORDER_NUMBER "orderNumber",
|
|
|
+ OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber"
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ left join RMS_DRIVER_CAPACITY RDC
|
|
|
+ on OO.DRIVER_CAPACITY_ID = RDC.DRIVER_CAPACITY_ID
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = RDC.CAPACITY_ID
|
|
|
+ left join OMSTRUCK_ORDER_MATERIAL OOM
|
|
|
+ on OOM.ORDER_ID = OO.ORDER_ID
|
|
|
+ left join RMS_MATERIAL RM
|
|
|
+ on RM.MATERIAL_ID = OOM.MATERIAL_ID
|
|
|
+ left join RMS_WAREHOUSE RW
|
|
|
+ on RW.WAREHOUSE_ID = OO.UNLOAD_POINT_ID
|
|
|
+ where OO.ORDER_ID = #{orderId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- //通过物资id查询批次表匹配最新的批次,关联最新的采购订单号 -->
|
|
|
+ <select id="selectNewOrderId" parameterType="java.math.BigDecimal" resultType="string">
|
|
|
+ select *
|
|
|
+ from (select apo.PURCHASE_ORDER_NO
|
|
|
+ from DIL_BATCH db
|
|
|
+ join AMS_PURCHASE_ORDER apo on apo.BATCH_ID = db.BATCH_ID
|
|
|
+ where db.MATERIAL_ID = #{materialId}
|
|
|
+ order by db.INSERT_TIME desc)
|
|
|
+ where rownum = 1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--通过运输订单Id查询运输订单子表有几种物资 :物资ID-->
|
|
|
+ <select id="getMaterialIdListByOrderId" parameterType="int" resultType="java.lang.Integer">
|
|
|
+ select OOM.MATERIAL_ID
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ left join OMSTRUCK_ORDER_MATERIAL OOM
|
|
|
+ on OOM.ORDER_ID = OO.ORDER_ID
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 通过采购订单号查找采购订单ID -->
|
|
|
+ <select id="getPurchaseOrderIdByNo" parameterType="string" resultType="java.math.BigDecimal">
|
|
|
+ select APO.PURCHASE_ORDER_ID
|
|
|
+ from AMS_PURCHASE_ORDER APO
|
|
|
+ where APO.PURCHASE_ORDER_NO = #{purchaseOrderNo}
|
|
|
+ </select>
|
|
|
+ <select id="getSaleTruckOrderByCapacityId" resultType="java.util.Map">
|
|
|
+ select oo.ORDER_ID "orderId",
|
|
|
+ oo.order_number "orderNumber",
|
|
|
+ rc.capacity_number "capacityNumber",
|
|
|
+ aso.sale_number "saleOrderNumber",
|
|
|
+ rs.shipper_name "shipperUnit",
|
|
|
+ rce.consignee_company_name "receiveUnit",
|
|
|
+ to_char(oo.order_issue_time, 'yyyy-mm-dd') "shipperDate",
|
|
|
+ rca.address_delivery_address "receiveAddress",
|
|
|
+ asom.sale_date_of_receipt "receiveDate"
|
|
|
+ from omstruck_order oo
|
|
|
+ left join rms_driver_capacity rdc
|
|
|
+ on rdc.driver_capacity_id = oo.driver_capacity_id
|
|
|
+ left join rms_capacity rc
|
|
|
+ on rc.capacity_id = rdc.capacity_id
|
|
|
+ left join omstruck_order_material oom
|
|
|
+ on oom.order_id = oo.order_id
|
|
|
+ left join ams_sale_order_material asom
|
|
|
+ on asom.sale_order_material_id = oo.order_plan_id
|
|
|
+ left join ams_sale_order aso
|
|
|
+ on aso.sale_order_id = asom.sale_order_id
|
|
|
+ left join rms_shipper rs
|
|
|
+ on rs.shipper_id = aso.shipper_id
|
|
|
+ left join rms_consignee rce
|
|
|
+ on rce.consignee_id = aso.receive_id
|
|
|
+ left join rms_receive_address rca
|
|
|
+ on rca.address_id = asom.sale_shipping_address_id
|
|
|
+ where rdc.capacity_id = #{capacityId}
|
|
|
+ and oo.order_status = #{orderStatus}
|
|
|
+ and oo.order_type = #{orderType}
|
|
|
+ </select>
|
|
|
+ <select id="getSaleTruckOrderByCapacityNumMaterial" resultType="java.util.Map">
|
|
|
+ select rm.material_name "materialName",
|
|
|
+ oom.order_material_weight "materialWeight"
|
|
|
+ from omstruck_order oo
|
|
|
+ left join rms_driver_capacity rdc
|
|
|
+ on rdc.driver_capacity_id = oo.driver_capacity_id
|
|
|
+ left join rms_capacity rc
|
|
|
+ on rc.capacity_id = rdc.capacity_id
|
|
|
+ left join omstruck_order_material oom
|
|
|
+ on oom.order_id = oo.order_id
|
|
|
+ left join rms_material rm
|
|
|
+ on rm.material_id = oom.material_id
|
|
|
+ where rdc.capacity_id = #{capacityId}
|
|
|
+ and oo.order_status = #{orderStatus}
|
|
|
+ and oo.order_type = #{orderType}
|
|
|
+
|
|
|
+ </select>
|
|
|
+ <!-- 通过车序号查找物资id -->
|
|
|
+ <select id="selectMaterialIdBysaleOrderMaterialId" resultType="java.util.Map" parameterType="java.lang.Integer">
|
|
|
+ SELECT ASTM.MATERIAL_ID "materialId"
|
|
|
+ FROM AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.TRUCKNO_MATERIAL_ID
|
|
|
+ WHERE ASOM.SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
|
|
|
+ </select>
|
|
|
+ <!--通过销售订单物资ID查找物资理重和物资件数-->
|
|
|
+ <select id="selectTheoreticalWeightAndMaterialNumber" resultType="java.util.Map" parameterType="java.lang.Integer">
|
|
|
+ SELECT ASTM.SALE_ORDER_MATERIAL_NUMBER "materialNumber",
|
|
|
+ ASTM.MATERIAL_THEORETICAL_WEIGHT "weight"
|
|
|
+
|
|
|
+ from AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
+ ON ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ WHERE ASTM.SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
|
|
|
+ </select>
|
|
|
+ <!--销售,查看运输订单(钢材销售订单)并根据司机接受或者拒绝时间进行排序 -->
|
|
|
+ <select id="selectTransportOrderForSale" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ SELECT *
|
|
|
+ from(
|
|
|
+ select
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ ASO.SALE_NUMBER "saleNumber",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ OOM.ORDER_MATERIAL_WEIGHT "orderMaterialweight",
|
|
|
+ OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
|
|
|
+ RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
|
|
|
+ RC2.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
|
|
|
+ RRA.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
|
|
|
+ ASOM.SALE_DATE_OF_RECEIPT "saleDateOfReceipt",
|
|
|
+ OO.ORDER_RECEIVE_REFUSE_TIME "orderReceiveRefuseTime",
|
|
|
+ RS.SHIPPER_NAME "shipperName"
|
|
|
+
|
|
|
+ FROM OMSTRUCK_ORDER OO
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
|
|
|
+ ON OO.ORDER_ID=OOM.ORDER_ID
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ ON ASOM.SALE_ORDER_MATERIAL_ID=OO.ORDER_PLAN_ID
|
|
|
+ LEFT JOIN AMS_SALE_ORDER ASO
|
|
|
+ ON ASO.SALE_ORDER_ID=ASOM.SALE_ORDER_ID
|
|
|
+ LEFT JOIN RMS_CONSIGNEE RC2
|
|
|
+ ON RC2.CONSIGNEE_ID=ASO.RECEIVE_ID
|
|
|
+
|
|
|
+ LEFT JOIN RMS_DRIVER_CAPACITY RDC
|
|
|
+ ON RDC.DRIVER_CAPACITY_ID=OO.DRIVER_CAPACITY_ID
|
|
|
+ LEFT JOIN RMS_CAPACITY RC
|
|
|
+ ON RDC.CAPACITY_ID=RC.CAPACITY_ID
|
|
|
+ LEFT JOIN RMS_MATERIAL RM
|
|
|
+ ON OOM.MATERIAL_ID=RM.MATERIAL_ID
|
|
|
+ LEFT JOIN RMS_SHIPPER RS
|
|
|
+ ON RS.SHIPPER_ID=ASO.SHIPPER_ID
|
|
|
+ LEFT JOIN RMS_RECEIVE_ADDRESS RRA
|
|
|
+ ON RRA.ADDRESS_ID=ASOM.SALE_SHIPPING_ADDRESS_ID
|
|
|
+ <where>
|
|
|
+ <if test="orderStatus!=null">
|
|
|
+ AND OO.ORDER_STATUS = #{orderStatus}
|
|
|
+ </if>
|
|
|
+ <if test="carrierId!=null">
|
|
|
+ and RDC.CARRIER_ID = #{carrierId}
|
|
|
+ </if>
|
|
|
+ <if test="orderType!=null">
|
|
|
+ and OO.ORDER_TYPE=#{orderType}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="saleNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNumber" 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="orderMaterialweight != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderMaterialweight" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderMaterialweight" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderMaterialweight != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderMaterialweight" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderMaterialweight" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="consigneeCompanyName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
|
|
|
+ "consigneeCompanyName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="consigneeCompanyName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
|
|
|
+ "consigneeCompanyName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy">
|
|
|
+ </include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "orderReceiveRefuseTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <!--根据车序号查找销售订单 -->
|
|
|
+ <select id="selectSaleBySaleOrderMaterialId" parameterType="java.lang.Integer" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ ASO.SALE_NUMBER "saleNumber",
|
|
|
+ RS.SHIPPER_NAME "shipperName",
|
|
|
+ RC.CONSIGNEE_COMPANY_NAME "consigneeName",
|
|
|
+ RRA.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_TRUCK_NO "truckNo",
|
|
|
+ ASOM.SALE_DATE_OF_RECEIPT "receiptOfdate",
|
|
|
+ ASOM.SALE_ORDER_CONSIGNEE "saleOrderConsignee",
|
|
|
+ ASOM.SALE_ORDER_CONSIGNEE_TEL "saleOrderConsigneeTel",
|
|
|
+ ASOM.INSERT_UPDATE_REMARK "insertUpdateRemark",
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_ID "saleOrderMaterialId",
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ASTM.SALE_ORDER_MATERIAL_NUMBER
|
|
|
+ FROM
|
|
|
+ AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
|
|
|
+ WHERE
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
|
|
|
+ ) "saleOrderMaterialNumber",
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ASTM.MATERIAL_THEORETICAL_WEIGHT
|
|
|
+ FROM
|
|
|
+ AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
|
|
|
+ WHERE
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
|
|
|
+ ) "materialTheoreticalWeight",
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ RM.MATERIAL_NAME "materialName"
|
|
|
+ FROM
|
|
|
+ AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
+ LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = ASTM.MATERIAL_ID
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
|
|
|
+ WHERE
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
|
|
|
+ ) "materialName",
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ASTM.MATERIAL_ID "materialId"
|
|
|
+ FROM
|
|
|
+ AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
+ LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = ASTM.MATERIAL_ID
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
|
|
|
+ WHERE
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
|
|
|
+ ) "materialId"
|
|
|
+ FROM
|
|
|
+ AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ LEFT JOIN AMS_SALE_ORDER ASO ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
|
|
|
+ LEFT JOIN RMS_SHIPPER RS ON ASO.SHIPPER_ID = RS.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
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_ID=#{saleOrderMaterialId}
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 根据承运商查找销售订单 -->
|
|
|
+ <select id="selectSaleMaterialIdByCarrierId" resultType="java.util.Map" parameterType="java.lang.Integer">
|
|
|
+ select ADSO.SALE_ORDER_MATERIAL_ID "saleOrderMaterialId"
|
|
|
+ from AMS_DISPATCH_SALE_ORDER ADSO
|
|
|
+ where ADSO.CARRIER_ID = #{carrierId}
|
|
|
+ </select>
|
|
|
+ <!-- 查询所有下发的销售订单,根据下发状态进行筛选-->
|
|
|
+ <select id="selectSaleNumberForCarrier" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
+ SELECT ASO.SALE_NUMBER "saleNumber",
|
|
|
+ RC.CONSIGNEE_COMPANY_NAME "companyName",
|
|
|
+ RS.SHIPPER_NAME "shipperName"
|
|
|
+ FROM AMS_SALE_ORDER ASO
|
|
|
+ LEFT JOIN RMS_CONSIGNEE RC
|
|
|
+ ON ASO.RECEIVE_ID = RC.CONSIGNEE_ID
|
|
|
+ LEFT JOIN RMS_SHIPPER RS
|
|
|
+ ON RS.SHIPPER_ID = ASO.SHIPPER_ID
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
|
|
|
+ WHERE ASOM.SALE_ORDER_MATERIAL_ID = #{saleMaterialId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 查询所有已接收的焦炭发运计划 -->
|
|
|
+ <select id="selectCokeDayPlanAndRecived" resultType="java.util.Map" parameterType="java.lang.Integer">
|
|
|
+ select * from (
|
|
|
+ select
|
|
|
+ ARD.DAYPLAN_ID "dayPlanId",
|
|
|
+ ARD.DAYPLAN_NO "No",
|
|
|
+ RS.SHIPPER_NAME "shipperName",
|
|
|
+ ARD.DAYPLAN_TRUCK_NUMBER "TruckNumber",
|
|
|
+ ARD.DAYPLAN_DELIVERY_PLACE "DayPlanDeliveryPlace",
|
|
|
+ ARD.DAYPLAN_RECEIVE_UNIT "receiveUnit",
|
|
|
+ ARD.DAYPLAN_DELIVERY_DATE "deliveryDate",
|
|
|
+ ARD.DAYPLAN_MATERIAL_WEIGHT "weight",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ ARD.INSERT_UPDATE_REMARK "remark",
|
|
|
+ ARD.INSERT_TIME "insertTime"
|
|
|
+
|
|
|
+ FROM AMSTRUCK_RAIL_DAYPLAN ARD
|
|
|
+ left join RMS_SHIPPER RS
|
|
|
+ on ARD.SHIPMENT_UNIT_ID =RS.SHIPPER_ID
|
|
|
+ left join RMS_MATERIAL RM
|
|
|
+ on RM.MATERIAL_ID=ARD.MATERIAL_ID
|
|
|
+ left Join RMS_MATERIAL_TYPE RMT
|
|
|
+ on RMT.MATERIAL_TYPE_ID=RM.MATERIAL_TYPE_ID
|
|
|
+ where ARD.DAYPLAN_RECEIVE_STATUS=1 and ARD.CARRIER_ID=#{carrierId}
|
|
|
+
|
|
|
+ )
|
|
|
+ <!-- <where>-->
|
|
|
+ <!-- <if test="shipperName != null">-->
|
|
|
+ <!-- and-->
|
|
|
+ <!-- <foreach collection="shipperName" item="item" open="(" separator="or" close=")">-->
|
|
|
+ <!-- "shipperName" like '%${item}%'-->
|
|
|
+ <!-- </foreach>-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!-- <if test="TruckNumber != null">-->
|
|
|
+ <!-- and-->
|
|
|
+ <!-- <foreach collection="TruckNumber" item="item" open="(" separator="or" close=")">-->
|
|
|
+ <!-- "TruckNumber" like '%${item}%'-->
|
|
|
+ <!-- </foreach>-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!-- <if test="DayPlanDeliveryPlace != null">-->
|
|
|
+ <!-- and-->
|
|
|
+ <!-- <foreach collection="DayPlanDeliveryPlace" item="item" open="(" separator="or" close=")">-->
|
|
|
+ <!-- "DayPlanDeliveryPlace" like '%${item}%'-->
|
|
|
+ <!-- </foreach>-->
|
|
|
+ <!-- <if test="receiveUnit != null">-->
|
|
|
+ <!-- and-->
|
|
|
+ <!-- <foreach collection="receiveUnit" item="item" open="(" separator="or" close=")">-->
|
|
|
+ <!-- "receiveUnit" 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="remark != null">-->
|
|
|
+ <!-- and-->
|
|
|
+ <!-- <foreach collection="remark" item="item" open="(" separator="or" close=")">-->
|
|
|
+ <!-- "remark" like '%${item}%'-->
|
|
|
+ <!-- </foreach>-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!--</where>-->
|
|
|
+ <!-- <include refid="orderBy">-->
|
|
|
+ <!-- </include>-->
|
|
|
+ <!-- <if test="orderField == null ">-->
|
|
|
+ <!-- order by "insertTime" desc-->
|
|
|
+ <!-- </if>-->
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--查询所有已接收的水渣发运计划-->
|
|
|
+ <select id="selectWaterSlagDayPlanAndRecived" resultType="java.util.Map" parameterType="java.lang.Integer">
|
|
|
+ SELECT *
|
|
|
+ FROM (
|
|
|
+ SELECT
|
|
|
+ ARD.DAYPLAN_ID "dayPlanId",
|
|
|
+ ARD.DAYPLAN_NO "No",
|
|
|
+ RS.SHIPPER_NAME "shipperName",
|
|
|
+ ARD.DAYPLAN_RECEIVE_UNIT "receiveUnit",
|
|
|
+ ARD.DAYPLAN_DELIVERY_DATE "deliveryDate",
|
|
|
+ ARD.DAYPLAN_MATERIAL_WEIGHT "weight",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ ARD.INSERT_UPDATE_REMARK "remark",
|
|
|
+ ARD.INSERT_TIME "insertTime"
|
|
|
+ FROM AMSTRUCK_RAIL_DAYPLAN ARD
|
|
|
+ LEFT JOIN RMS_SHIPPER RS
|
|
|
+ ON ARD.SHIPMENT_UNIT_ID =RS.SHIPPER_ID
|
|
|
+ LEFT JOIN RMS_MATERIAL RM
|
|
|
+ ON RM.MATERIAL_ID=ARD.MATERIAL_ID
|
|
|
+ LEFT JOIN RMS_MATERIAL_TYPE RMT
|
|
|
+ ON RMT.MATERIAL_TYPE_ID=RM.MATERIAL_TYPE_ID
|
|
|
+ where ARD.DAYPLAN_RECEIVE_STATUS=1 AND ARD.CARRIER_ID=#{carrierId}
|
|
|
+ )
|
|
|
+ <!--<where>-->
|
|
|
+ <!-- <if test="shipperName != null">-->
|
|
|
+ <!-- and-->
|
|
|
+ <!-- <foreach collection="shipperName" item="item" open="(" separator="or" close=")">-->
|
|
|
+ <!-- "shipperName" like '%${item}%'-->
|
|
|
+ <!-- </foreach>-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!-- <if test="DayPlanDeliveryPlace != null">-->
|
|
|
+ <!-- and-->
|
|
|
+ <!-- <foreach collection="DayPlanDeliveryPlace" item="item" open="(" separator="or" close=")">-->
|
|
|
+ <!-- "DayPlanDeliveryPlace" like '%${item}%'-->
|
|
|
+ <!-- </foreach>-->
|
|
|
+ <!-- <if test="receiveUnit != null">-->
|
|
|
+ <!-- and-->
|
|
|
+ <!-- <foreach collection="receiveUnit" item="item" open="(" separator="or" close=")">-->
|
|
|
+ <!-- "receiveUnit" 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="remark != null">-->
|
|
|
+ <!-- and-->
|
|
|
+ <!-- <foreach collection="remark" item="item" open="(" separator="or" close=")">-->
|
|
|
+ <!-- "remark" like '%${item}%'-->
|
|
|
+ <!-- </foreach>-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!--</where>-->
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!--根据发运计划id查找物资id -->
|
|
|
+ <select id="selectMaterialIdAndWeightByDayPlanId" resultType="java.util.Map" parameterType="java.lang.Integer">
|
|
|
+ select APM.MATERIAL_ID "materialId",
|
|
|
+ APM.DAYPLAN_MATERIAL_WEIGHT "materialWeight"
|
|
|
+ from AMSTRUCK_RAIL_DAYPLAN APM
|
|
|
+ WHERE APM.DAYPLAN_ID = #{dayPlanId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!--查询根据销售订单生成的运输订单 -->
|
|
|
+ <select id="selectAllOrderForSale" resultType="java.util.LinkedHashMap" parameterType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ ASO.SALE_NUMBER "saleNumber",
|
|
|
+ RS.SHIPPER_NAME "shipperName",
|
|
|
+ RC.CONSIGNEE_COMPANY_NAME "consigneeName",
|
|
|
+ RRA.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_TRUCK_NO "truckNo",
|
|
|
+ ASOM.SALE_DATE_OF_RECEIPT "receiptOfdate",
|
|
|
+ ASOM.SALE_ORDER_CONSIGNEE "saleOrderConsignee",
|
|
|
+ ASOM.SALE_ORDER_CONSIGNEE_TEL "saleOrderConsigneeTel",
|
|
|
+ ASOM.INSERT_UPDATE_REMARK "insertUpdateRemark",
|
|
|
+ RC2.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ OO.ORDER_ID "orderId",
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ASTM.SALE_ORDER_MATERIAL_NUMBER
|
|
|
+ FROM
|
|
|
+ AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
|
|
|
+ WHERE
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
|
|
|
+ ) "saleOrderMaterialNumber",
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ASTM.MATERIAL_THEORETICAL_WEIGHT
|
|
|
+ FROM
|
|
|
+ AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
|
|
|
+ WHERE
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
|
|
|
+ ) "materialTheoreticalWeight",
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ RM.MATERIAL_NAME "materialName"
|
|
|
+ FROM
|
|
|
+ AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
+ LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = ASTM.MATERIAL_ID
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
|
|
|
+ WHERE
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
|
|
|
+ ) "materialName",
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ASTM.MATERIAL_ID "materialId"
|
|
|
+ FROM
|
|
|
+ AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
+ LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = ASTM.MATERIAL_ID
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
|
|
|
+ WHERE
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
|
|
|
+ ) "materialId"
|
|
|
+
|
|
|
+ FROM OMSTRUCK_ORDER OO
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID=OO.ORDER_PLAN_ID
|
|
|
+ LEFT JOIN AMS_SALE_ORDER ASO ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
|
|
|
+ LEFT JOIN RMS_SHIPPER RS ON ASO.SHIPPER_ID = RS.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
|
|
|
+ LEFT JOIN RMS_CAPACITY RC2 ON RC2.CAPACITY_ID=OO.CAPACITY_ID
|
|
|
+ <where>
|
|
|
+ <if test="saleOrderMaterialId != null">
|
|
|
+ and ASOM.SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
|
|
|
+ </if>
|
|
|
+ <if test="orderStatus!=null">
|
|
|
+ and OO.ORDER_STATUS = #{orderStatus}
|
|
|
+ </if>
|
|
|
+ <if test="orderTypee != null">
|
|
|
+ and OO.ORDER_TYPE = #{orderTypee}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ </select>
|
|
|
+ <!--销售查询已经形成水渣日计划 -->
|
|
|
+ <select id="selectWaterSlagForOrder" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
+ select *
|
|
|
+ from (
|
|
|
+ SELECT ARD.DAYPLAN_NO "No",
|
|
|
+ RS.SHIPPER_NAME "shipperName",
|
|
|
+ ARD.DAYPLAN_TRUCK_NUMBER "TruckNumber",
|
|
|
+ ARD.DAYPLAN_DELIVERY_PLACE "DayPlanDeliveryPlace",
|
|
|
+ ARD.DAYPLAN_RECEIVE_UNIT "receiveUnit",
|
|
|
+ ARD.DAYPLAN_DELIVERY_DATE "deliveryDate",
|
|
|
+ ARD.DAYPLAN_MATERIAL_WEIGHT "weight",
|
|
|
+ ARD.INSERT_UPDATE_REMARK "remark",
|
|
|
+ ARD.INSERT_TIME "insertTime",
|
|
|
+ OO.ORDER_ID "orderId",
|
|
|
+ RM.MATERIAL_NAME "materialName"
|
|
|
+
|
|
|
+ FROM OMSTRUCK_ORDER OO
|
|
|
+ LEFT JOIN AMSTRUCK_RAIL_DAYPLAN ARD
|
|
|
+ ON ARD.DAYPLAN_ID=OO.ORDER_PLAN_ID
|
|
|
+ LEFT JOIN RMS_MATERIAL RM
|
|
|
+ ON RM.MATERIAL_ID=ARD.MATERIAL_ID
|
|
|
+ left join RMS_SHIPPER RS
|
|
|
+ on ARD.SHIPMENT_UNIT_ID =RS.SHIPPER_ID
|
|
|
+ <where>
|
|
|
+ <if test="carrierId!=null">
|
|
|
+ and ARD.CARRIER_ID=#{carrierId}
|
|
|
+ </if>
|
|
|
+ <if test="dayPlanId!=null">
|
|
|
+ and ARD.DAYPLAN_ID=#{dayPlanId}
|
|
|
+ </if>
|
|
|
+ <if test="orderType!=null">
|
|
|
+ and OO.ORDER_TYPE=#{orderType}
|
|
|
+ </if>
|
|
|
+ <if test="orderStatus!=null">
|
|
|
+ and OO.ORDER_STATUS=#{orderStatus}
|
|
|
+ </if>
|
|
|
+ <if test="materialId!=null">
|
|
|
+ and RM.MATERIAL_ID=#{materialId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ )
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ </select>
|
|
|
+ <!--销售查询已经形成订单得水渣日计划-->
|
|
|
+ <select id="selectCokeRailPlanForOrder" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
+ select *
|
|
|
+ from (
|
|
|
+ SELECT ARD.DAYPLAN_NO "No",
|
|
|
+ ARD.DAYPLAN_ID "dayPlanId",
|
|
|
+ RS.SHIPPER_NAME "shipperName",
|
|
|
+ ARD.DAYPLAN_TRUCK_NUMBER "TruckNumber",
|
|
|
+ ARD.DAYPLAN_DELIVERY_PLACE "DayPlanDeliveryPlace",
|
|
|
+ ARD.DAYPLAN_RECEIVE_UNIT "receiveUnit",
|
|
|
+ ARD.DAYPLAN_DELIVERY_DATE "deliveryDate",
|
|
|
+ ARD.DAYPLAN_MATERIAL_WEIGHT "weight",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ ARD.INSERT_UPDATE_REMARK "remark",
|
|
|
+ ARD.INSERT_TIME "insertTime",
|
|
|
+ OO.ORDER_ID "orderId"
|
|
|
+ FROM OMSTRUCK_ORDER OO
|
|
|
+ LEFT JOIN AMSTRUCK_RAIL_DAYPLAN ARD
|
|
|
+ ON ARD.DAYPLAN_ID=OO.ORDER_PLAN_ID
|
|
|
+ left join RMS_SHIPPER RS
|
|
|
+ on ARD.SHIPMENT_UNIT_ID =RS.SHIPPER_ID
|
|
|
+ left join RMS_MATERIAL RM
|
|
|
+ on RM.MATERIAL_ID=ARD.MATERIAL_ID
|
|
|
+ left join OMSTRUCK_ORDER OO
|
|
|
+ ON OO.ORDER_PLAN_ID=ARD.DAYPLAN_ID
|
|
|
+ <where>
|
|
|
+ <if test="carrierId!=null">
|
|
|
+ and ARD.CARRIER_ID=#{carrierId}
|
|
|
+ </if>
|
|
|
+ <if test="dayPlanId!=null">
|
|
|
+ and ARD.DAYPLAN_ID=#{dayPlanId}
|
|
|
+ </if>
|
|
|
+ <if test="orderType!=null">
|
|
|
+ and OO.ORDER_TYPE=#{orderType}
|
|
|
+ </if>
|
|
|
+ <if test="orderStatus!=null">
|
|
|
+ and OO.ORDER_STATUS=#{orderStatus}
|
|
|
+ </if>
|
|
|
+ <if test="materialId!=null">
|
|
|
+ and RM.MATERIAL_ID=#{materialId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ )
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ </select>
|
|
|
+ <!-- 根据承运商查找销售订单-->
|
|
|
+ <select id="selectSteelSaleForCarrier" resultType="java.util.LinkedHashMap" parameterType="java.lang.Integer">
|
|
|
+ select ASO.SALE_NUMBER "saleNumber",
|
|
|
+ RS.SHIPPER_NAME "shipperName",
|
|
|
+ RC.CONSIGNEE_COMPANY_NAME "consigneeName",
|
|
|
+ RRA.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
|
|
|
+ ASOM.SALE_DATE_OF_RECEIPT "receiptOfdate",
|
|
|
+ ASOM.SALE_ORDER_CONSIGNEE "saleOrderConsignee",
|
|
|
+ ASOM.SALE_ORDER_CONSIGNEE_TEL "saleOrderConsigneeTel",
|
|
|
+ RC2.CARRIER_NAME "carrierName",
|
|
|
+ ASO.SALE_ORDER_ID "saleOderId"
|
|
|
+ from AMS_SALE_ORDER ASO
|
|
|
+ left join AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
|
|
|
+ LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
+ ON ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ left join OMSTRUCK_ORDER OO
|
|
|
+ on OO.ORDER_PLAN_ID = ASTM.SALE_ORDER_MATERIAL_ID
|
|
|
+ left join RMS_DRIVER_CAPACITY RDC
|
|
|
+ on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
|
|
|
+
|
|
|
+ LEFT JOIN RMS_SHIPPER RS ON ASO.SHIPPER_ID = RS.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
|
|
|
+ left join RMS_CARRIER RC2 ON RC2.CARRIER_ID = RDC.CARRIER_ID
|
|
|
+ WHERE RDC.CARRIER_ID = #{carrierId}
|
|
|
+ and OO.ORDER_TYPE = 1
|
|
|
+ AND OO.ORDER_STATUS = 4
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectInfoBySaleOrderId" resultType="java.util.Map" parameterType="java.lang.Integer">
|
|
|
+ select OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
|
|
|
+ RM.MATERIAL_THEORETICAL_WEIGHT "orderTheoreticalWeight",
|
|
|
+ ASOM.SALE_ORDER_MATERIAL_TRUCK_NO "saleOrderMaterialTruckNo",
|
|
|
+ OO.INSERT_UPDATE_REMARK "remark",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber"
|
|
|
+
|
|
|
+ from AMS_SALE_ORDER ASO
|
|
|
+ left join AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ on asom.SALE_ORDER_ID = ASO.SALE_ORDER_ID
|
|
|
+ left join OMSTRUCK_ORDER OO
|
|
|
+ ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
|
|
|
+ ON OOM.ORDER_ID = OO.ORDER_ID
|
|
|
+ LEFT JOIN RMS_DRIVER_CAPACITY RDC
|
|
|
+ ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
|
|
|
+ LEFT JOIN RMS_CAPACITY RC
|
|
|
+ ON RC.CAPACITY_ID = RDC.CAPACITY_ID
|
|
|
+ LEFT JOIN RMS_MATERIAL RM
|
|
|
+ ON RM.MATERIAL_ID = OOM.MATERIAL_ID
|
|
|
+ WHERE ASO.SALE_ORDER_ID = #{saleOrderId}
|
|
|
+ and OO.ORDER_TYPE = 1
|
|
|
+ AND OO.ORDER_STATUS = 4
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--根据承运商查找发运计划-->
|
|
|
+ <select id="selectCokeRailPlan" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
+ select ARD.DAYPLAN_NO "dayPlanNo",
|
|
|
+ ARD.DAYPLAN_DELIVERY_DATE "dayPlanDeliverydate",
|
|
|
+ ARD.DAYPLAN_TRUCK_NUMBER "dayTruckNumber",
|
|
|
+ ARD.DAYPLAN_DELIVERY_PLACE "dayPlanDeliveryPlace",
|
|
|
+ ARD.DAYPLAN_RECEIVE_UNIT "dayPlanReceiveUnit",
|
|
|
+ RS.SHIPPER_NAME "shipperName",
|
|
|
+ ARD.DAYPLAN_ID "dayPlanId"
|
|
|
+ from AMSTRUCK_RAIL_DAYPLAN ARD
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER OO
|
|
|
+ ON OO.ORDER_PLAN_ID = ARD.DAYPLAN_ID
|
|
|
+ LEFT JOIN RMS_SHIPPER RS
|
|
|
+ ON RS.SHIPPER_ID = ARD.SHIPMENT_UNIT_ID
|
|
|
+ LEFT JOIN RMS_DRIVER_CAPACITY RDC
|
|
|
+ ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
|
|
|
+ WHERE RDC.CARRIER_ID = #{carrierId}
|
|
|
+ and OO.ORDER_TYPE = #{orderType}
|
|
|
+ AND OO.ORDER_STATUS = 4
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 根据发运计划id查找信息 -->
|
|
|
+ <select id="selectInfoByDayPlanId" parameterType="java.lang.Integer" resultType="java.util.Map">
|
|
|
+
|
|
|
+ select OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ ARD.DAYPLAN_MATERIAL_WEIGHT "materialWeight",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ OO.INSERT_UPDATE_REMARK "remark"
|
|
|
+
|
|
|
+
|
|
|
+ from AMSTRUCK_RAIL_DAYPLAN ARD
|
|
|
+ left join OMSTRUCK_ORDER OO
|
|
|
+ ON OO.ORDER_PLAN_ID = ARD.DAYPLAN_ID
|
|
|
+ LEFT JOIN RMS_MATERIAL RM
|
|
|
+ ON RM.MATERIAL_ID = ARD.MATERIAL_ID
|
|
|
+ LEFT JOIN RMS_DRIVER_CAPACITY RDC
|
|
|
+ ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
|
|
|
+ LEFT JOIN RMS_CAPACITY RC
|
|
|
+ ON RC.CAPACITY_ID = OO.CAPACITY_ID
|
|
|
+ where OO.ORDER_TYPE = #{orderType}
|
|
|
+ and ARD.DAYPLAN_ID = #{dayPlanId}
|
|
|
+ AND OO.ORDER_STATUS = 4
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getOrderUnReceive" resultType="java.util.Map"></select>
|
|
|
+
|
|
|
+</mapper>
|