|
@@ -0,0 +1,1249 @@
|
|
|
+<?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" />
|
|
|
+ </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
|
|
|
+ </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
|
|
|
+ </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>
|
|
|
+ </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>
|
|
|
+ </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>
|
|
|
+ </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)
|
|
|
+ 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})
|
|
|
+ </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>
|
|
|
+ </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>
|
|
|
+ </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}
|
|
|
+ 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>
|
|
|
+ </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)
|
|
|
+ ( <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} 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>
|
|
|
+ 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_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = OO.CAPACITY_ID
|
|
|
+ left join RMS_DRIVER_CAPACITY RDC
|
|
|
+ on RDC.CAPACITY_ID = RC.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_LINE RL
|
|
|
+ on OO.LINE_ID = RL.LINE_ID
|
|
|
+ left join RMS_LINE_SEGEMNT RLS --查找卸货点
|
|
|
+ on RLS.LINE_ID = RL.LINE_ID and RLS.SEGMENT_END_NODE_TYPE = 3
|
|
|
+ left join RMS_WAREHOUSE RW
|
|
|
+ on RLS.SEGMENT_END_NODE_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>
|
|
|
+ <if test="orderStatus != null">
|
|
|
+ OO.ORDER_STATUS = #{orderStatus}
|
|
|
+ </if>
|
|
|
+ <if test="planId != null ">
|
|
|
+ and AP.PLAN_ID = #{planId}
|
|
|
+ </if>
|
|
|
+ <if test="orderType != null">
|
|
|
+ and ORDER_TYPE = #{orderType}
|
|
|
+ </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="selectMaxId" resultType="java.math.BigDecimal">
|
|
|
+ select max(OO.ORDER_ID)
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ </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
|
|
|
+ RC.CAPACITY_ID "capacityId",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ RCT.CAPACITY_TYPE_NAME "capacityTypeName",
|
|
|
+ RC.CAPACITY_CORLOR "capacityCorlor",
|
|
|
+ RC2.CARRIER_NAME "carrierName",
|
|
|
+ RC.CAPACITY_OWNERIS "capacityOwneris",
|
|
|
+ RC.CAPACITY_BLACKLIST "capacityBlacklist",
|
|
|
+ RC.CAPACITY_VIP "capacityVip",
|
|
|
+ RC.INSERT_TIME "insertTime"
|
|
|
+ from RMS_CAPACITY RC
|
|
|
+ left join RMS_CAPACITY_TYPE RCT
|
|
|
+ on RC.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
|
|
|
+ left join RMS_CARRIER RC2
|
|
|
+ on RC.CARRIER_ID = RC2.CARRIER_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="capacityNumber != null">
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="capacityCorlor != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityCorlor" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityCorlor" 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="capacityTypeName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityTypeName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityBlacklist != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityBlacklist" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityBlacklist" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="capacityOwneris != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityOwneris" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityOwneris" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityVip != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityVip" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityVip" 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 查询司机接单数据 、通过运单号查询所有运单信息-->
|
|
|
+ <select id="getTruckOrderByCapacityNum" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+
|
|
|
+ select
|
|
|
+ *
|
|
|
+ from(
|
|
|
+ select
|
|
|
+ OO.ORDER_ID "orderId",
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
|
|
|
+ OO.ORDER_RECEIVE_REFUSE_TIME "orderReceiveRefuseTime",
|
|
|
+ <include refid="columnSql">
|
|
|
+ </include>
|
|
|
+ AP.PLAN_INCOMING_TIME "entryTime"
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ left join AMS_PURCHASE_ORDER APO
|
|
|
+ on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
|
|
|
+ left join AMSTRUCK_PURPLAN AP
|
|
|
+ on AP.BATCH_ID = APO.BATCH_ID
|
|
|
+ left join RMS_CAPACITY RC --车牌号
|
|
|
+ on RC.CAPACITY_ID = OO.CAPACITY_ID
|
|
|
+ left join OMSTRUCK_ORDER_MATERIAL OOM --物资重量
|
|
|
+ on OOM.ORDER_ID = OO.ORDER_ID
|
|
|
+ left join RMS_MATERIAL RM --物资名称
|
|
|
+ on RM.MATERIAL_ID = OOM.MATERIAL_ID
|
|
|
+ left join RMS_LINE RL
|
|
|
+ on RL.LINE_ID = OO.LINE_ID
|
|
|
+ <include refid="placeSql">
|
|
|
+ </include>
|
|
|
+ <where>
|
|
|
+ <if test="capacityId != null">
|
|
|
+ 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="orderTypee != null">
|
|
|
+ and OO.ORDER_TYPE = #{orderTypee}
|
|
|
+ </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="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="entryTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="entryTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "entryTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="gatepostName1 != null">
|
|
|
+ and
|
|
|
+ <foreach collection="gatepostName1" item="item" open="(" separator="or" close=")">
|
|
|
+ "gatepostName1" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="gatepostName2 != null">
|
|
|
+ and
|
|
|
+ <foreach collection="gatepostName2" item="item" open="(" separator="or" close=")">
|
|
|
+ "gatepostName2" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="truckCalculateNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "truckCalculateNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="warehouseName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
|
|
|
+ "warehouseName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="truckCalculateNum != null">
|
|
|
+ and
|
|
|
+ <foreach collection="truckCalculateNum" item="item" open="(" separator="or" close=")">
|
|
|
+ "truckCalculateNum" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy">
|
|
|
+ </include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "orderReceiveRefuseTime" 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",
|
|
|
+ oo.ORDER_LINE_SEQUENCE as "orderLineSequence"
|
|
|
+ FROM OMSTRUCK_ORDER OO
|
|
|
+ LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ ON TTR.ORDER_ID = OO.ORDER_ID
|
|
|
+ LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER
|
|
|
+ ON TER.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
|
|
|
+ WHERE RW.WAREHOUSE_TYPE_ID = 3
|
|
|
+ AND 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"
|
|
|
+ FROM OMSTRUCK_ORDER OO
|
|
|
+ LEFT JOIN RMS_CAPACITY RC
|
|
|
+ ON OO.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="string" 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"
|
|
|
+
|
|
|
+ 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 OO.ORDER_NUMBER = #{orderNumber}
|
|
|
+ </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"
|
|
|
+
|
|
|
+ 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_LINE_SEGEMNT RLS
|
|
|
+ on RLS.LINE_ID = OO.LINE_ID and RLS.SEGMENT_END_NODE_TYPE = 3
|
|
|
+ left join RMS_WAREHOUSE RW
|
|
|
+ on RW.WAREHOUSE_ID = RLS.SEGMENT_END_NODE_ID
|
|
|
+ <where>
|
|
|
+ <if test="orderStatus != null">
|
|
|
+ OO.ORDER_STATUS = #{orderStatus}
|
|
|
+ </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="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>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy">
|
|
|
+ </include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "orderReceiveRefuseTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|