|
@@ -0,0 +1,1608 @@
|
|
|
+<?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.QmsQueueResultMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.QmsQueueResult">
|
|
|
+ <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
|
|
|
+ <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
|
|
|
+ <result column="CAPACITY_ID" jdbcType="DECIMAL" property="capacityId" />
|
|
|
+ <result column="RESULT_APPLYFOR_TIME" jdbcType="TIMESTAMP" property="resultApplyforTime" />
|
|
|
+ <result column="RESULT_APPLYFOR_LOCATION" jdbcType="VARCHAR" property="resultApplyforLocation" />
|
|
|
+ <result column="GRID_ID" jdbcType="DECIMAL" property="gridId" />
|
|
|
+ <result column="RESULT_DOWN_TIME" jdbcType="TIMESTAMP" property="resultDownTime" />
|
|
|
+ <result column="RESULT_ACCEPT_TIME" jdbcType="TIMESTAMP" property="resultAcceptTime" />
|
|
|
+ <result column="RESULT_START_TIME" jdbcType="TIMESTAMP" property="resultStartTime" />
|
|
|
+ <result column="RESULT_END_TIME" jdbcType="TIMESTAMP" property="resultEndTime" />
|
|
|
+ <result column="RESULT_CANCEL_TIME" jdbcType="TIMESTAMP" property="resultCancelTime" />
|
|
|
+ <result column="RESULT_CANCEL_REASON" jdbcType="VARCHAR" property="resultCancelReason" />
|
|
|
+ <result column="RESULT_INSERT_TIME" jdbcType="TIMESTAMP" property="resultInsertTime" />
|
|
|
+ <result column="RESULT_INSERT_REASON" jdbcType="VARCHAR" property="resultInsertReason" />
|
|
|
+ <result column="RESULT_TRANSFER_TIME" jdbcType="TIMESTAMP" property="resultTransferTime" />
|
|
|
+ <result column="RESULT_TRANSFER_REASON" jdbcType="VARCHAR" property="resultTransferReason" />
|
|
|
+ <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="LIST_ID" jdbcType="DECIMAL" property="listId" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="columns">
|
|
|
+ RESULT_ID, RESULT_TOTAL_ID, CAPACITY_ID, RESULT_APPLYFOR_TIME, RESULT_APPLYFOR_LOCATION,
|
|
|
+ GRID_ID, RESULT_DOWN_TIME, RESULT_ACCEPT_TIME, RESULT_START_TIME, RESULT_END_TIME,
|
|
|
+ RESULT_CANCEL_TIME, RESULT_CANCEL_REASON, RESULT_INSERT_TIME, RESULT_INSERT_REASON,
|
|
|
+ RESULT_TRANSFER_TIME, RESULT_TRANSFER_REASON, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
|
|
|
+ UPDATE_TIME, INSERT_UPDATE_REMARK, LIST_ID
|
|
|
+ </sql>
|
|
|
+ <sql id="columns_alias">
|
|
|
+ t.RESULT_ID, t.RESULT_TOTAL_ID, t.CAPACITY_ID, t.RESULT_APPLYFOR_TIME, t.RESULT_APPLYFOR_LOCATION,
|
|
|
+ t.GRID_ID, t.RESULT_DOWN_TIME, t.RESULT_ACCEPT_TIME, t.RESULT_START_TIME, t.RESULT_END_TIME,
|
|
|
+ t.RESULT_CANCEL_TIME, t.RESULT_CANCEL_REASON, t.RESULT_INSERT_TIME, t.RESULT_INSERT_REASON,
|
|
|
+ t.RESULT_TRANSFER_TIME, t.RESULT_TRANSFER_REASON, t.INSERT_USERNAME, t.INSERT_TIME,
|
|
|
+ t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.LIST_ID
|
|
|
+ </sql>
|
|
|
+ <sql id="select">
|
|
|
+ SELECT <include refid="columns"/> FROM QMS_QUEUE_RESULT
|
|
|
+ </sql>
|
|
|
+ <sql id="select_alias">
|
|
|
+ SELECT <include refid="columns_alias"/> FROM QMS_QUEUE_RESULT t
|
|
|
+ </sql>
|
|
|
+ <sql id="where">
|
|
|
+ <where>
|
|
|
+ <if test="resultId != null">
|
|
|
+ and RESULT_ID = #{resultId}
|
|
|
+ </if>
|
|
|
+ <if test="resultTotalId != null">
|
|
|
+ and RESULT_TOTAL_ID = #{resultTotalId}
|
|
|
+ </if>
|
|
|
+ <if test="capacityId != null">
|
|
|
+ and CAPACITY_ID = #{capacityId}
|
|
|
+ </if>
|
|
|
+ <if test="resultApplyforTime != null">
|
|
|
+ and TO_CHAR(RESULT_APPLYFOR_TIME,'yyyy-MM-dd') = #{resultApplyforTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultApplyforLocation != null and resultApplyforLocation != ''">
|
|
|
+ and RESULT_APPLYFOR_LOCATION = #{resultApplyforLocation}
|
|
|
+ </if>
|
|
|
+ <if test="gridId != null">
|
|
|
+ and GRID_ID = #{gridId}
|
|
|
+ </if>
|
|
|
+ <if test="resultDownTime != null">
|
|
|
+ and TO_CHAR(RESULT_DOWN_TIME,'yyyy-MM-dd') = #{resultDownTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultAcceptTime != null">
|
|
|
+ and TO_CHAR(RESULT_ACCEPT_TIME,'yyyy-MM-dd') = #{resultAcceptTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultStartTime != null">
|
|
|
+ and TO_CHAR(RESULT_START_TIME,'yyyy-MM-dd') = #{resultStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultEndTime != null">
|
|
|
+ and TO_CHAR(RESULT_END_TIME,'yyyy-MM-dd') = #{resultEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelTime != null">
|
|
|
+ and TO_CHAR(RESULT_CANCEL_TIME,'yyyy-MM-dd') = #{resultCancelTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelReason != null and resultCancelReason != ''">
|
|
|
+ and RESULT_CANCEL_REASON = #{resultCancelReason}
|
|
|
+ </if>
|
|
|
+ <if test="resultInsertTime != null">
|
|
|
+ and TO_CHAR(RESULT_INSERT_TIME,'yyyy-MM-dd') = #{resultInsertTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultInsertReason != null and resultInsertReason != ''">
|
|
|
+ and RESULT_INSERT_REASON = #{resultInsertReason}
|
|
|
+ </if>
|
|
|
+ <if test="resultTransferTime != null">
|
|
|
+ and TO_CHAR(RESULT_TRANSFER_TIME,'yyyy-MM-dd') = #{resultTransferTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultTransferReason != null and resultTransferReason != ''">
|
|
|
+ and RESULT_TRANSFER_REASON = #{resultTransferReason}
|
|
|
+ </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="listId != null">
|
|
|
+ and LIST_ID = #{listId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <sql id="whereLike">
|
|
|
+ <where>
|
|
|
+ <if test="resultId != null">
|
|
|
+ and RESULT_ID = #{resultId}
|
|
|
+ </if>
|
|
|
+ <if test="resultTotalId != null">
|
|
|
+ and RESULT_TOTAL_ID = #{resultTotalId}
|
|
|
+ </if>
|
|
|
+ <if test="capacityId != null">
|
|
|
+ and CAPACITY_ID = #{capacityId}
|
|
|
+ </if>
|
|
|
+ <if test="resultApplyforTime != null">
|
|
|
+ and TO_CHAR(RESULT_APPLYFOR_TIME,'yyyy-MM-dd') = #{resultApplyforTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultApplyforLocation != null and resultApplyforLocation != ''">
|
|
|
+ and RESULT_APPLYFOR_LOCATION LIKE '%${resultApplyforLocation}%'
|
|
|
+ </if>
|
|
|
+ <if test="gridId != null">
|
|
|
+ and GRID_ID = #{gridId}
|
|
|
+ </if>
|
|
|
+ <if test="resultDownTime != null">
|
|
|
+ and TO_CHAR(RESULT_DOWN_TIME,'yyyy-MM-dd') = #{resultDownTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultAcceptTime != null">
|
|
|
+ and TO_CHAR(RESULT_ACCEPT_TIME,'yyyy-MM-dd') = #{resultAcceptTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultStartTime != null">
|
|
|
+ and TO_CHAR(RESULT_START_TIME,'yyyy-MM-dd') = #{resultStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultEndTime != null">
|
|
|
+ and TO_CHAR(RESULT_END_TIME,'yyyy-MM-dd') = #{resultEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelTime != null">
|
|
|
+ and TO_CHAR(RESULT_CANCEL_TIME,'yyyy-MM-dd') = #{resultCancelTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelReason != null and resultCancelReason != ''">
|
|
|
+ and RESULT_CANCEL_REASON LIKE '%${resultCancelReason}%'
|
|
|
+ </if>
|
|
|
+ <if test="resultInsertTime != null">
|
|
|
+ and TO_CHAR(RESULT_INSERT_TIME,'yyyy-MM-dd') = #{resultInsertTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultInsertReason != null and resultInsertReason != ''">
|
|
|
+ and RESULT_INSERT_REASON LIKE '%${resultInsertReason}%'
|
|
|
+ </if>
|
|
|
+ <if test="resultTransferTime != null">
|
|
|
+ and TO_CHAR(RESULT_TRANSFER_TIME,'yyyy-MM-dd') = #{resultTransferTime}
|
|
|
+ </if>
|
|
|
+ <if test="resultTransferReason != null and resultTransferReason != ''">
|
|
|
+ and RESULT_TRANSFER_REASON LIKE '%${resultTransferReason}%'
|
|
|
+ </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="listId != null">
|
|
|
+ and LIST_ID = #{listId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
|
|
|
+ delete from QMS_QUEUE_RESULT
|
|
|
+ where RESULT_ID = #{resultId,jdbcType=DECIMAL}
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
|
+ delete from QMS_QUEUE_RESULT
|
|
|
+ where 1!=1
|
|
|
+ <if test="resultTotalId != null">
|
|
|
+ or RESULT_TOTAL_ID = #{resultTotalId}
|
|
|
+ </if>
|
|
|
+ <if test="capacityId != null">
|
|
|
+ or CAPACITY_ID = #{capacityId}
|
|
|
+ </if>
|
|
|
+ <if test="resultApplyforTime != null">
|
|
|
+ or TO_CHAR(RESULT_APPLYFOR_TIME,'yyyy-MM-dd') = '#{resultApplyforTime}'
|
|
|
+ </if>
|
|
|
+ <if test="resultApplyforLocation != null and resultApplyforLocation != ''">
|
|
|
+ or RESULT_APPLYFOR_LOCATION = #{resultApplyforLocation}
|
|
|
+ </if>
|
|
|
+ <if test="gridId != null">
|
|
|
+ or GRID_ID = #{gridId}
|
|
|
+ </if>
|
|
|
+ <if test="resultDownTime != null">
|
|
|
+ or TO_CHAR(RESULT_DOWN_TIME,'yyyy-MM-dd') = '#{resultDownTime}'
|
|
|
+ </if>
|
|
|
+ <if test="resultAcceptTime != null">
|
|
|
+ or TO_CHAR(RESULT_ACCEPT_TIME,'yyyy-MM-dd') = '#{resultAcceptTime}'
|
|
|
+ </if>
|
|
|
+ <if test="resultStartTime != null">
|
|
|
+ or TO_CHAR(RESULT_START_TIME,'yyyy-MM-dd') = '#{resultStartTime}'
|
|
|
+ </if>
|
|
|
+ <if test="resultEndTime != null">
|
|
|
+ or TO_CHAR(RESULT_END_TIME,'yyyy-MM-dd') = '#{resultEndTime}'
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelTime != null">
|
|
|
+ or TO_CHAR(RESULT_CANCEL_TIME,'yyyy-MM-dd') = '#{resultCancelTime}'
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelReason != null and resultCancelReason != ''">
|
|
|
+ or RESULT_CANCEL_REASON = #{resultCancelReason}
|
|
|
+ </if>
|
|
|
+ <if test="resultInsertTime != null">
|
|
|
+ or TO_CHAR(RESULT_INSERT_TIME,'yyyy-MM-dd') = '#{resultInsertTime}'
|
|
|
+ </if>
|
|
|
+ <if test="resultInsertReason != null and resultInsertReason != ''">
|
|
|
+ or RESULT_INSERT_REASON = #{resultInsertReason}
|
|
|
+ </if>
|
|
|
+ <if test="resultTransferTime != null">
|
|
|
+ or TO_CHAR(RESULT_TRANSFER_TIME,'yyyy-MM-dd') = '#{resultTransferTime}'
|
|
|
+ </if>
|
|
|
+ <if test="resultTransferReason != null and resultTransferReason != ''">
|
|
|
+ or RESULT_TRANSFER_REASON = #{resultTransferReason}
|
|
|
+ </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="listId != null">
|
|
|
+ or LIST_ID = #{listId}
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.steerinfo.dil.model.QmsQueueResult">
|
|
|
+ insert into QMS_QUEUE_RESULT (RESULT_ID, RESULT_TOTAL_ID, CAPACITY_ID,
|
|
|
+ RESULT_APPLYFOR_TIME, RESULT_APPLYFOR_LOCATION,
|
|
|
+ GRID_ID, RESULT_DOWN_TIME, RESULT_ACCEPT_TIME,
|
|
|
+ RESULT_START_TIME, RESULT_END_TIME, RESULT_CANCEL_TIME,
|
|
|
+ RESULT_CANCEL_REASON, RESULT_INSERT_TIME,
|
|
|
+ RESULT_INSERT_REASON, RESULT_TRANSFER_TIME,
|
|
|
+ RESULT_TRANSFER_REASON, INSERT_USERNAME, INSERT_TIME,
|
|
|
+ UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
|
|
|
+ LIST_ID)
|
|
|
+ values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{capacityId,jdbcType=DECIMAL},
|
|
|
+ #{resultApplyforTime,jdbcType=TIMESTAMP}, #{resultApplyforLocation,jdbcType=VARCHAR},
|
|
|
+ #{gridId,jdbcType=DECIMAL}, #{resultDownTime,jdbcType=TIMESTAMP}, #{resultAcceptTime,jdbcType=TIMESTAMP},
|
|
|
+ #{resultStartTime,jdbcType=TIMESTAMP}, #{resultEndTime,jdbcType=TIMESTAMP}, #{resultCancelTime,jdbcType=TIMESTAMP},
|
|
|
+ #{resultCancelReason,jdbcType=VARCHAR}, #{resultInsertTime,jdbcType=TIMESTAMP},
|
|
|
+ #{resultInsertReason,jdbcType=VARCHAR}, #{resultTransferTime,jdbcType=TIMESTAMP},
|
|
|
+ #{resultTransferReason,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
|
|
|
+ #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
+ #{listId,jdbcType=DECIMAL})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.steerinfo.dil.model.QmsQueueResult">
|
|
|
+ insert into QMS_QUEUE_RESULT
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="resultId != null">
|
|
|
+ RESULT_ID,
|
|
|
+ </if>
|
|
|
+ <if test="resultTotalId != null">
|
|
|
+ RESULT_TOTAL_ID,
|
|
|
+ </if>
|
|
|
+ <if test="capacityId != null">
|
|
|
+ CAPACITY_ID,
|
|
|
+ </if>
|
|
|
+ <if test="resultApplyforTime != null">
|
|
|
+ RESULT_APPLYFOR_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="resultApplyforLocation != null">
|
|
|
+ RESULT_APPLYFOR_LOCATION,
|
|
|
+ </if>
|
|
|
+ <if test="gridId != null">
|
|
|
+ GRID_ID,
|
|
|
+ </if>
|
|
|
+ <if test="resultDownTime != null">
|
|
|
+ RESULT_DOWN_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="resultAcceptTime != null">
|
|
|
+ RESULT_ACCEPT_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="resultStartTime != null">
|
|
|
+ RESULT_START_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="resultEndTime != null">
|
|
|
+ RESULT_END_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelTime != null">
|
|
|
+ RESULT_CANCEL_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelReason != null">
|
|
|
+ RESULT_CANCEL_REASON,
|
|
|
+ </if>
|
|
|
+ <if test="resultInsertTime != null">
|
|
|
+ RESULT_INSERT_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="resultInsertReason != null">
|
|
|
+ RESULT_INSERT_REASON,
|
|
|
+ </if>
|
|
|
+ <if test="resultTransferTime != null">
|
|
|
+ RESULT_TRANSFER_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="resultTransferReason != null">
|
|
|
+ RESULT_TRANSFER_REASON,
|
|
|
+ </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="listId != null">
|
|
|
+ LIST_ID,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="resultId != null">
|
|
|
+ #{resultId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="resultTotalId != null">
|
|
|
+ #{resultTotalId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="capacityId != null">
|
|
|
+ #{capacityId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="resultApplyforTime != null">
|
|
|
+ #{resultApplyforTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultApplyforLocation != null">
|
|
|
+ #{resultApplyforLocation,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="gridId != null">
|
|
|
+ #{gridId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="resultDownTime != null">
|
|
|
+ #{resultDownTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultAcceptTime != null">
|
|
|
+ #{resultAcceptTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultStartTime != null">
|
|
|
+ #{resultStartTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultEndTime != null">
|
|
|
+ #{resultEndTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelTime != null">
|
|
|
+ #{resultCancelTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelReason != null">
|
|
|
+ #{resultCancelReason,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="resultInsertTime != null">
|
|
|
+ #{resultInsertTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultInsertReason != null">
|
|
|
+ #{resultInsertReason,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="resultTransferTime != null">
|
|
|
+ #{resultTransferTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultTransferReason != null">
|
|
|
+ #{resultTransferReason,jdbcType=VARCHAR},
|
|
|
+ </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="listId != null">
|
|
|
+ #{listId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.QmsQueueResult">
|
|
|
+ update QMS_QUEUE_RESULT
|
|
|
+ set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
|
|
|
+ CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
|
|
|
+ RESULT_APPLYFOR_TIME = #{resultApplyforTime,jdbcType=TIMESTAMP},
|
|
|
+ RESULT_APPLYFOR_LOCATION = #{resultApplyforLocation,jdbcType=VARCHAR},
|
|
|
+ GRID_ID = #{gridId,jdbcType=DECIMAL},
|
|
|
+ RESULT_DOWN_TIME = #{resultDownTime,jdbcType=TIMESTAMP},
|
|
|
+ RESULT_ACCEPT_TIME = #{resultAcceptTime,jdbcType=TIMESTAMP},
|
|
|
+ RESULT_START_TIME = #{resultStartTime,jdbcType=TIMESTAMP},
|
|
|
+ RESULT_END_TIME = #{resultEndTime,jdbcType=TIMESTAMP},
|
|
|
+ RESULT_CANCEL_TIME = #{resultCancelTime,jdbcType=TIMESTAMP},
|
|
|
+ RESULT_CANCEL_REASON = #{resultCancelReason,jdbcType=VARCHAR},
|
|
|
+ RESULT_INSERT_TIME = #{resultInsertTime,jdbcType=TIMESTAMP},
|
|
|
+ RESULT_INSERT_REASON = #{resultInsertReason,jdbcType=VARCHAR},
|
|
|
+ RESULT_TRANSFER_TIME = #{resultTransferTime,jdbcType=TIMESTAMP},
|
|
|
+ RESULT_TRANSFER_REASON = #{resultTransferReason,jdbcType=VARCHAR},
|
|
|
+ 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},
|
|
|
+ LIST_ID = #{listId,jdbcType=DECIMAL}
|
|
|
+ where RESULT_ID = #{resultId,jdbcType=DECIMAL}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.QmsQueueResult">
|
|
|
+ update QMS_QUEUE_RESULT
|
|
|
+ <set>
|
|
|
+ <if test="resultTotalId != null">
|
|
|
+ RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="capacityId != null">
|
|
|
+ CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="resultApplyforTime != null">
|
|
|
+ RESULT_APPLYFOR_TIME = #{resultApplyforTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultApplyforLocation != null">
|
|
|
+ RESULT_APPLYFOR_LOCATION = #{resultApplyforLocation,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="gridId != null">
|
|
|
+ GRID_ID = #{gridId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="resultDownTime != null">
|
|
|
+ RESULT_DOWN_TIME = #{resultDownTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultAcceptTime != null">
|
|
|
+ RESULT_ACCEPT_TIME = #{resultAcceptTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultStartTime != null">
|
|
|
+ RESULT_START_TIME = #{resultStartTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultEndTime != null">
|
|
|
+ RESULT_END_TIME = #{resultEndTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelTime != null">
|
|
|
+ RESULT_CANCEL_TIME = #{resultCancelTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelReason != null">
|
|
|
+ RESULT_CANCEL_REASON = #{resultCancelReason,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="resultInsertTime != null">
|
|
|
+ RESULT_INSERT_TIME = #{resultInsertTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultInsertReason != null">
|
|
|
+ RESULT_INSERT_REASON = #{resultInsertReason,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="resultTransferTime != null">
|
|
|
+ RESULT_TRANSFER_TIME = #{resultTransferTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="resultTransferReason != null">
|
|
|
+ RESULT_TRANSFER_REASON = #{resultTransferReason,jdbcType=VARCHAR},
|
|
|
+ </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="listId != null">
|
|
|
+ LIST_ID = #{listId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where RESULT_ID = #{resultId,jdbcType=DECIMAL}
|
|
|
+ </update>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
|
|
|
+ <include refid="select"/>
|
|
|
+ where RESULT_ID = #{resultId,jdbcType=DECIMAL}
|
|
|
+ </select>
|
|
|
+ <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
+ <include refid="select"/>
|
|
|
+ <include refid="where"/>
|
|
|
+ </select>
|
|
|
+ <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
+ <include refid="select"/>
|
|
|
+ <include refid="whereLike"/>
|
|
|
+ </select>
|
|
|
+ <insert id="batchInsert" parameterType="java.util.List">
|
|
|
+ insert into QMS_QUEUE_RESULT
|
|
|
+ (RESULT_ID,
|
|
|
+ RESULT_TOTAL_ID, CAPACITY_ID, RESULT_APPLYFOR_TIME,
|
|
|
+ RESULT_APPLYFOR_LOCATION, GRID_ID,
|
|
|
+ RESULT_DOWN_TIME, RESULT_ACCEPT_TIME,
|
|
|
+ RESULT_START_TIME, RESULT_END_TIME,
|
|
|
+ RESULT_CANCEL_TIME, RESULT_CANCEL_REASON,
|
|
|
+ RESULT_INSERT_TIME, RESULT_INSERT_REASON,
|
|
|
+ RESULT_TRANSFER_TIME, RESULT_TRANSFER_REASON,
|
|
|
+ INSERT_USERNAME, INSERT_TIME,
|
|
|
+ UPDATE_USERNAME, UPDATE_TIME,
|
|
|
+ INSERT_UPDATE_REMARK, LIST_ID)
|
|
|
+ ( <foreach collection="list" item="item" separator="union all">
|
|
|
+ select
|
|
|
+ #{item.resultId,jdbcType=DECIMAL},
|
|
|
+ #{item.resultTotalId,jdbcType=DECIMAL}, #{item.capacityId,jdbcType=DECIMAL}, #{item.resultApplyforTime,jdbcType=TIMESTAMP},
|
|
|
+ #{item.resultApplyforLocation,jdbcType=VARCHAR}, #{item.gridId,jdbcType=DECIMAL},
|
|
|
+ #{item.resultDownTime,jdbcType=TIMESTAMP}, #{item.resultAcceptTime,jdbcType=TIMESTAMP},
|
|
|
+ #{item.resultStartTime,jdbcType=TIMESTAMP}, #{item.resultEndTime,jdbcType=TIMESTAMP},
|
|
|
+ #{item.resultCancelTime,jdbcType=TIMESTAMP}, #{item.resultCancelReason,jdbcType=VARCHAR},
|
|
|
+ #{item.resultInsertTime,jdbcType=TIMESTAMP}, #{item.resultInsertReason,jdbcType=VARCHAR},
|
|
|
+ #{item.resultTransferTime,jdbcType=TIMESTAMP}, #{item.resultTransferReason,jdbcType=VARCHAR},
|
|
|
+ #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
|
|
|
+ #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
|
|
|
+ #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.listId,jdbcType=DECIMAL} from dual
|
|
|
+ </foreach> )
|
|
|
+ </insert>
|
|
|
+ <update id="batchUpdate" parameterType="java.util.List">
|
|
|
+ update QMS_QUEUE_RESULT
|
|
|
+ set
|
|
|
+ RESULT_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,RESULT_TOTAL_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,CAPACITY_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.capacityId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,RESULT_APPLYFOR_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.resultApplyforTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,RESULT_APPLYFOR_LOCATION=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.resultApplyforLocation,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,GRID_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.gridId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,RESULT_DOWN_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.resultDownTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,RESULT_ACCEPT_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.resultAcceptTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,RESULT_START_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.resultStartTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,RESULT_END_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEndTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,RESULT_CANCEL_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.resultCancelTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,RESULT_CANCEL_REASON=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.resultCancelReason,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,RESULT_INSERT_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.resultInsertTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,RESULT_INSERT_REASON=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.resultInsertReason,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,RESULT_TRANSFER_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTransferTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,RESULT_TRANSFER_REASON=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTransferReason,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_USERNAME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,UPDATE_USERNAME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,UPDATE_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_UPDATE_REMARK=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,LIST_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.listId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ where RESULT_ID in
|
|
|
+ <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
|
+ #{item.resultId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+ <delete id="batchDelete" parameterType="java.util.List">
|
|
|
+ delete from QMS_QUEUE_RESULT
|
|
|
+ where RESULT_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>
|
|
|
+
|
|
|
+ <!-- 获取最大ID值 -->
|
|
|
+ <select id="selectMaxId" resultType="java.math.BigDecimal">
|
|
|
+ select max(QQR.RESULT_ID)
|
|
|
+ from QMS_QUEUE_RESULT QQR
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 车辆进入电子围栏后触发排队申请 -->
|
|
|
+ <select id="queryCIdAndTIdByOrderNumber" parameterType="string" resultType="java.util.Map">
|
|
|
+ select OO.ORDER_ID "orderId",
|
|
|
+ OO.CAPACITY_ID "capacityId",
|
|
|
+ TTR.RESULT_TOTAL_ID "resultTotalId"
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on TTR.ORDER_ID = OO.ORDER_ID
|
|
|
+ where OO.ORDER_NUMBER = #{orderNumber}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 人工添加排队申请查询所有执行中订单 订单状态 :1 -->
|
|
|
+ <select id="getAllExecutionOrder" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
+ select *
|
|
|
+ from (
|
|
|
+ select OO.ORDER_ID "orderId",
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ RCD.DRIVER_NAME "driverName",
|
|
|
+ OO.INSERT_TIME "insertTime"
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ join OMSTRUCK_ORDER_MATERIAL OOM
|
|
|
+ on OOM.ORDER_ID = OO.ORDER_ID
|
|
|
+ join RMS_MATERIAL RM
|
|
|
+ on RM.MATERIAL_ID = OOM.ORDER_MATERIAL_ID
|
|
|
+ join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = OO.CAPACITY_ID
|
|
|
+ join RMS_DRIVER_CAPACITY RDC
|
|
|
+ on RDC.CAPACITY_ID = RC.CAPACITY_ID
|
|
|
+ join RMS_CAR_DRIVER RCD
|
|
|
+ on RDC.DRIVER_ID = RCD.DRIVER_ID
|
|
|
+ join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on TTR.ORDER_ID = OO.ORDER_ID
|
|
|
+ where OO.ORDER_STATUS = #{orderStatus}
|
|
|
+ and OO.ORDER_TYPE = #{orderTypee}
|
|
|
+ and TTR.RESULT_TOTAL_ID not in (select QQR.RESULT_TOTAL_ID from QMS_QUEUE_RESULT QQR)
|
|
|
+ )
|
|
|
+ <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="materialName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
+ "materialName" 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 "insertTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据运单Id查询物资Id-->
|
|
|
+ <select id="queryOrderMesByOrderId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
|
|
|
+ select OOM.MATERIAL_ID "materialId"
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ left join OMSTRUCK_ORDER_MATERIAL OOM
|
|
|
+ on OO.ORDER_ID = OOM.ORDER_ID
|
|
|
+ where OO.ORDER_ID = #{orderId}
|
|
|
+ </select>
|
|
|
+ <!-- 根据物资Id、门岗规则(进或出) 查询门岗id -->
|
|
|
+ <select id="queryGatepostByMaterialId" parameterType="java.util.Map" resultType="java.math.BigDecimal">
|
|
|
+ select
|
|
|
+ RG.GATEPOST_ID "gatepostId"
|
|
|
+ from RMS_GATEPOST RG
|
|
|
+ left join RMS_GATEPOST_RULES RGR
|
|
|
+ on RGR.GATEPOST_ID = RG.GATEPOST_ID
|
|
|
+ left join RMS_MATERIAL_TYPE RMT
|
|
|
+ on RMT.MATERIAL_TYPE_ID = RGR.MATERIAL_TYPE_ID
|
|
|
+ left join RMS_MATERIAL RM
|
|
|
+ on RM.MATERIAL_TYPE_ID = RMT.MATERIAL_TYPE_ID
|
|
|
+ <where>
|
|
|
+ <if test="materialId != null">
|
|
|
+ RM.MATERIAL_ID = #{materialId}
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ and RGR.RULES_GATEPOST_ENTRY_OUT_TYPE = #{type}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by
|
|
|
+ "gatepostId"
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!-- 通过门岗名称查询门岗ID -->
|
|
|
+ <select id="getGatepostIdByGatepostName" parameterType="string" resultType="java.math.BigDecimal">
|
|
|
+ select RG.GATEPOST_ID "gatepostId"
|
|
|
+ from RMS_GATEPOST RG
|
|
|
+ where RG.GATEPOST_NAME = #{gatepostName}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 通过门岗ID、和 网格类型 匹配 网格主键 -->
|
|
|
+ <select id="getGridIdByGatepostIdAndGridType" parameterType="java.util.Map" resultType="java.math.BigDecimal">
|
|
|
+ select QQG.GRID_ID
|
|
|
+ from QMS_QUEUE_GRID QQG
|
|
|
+ where QQG.GRID_TYPE = #{gridType}
|
|
|
+ and QQG.QUEUE_LOCATION_ID = #{queueLocationId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!-- 查询排队申请 -->
|
|
|
+ <select id="getQueueApply" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
+ select *
|
|
|
+ from (
|
|
|
+ select QQR.RESULT_ID "resultId",
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ QQR.RESULT_APPLYFOR_LOCATION "resultApplyforLocation", --当前位置?
|
|
|
+ QQR.RESULT_APPLYFOR_TIME "resultApplyforTime",
|
|
|
+ QQR.RESULT_DOWN_TIME "resultDownTime",
|
|
|
+ RG.GATEPOST_NAME "gatepostName"
|
|
|
+ from QMS_QUEUE_RESULT QQR
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID
|
|
|
+ left join OMSTRUCK_ORDER OO
|
|
|
+ on OO.ORDER_ID = TTR.ORDER_ID
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = QQR.CAPACITY_ID
|
|
|
+ left join QMS_QUEUE_GRID QQG
|
|
|
+ on QQG.GRID_ID = QQR.GRID_ID
|
|
|
+ left join RMS_GATEPOST RG
|
|
|
+ on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID
|
|
|
+ where QQR.RESULT_ACCEPT_TIME is null
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="capacityNumber != null">
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNumber" 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="resultApplyforLocation != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultApplyforLocation" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultApplyforLocation" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultApplyforTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultApplyforTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultApplyforTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultDownTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultDownTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultDownTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="gatepostName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
|
|
|
+ "gatepostName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "resultDownTime" desc
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!-- 指令接收 通过接收时间判断是否已接收 查询判断条件:是否结束进厂 -->
|
|
|
+ <select id="getOrderReceive" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
+ select *
|
|
|
+ from (
|
|
|
+ select OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ QQR.RESULT_ACCEPT_TIME "resultAcceptTime",
|
|
|
+ RG.GATEPOST_NAME "gatepostName",
|
|
|
+ QQR.RESULT_DOWN_TIME "resultDownTime"
|
|
|
+ from QMS_QUEUE_RESULT QQR
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID
|
|
|
+ left join OMSTRUCK_ORDER OO
|
|
|
+ on OO.ORDER_ID = TTR.ORDER_ID
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = QQR.CAPACITY_ID
|
|
|
+ left join QMS_QUEUE_GRID QQG
|
|
|
+ on QQG.GRID_ID = QQR.GRID_ID
|
|
|
+ left join RMS_GATEPOST RG
|
|
|
+ on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID
|
|
|
+ where QQR.RESULT_END_TIME is null
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="capacityNumber != null">
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNumber" 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="resultAcceptTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultAcceptTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultAcceptTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultAcceptTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultAcceptTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultAcceptTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "resultDownTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 排队开始、详情 正在排队的数据 -->
|
|
|
+ <select id="getQueueListByQueueUp" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ *
|
|
|
+ from(
|
|
|
+ select
|
|
|
+ QQR.RESULT_ID "resultId",
|
|
|
+ APO.PURCHASE_ORDER_NO "purchaseOrderNo",
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ QQR.RESULT_START_TIME "resultStartTime",
|
|
|
+ RG.GATEPOST_NAME "gatepostName",
|
|
|
+ (
|
|
|
+ <![CDATA[
|
|
|
+ select
|
|
|
+ count(*)
|
|
|
+ from
|
|
|
+ QMS_QUEUE_LIST QQL2
|
|
|
+ join QMS_QUEUE_GRID QQG2
|
|
|
+ on QQG2.GRID_ID = QQL2.GRID_ID
|
|
|
+ where
|
|
|
+ QQL2.LIST_NODE_ORDER <= QQL.list_node_order
|
|
|
+ and QQL2.GRID_ID = QQL.GRID_ID
|
|
|
+ and QQL2.DELETED = 0
|
|
|
+ ]]>
|
|
|
+ ) "listNodeOrder",
|
|
|
+ RC.CAPACITY_VIP "capacityVip"
|
|
|
+
|
|
|
+ from QMS_QUEUE_RESULT QQR
|
|
|
+ left join QMS_QUEUE_LIST QQL
|
|
|
+ on QQR.LIST_ID = QQL.LIST_ID
|
|
|
+ left join QMS_QUEUE_GRID QQG
|
|
|
+ on QQG.GRID_ID = QQL.GRID_ID
|
|
|
+ left join RMS_GATEPOST RG
|
|
|
+ on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID
|
|
|
+ left join OMSTRUCK_ORDER OO
|
|
|
+ on OO.ORDER_ID = TTR.ORDER_ID
|
|
|
+
|
|
|
+ left join AMS_PURCHASE_ORDER APO
|
|
|
+ on OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
|
|
|
+
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on QQR.CAPACITY_ID = RC.CAPACITY_ID
|
|
|
+
|
|
|
+ where QQR.RESULT_START_TIME is not null
|
|
|
+ and QQL.DELETED = 0
|
|
|
+ <if test="gridId != null">
|
|
|
+ and QQL.GRID_ID = #{gridId}
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="purchaseOrderNo != null">
|
|
|
+ <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
|
|
|
+ "purchaseOrderNo" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultStartTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultStartTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="gatepostName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
|
|
|
+ "gatepostName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="listNodeOrder != null">
|
|
|
+ and
|
|
|
+ <foreach collection="listNodeOrder" item="item" open="(" separator="or" close=")">
|
|
|
+ "listNodeOrder" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "resultStartTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!-- 通过实绩Id查询链表ID -->
|
|
|
+ <select id="getListIdByResultId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ LIST_ID "listId",
|
|
|
+ CAPACITY_ID "capacityId"
|
|
|
+ from QMS_QUEUE_RESULT QQR
|
|
|
+ where QQR.RESULT_ID = #{resultId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!-- 查看排队转移详情 -->
|
|
|
+ <select id="getChangeQueueMes" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ *
|
|
|
+ from(
|
|
|
+ select
|
|
|
+ QQR.RESULT_ID "resultId",
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ RG1.GATEPOST_NAME "gatepostName1",
|
|
|
+ RG2.GATEPOST_NAME "gatepostName2",
|
|
|
+ QQR.RESULT_TRANSFER_TIME "resultTransferTime",
|
|
|
+ QQR.RESULT_TRANSFER_REASON "resultTransferReason",
|
|
|
+ (
|
|
|
+ <![CDATA[
|
|
|
+ select
|
|
|
+ count(*)
|
|
|
+ from
|
|
|
+ QMS_QUEUE_LIST QL
|
|
|
+ join QMS_QUEUE_GRID QG
|
|
|
+ on QG.GRID_ID = QL.GRID_ID
|
|
|
+ where
|
|
|
+ QL.LIST_NODE_ORDER <= QQL.list_node_order
|
|
|
+ and QL.GRID_ID = QQL.GRID_ID
|
|
|
+ and QL.DELETED = 0
|
|
|
+ ]]>
|
|
|
+ ) "listNodeOrder"
|
|
|
+
|
|
|
+ from QMS_QUEUE_RESULT QQR
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ left join OMSTRUCK_ORDER OO
|
|
|
+ on OO.ORDER_ID = TTR.ORDER_ID
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = QQR.CAPACITY_ID
|
|
|
+ left join QMS_QUEUE_LIST QQL
|
|
|
+ on QQL.LIST_ID = QQR.LIST_ID
|
|
|
+ left join QMS_QUEUE_GRID QQG1 --转移后门岗ID
|
|
|
+ on QQG1.GRID_ID = QQL.GRID_ID
|
|
|
+ left join RMS_GATEPOST RG1 --转移后门岗
|
|
|
+ on QQG1.QUEUE_LOCATION_ID = RG1.GATEPOST_ID
|
|
|
+ left join QMS_QUEUE_GRID QQG2 -- 转移前门岗ID
|
|
|
+ on QQG2.GRID_ID = QQR.GRID_ID
|
|
|
+ left join RMS_GATEPOST RG2 --转移前门岗
|
|
|
+ on RG2.GATEPOST_ID = QQG2.QUEUE_LOCATION_ID
|
|
|
+
|
|
|
+ where QQR.RESULT_TRANSFER_TIME is not null
|
|
|
+ and QQL.DELETED = 0
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="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="resultTransferTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultTransferTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultTransferTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultTransferReason != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultTransferReason" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultTransferReason" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "resultTransferTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!-- 查询排队取消 -->
|
|
|
+ <select id="getQueueCancel" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ select *
|
|
|
+ from (
|
|
|
+ select QQR.RESULT_ID "resultId",
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ QQR.RESULT_CANCEL_TIME "resultCancelTime",
|
|
|
+ QQR.RESULT_CANCEL_REASON "resultCancelReason",
|
|
|
+ RG.GATEPOST_NAME "gatepostName"
|
|
|
+ from QMS_QUEUE_RESULT QQR
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ left join OMSTRUCK_ORDER OO
|
|
|
+ on OO.ORDER_ID = TTR.ORDER_ID
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = QQR.CAPACITY_ID
|
|
|
+ left join QMS_QUEUE_LIST QQL
|
|
|
+ on QQL.LIST_ID = QQR.LIST_ID
|
|
|
+ left join QMS_QUEUE_GRID QQG
|
|
|
+ on QQG.GRID_ID = QQL.GRID_ID
|
|
|
+ left join RMS_GATEPOST RG
|
|
|
+ on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID
|
|
|
+ where QQR.RESULT_CANCEL_TIME is not null
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultCancelTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultCancelTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelReason != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultCancelReason" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultCancelReason" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="gatepostName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
|
|
|
+ "gatepostName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "resultCancelTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!-- 通过实绩Id 查询数据 取消排队使用-->
|
|
|
+ <select id="getQueueCancelByResultId" parameterType="int" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ QQR.RESULT_CANCEL_TIME "resultCancelTime",
|
|
|
+ QQR.RESULT_CANCEL_REASON "resultCancelReason"
|
|
|
+
|
|
|
+ from QMS_QUEUE_RESULT QQR
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ left join OMSTRUCK_ORDER OO
|
|
|
+ on OO.ORDER_ID = TTR.ORDER_ID
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = QQR.CAPACITY_ID
|
|
|
+ left join QMS_QUEUE_LIST QQL
|
|
|
+ on QQL.LIST_ID = QQR.LIST_ID
|
|
|
+ left join QMS_QUEUE_GRID QQG
|
|
|
+ on QQG.GRID_ID = QQL.GRID_ID
|
|
|
+ left join RMS_GATEPOST RG
|
|
|
+ on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID
|
|
|
+ where RESULT_ID = #{resultId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!-- 查询插队实绩-->
|
|
|
+ <select id="getQueueInsert" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
+ select *
|
|
|
+ from (
|
|
|
+ select QQR.RESULT_ID "resultId",
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RG.GATEPOST_NAME "gatepostName",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ QQR.RESULT_INSERT_TIME "resultInsertTime",
|
|
|
+ QQR.RESULT_INSERT_REASON "resultInsertReason",
|
|
|
+ (
|
|
|
+ select count(*) from QMS_QUEUE_LIST QQL2 where QQL2.GRID_ID = QQL.GRID_ID
|
|
|
+ ) "queueNumber"
|
|
|
+
|
|
|
+ from QMS_QUEUE_RESULT QQR
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID
|
|
|
+ left join OMSTRUCK_ORDER OO
|
|
|
+ on OO.ORDER_ID = TTR.ORDER_ID
|
|
|
+ left join QMS_QUEUE_LIST QQL
|
|
|
+ on QQR.LIST_ID = QQL.LIST_ID
|
|
|
+ left join QMS_QUEUE_GRID QQG
|
|
|
+ on QQG.GRID_ID = QQL.GRID_ID
|
|
|
+ left join RMS_GATEPOST RG
|
|
|
+ on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = QQR.CAPACITY_ID
|
|
|
+ where QQR.RESULT_INSERT_TIME is not null
|
|
|
+ and QQR.RESULT_END_TIME is null
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="gatepostName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
|
|
|
+ "gatepostName" 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="resultInsertTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultInsertTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultInsertTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultInsertReason != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultInsertReason" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultInsertReason" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "resultInsertTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+<!-- 查询所有排队结束 -->
|
|
|
+ <select id="getQueueEndResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ *
|
|
|
+ from (
|
|
|
+ select OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ QQR.RESULT_END_TIME "resultEndTime",
|
|
|
+ RG.GATEPOST_NAME "gatepostName"
|
|
|
+ from QMS_QUEUE_RESULT QQR
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID
|
|
|
+ left join OMSTRUCK_ORDER OO
|
|
|
+ on OO.ORDER_ID = TTR.ORDER_ID
|
|
|
+ left join QMS_QUEUE_LIST QQL
|
|
|
+ on QQR.LIST_ID = QQL.LIST_ID
|
|
|
+ left join QMS_QUEUE_GRID QQG
|
|
|
+ on QQG.GRID_ID = QQL.GRID_ID
|
|
|
+ left join RMS_GATEPOST RG
|
|
|
+ on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = QQR.CAPACITY_ID
|
|
|
+ where QQR.RESULT_END_TIME is not null
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultEndTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultEndTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="gatepostName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
|
|
|
+ "gatepostName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "resultEndTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <!-- 排序 -->
|
|
|
+ <sql id="orderByEndTime">
|
|
|
+ <if test="orderField != null and orderField != ''">
|
|
|
+ order by "${orderField}"
|
|
|
+ <if test="orderType != null and orderType != ''">
|
|
|
+ ${orderType}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "resultEndTime" desc
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+<!-- 汽车监控 -->
|
|
|
+ <select id="capacityMonitor" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
+
|
|
|
+ select *
|
|
|
+ from (
|
|
|
+ select OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ QQR.RESULT_APPLYFOR_TIME "resultApplyforTime",
|
|
|
+ QQR.RESULT_START_TIME "resultStartTime",
|
|
|
+ QQR.RESULT_DOWN_TIME "resultDownTime",
|
|
|
+ QQR.RESULT_ACCEPT_TIME "resultAcceptTime",
|
|
|
+ QQR.RESULT_CANCEL_TIME "resultCancelTime",
|
|
|
+ QQR.RESULT_CANCEL_REASON "resultCancelReason",
|
|
|
+ QQR.RESULT_INSERT_TIME "resultInsertTime",
|
|
|
+ QQR.RESULT_INSERT_REASON "resultInsertReason",
|
|
|
+ QQR.RESULT_END_TIME "resultEndTime"
|
|
|
+
|
|
|
+ from QMS_QUEUE_RESULT QQR
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID
|
|
|
+ left join OMSTRUCK_ORDER OO
|
|
|
+ on OO.ORDER_ID = TTR.ORDER_ID
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = QQR.CAPACITY_ID
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultApplyforTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultApplyforTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultApplyforTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultStartTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultStartTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultDownTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultDownTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultDownTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultAcceptTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultAcceptTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultAcceptTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultCancelTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultCancelTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultCancelReason != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultCancelReason" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultCancelReason" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultInsertTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultInsertTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultInsertTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultInsertReason != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultInsertReason" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultInsertReason" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultEndTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultEndTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "resultApplyforTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 通过门岗查询排队车数 -->
|
|
|
+ <select id="getQueueListByGatepost" parameterType="java.math.BigDecimal" resultType="java.util.Map">
|
|
|
+ SELECT oo.ORDER_NUMBER as "orderNumber",
|
|
|
+ rc.CAPACITY_NUMBER as "capacityNumber",
|
|
|
+ rg.GATEPOST_NAME as "gatepostName",
|
|
|
+ (
|
|
|
+ <![CDATA[
|
|
|
+ select count(*)
|
|
|
+ from QMS_QUEUE_LIST QQL2
|
|
|
+ join QMS_QUEUE_GRID QQG2
|
|
|
+ on QQG2.GRID_ID = QQL2.GRID_ID
|
|
|
+ where QQL2.LIST_NODE_ORDER <= QQL.list_node_order
|
|
|
+ and QQL2.GRID_ID = QQL.GRID_ID
|
|
|
+ and QQL2.DELETED = 0
|
|
|
+ ]]>
|
|
|
+) "listNodeOrder"
|
|
|
+ FROM QMS_QUEUE_RESULT qqr
|
|
|
+ LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr
|
|
|
+ ON qqr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER oo
|
|
|
+ ON oo.ORDER_ID = ttr.ORDER_ID
|
|
|
+ LEFT JOIN RMS_CAPACITY rc
|
|
|
+ ON rc.CAPACITY_ID = qqr.CAPACITY_ID
|
|
|
+ LEFT JOIN QMS_QUEUE_LIST qql
|
|
|
+ ON qql.LIST_ID = qqr.LIST_ID
|
|
|
+ LEFT JOIN QMS_QUEUE_GRID qqg
|
|
|
+ ON qqg.GRID_ID = qql.GRID_ID
|
|
|
+ LEFT JOIN RMS_GATEPOST rg
|
|
|
+ ON rg.GATEPOST_ID = qqg.QUEUE_LOCATION_ID
|
|
|
+ WHERE rg.GATEPOST_ID = #{gatepostId}
|
|
|
+ AND qql.DELETED = 0
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询排队取消列表 -->
|
|
|
+ <select id="getQueueCancelList" resultType="java.util.Map">
|
|
|
+ SELECT oo.ORDER_NUMBER as "orderNumber",
|
|
|
+ rc.CAPACITY_NUMBER as "capacityNumber",
|
|
|
+ qqr.RESULT_CANCEL_TIME as "resultCancelTime",
|
|
|
+ qqr.RESULT_CANCEL_REASON as "resultCancelReason",
|
|
|
+ rg.GATEPOST_NAME as "gatepostName"
|
|
|
+ FROM QMS_QUEUE_RESULT qqr
|
|
|
+ LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr
|
|
|
+ ON qqr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER oo
|
|
|
+ ON oo.ORDER_ID = ttr.ORDER_ID
|
|
|
+ LEFT JOIN RMS_CAPACITY rc
|
|
|
+ ON rc.CAPACITY_ID = qqr.CAPACITY_ID
|
|
|
+ LEFT JOIN QMS_QUEUE_LIST qql
|
|
|
+ ON qql.LIST_ID = qqr.LIST_ID
|
|
|
+ LEFT JOIN QMS_QUEUE_GRID qqg
|
|
|
+ ON qqg.GRID_ID = qql.GRID_ID
|
|
|
+ LEFT JOIN RMS_GATEPOST rg
|
|
|
+ ON rg.GATEPOST_ID = qqg.QUEUE_LOCATION_ID
|
|
|
+ WHERE qqr.RESULT_CANCEL_REASON IS NOT NULL
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查看各个门岗,仓库的实时状态 -->
|
|
|
+ <select id="getQueueStatusList" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ RG.GATEPOST_NAME "gatepostName",
|
|
|
+ count(QQL.LIST_NODE_ORDER) "count"
|
|
|
+ from RMS_GATEPOST RG
|
|
|
+ LEFT JOIN QMS_QUEUE_LIST QQL
|
|
|
+ on QQL.GRID_ID = RG.GATEPOST_ID and QQL.DELETED = 0
|
|
|
+ group by RG.GATEPOST_NAME
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询指令接收 -->
|
|
|
+ <select id="getOrderReceiveList" resultType="java.util.Map">
|
|
|
+ SELECT oo.ORDER_NUMBER as "orderNumber",
|
|
|
+ rc.CAPACITY_NUMBER as "capacityNumber",
|
|
|
+ qqr.RESULT_ACCEPT_TIME as "resultAcceptTime",
|
|
|
+ rg.GATEPOST_NAME as "gatepostName"
|
|
|
+ FROM QMS_QUEUE_RESULT qqr
|
|
|
+ LEFT JOIN QMS_QUEUE_LIST qql
|
|
|
+ ON qql.LIST_ID = qqr.LIST_ID
|
|
|
+ LEFT JOIN RMS_CAPACITY rc
|
|
|
+ ON rc.CAPACITY_ID = qql.CAPACITY_ID
|
|
|
+ LEFT JOIN QMS_QUEUE_GRID qqg
|
|
|
+ ON qqg.GRID_ID = qql.GRID_ID
|
|
|
+ LEFT JOIN RMS_GATEPOST rg
|
|
|
+ ON rg.GATEPOST_ID = qqg.QUEUE_LOCATION_ID
|
|
|
+ LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr
|
|
|
+ ON ttr.RESULT_TOTAL_ID = qqr.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER oo
|
|
|
+ ON ttr.ORDER_ID = oo.ORDER_ID
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据车牌号查询指令接收 -->
|
|
|
+ <select id="getOrderReceive2" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
+ SELECT DISTINCT oo.ORDER_NUMBER as "orderNumber",
|
|
|
+ rc.CAPACITY_NUMBER as "capacityNumber",
|
|
|
+ rg.GATEPOST_NAME as "gatepostName",
|
|
|
+ (
|
|
|
+ SELECT count(*)
|
|
|
+ FROM QMS_QUEUE_LIST qql
|
|
|
+ WHERE qql.DELETED = 0
|
|
|
+ AND qql.GRID_ID = #{gridId}
|
|
|
+ ) "count",
|
|
|
+ (
|
|
|
+ <![CDATA[
|
|
|
+ select count(*)
|
|
|
+ from QMS_QUEUE_LIST QQL2
|
|
|
+ join QMS_QUEUE_GRID QQG2
|
|
|
+ on QQG2.GRID_ID = QQL2.GRID_ID
|
|
|
+ where QQL2.LIST_NODE_ORDER <= QQL.list_node_order
|
|
|
+ and QQL2.GRID_ID = QQL.GRID_ID
|
|
|
+ and QQL2.DELETED = 0
|
|
|
+ ]]>) "listNodeOrder"
|
|
|
+ FROM QMS_QUEUE_RESULT qqr
|
|
|
+ LEFT JOIN RMS_CAPACITY rc
|
|
|
+ ON rc.CAPACITY_ID = qqr.CAPACITY_ID
|
|
|
+ LEFT JOIN QMS_QUEUE_GRID qqg
|
|
|
+ ON qqg.GRID_ID = qqr.GRID_ID
|
|
|
+ LEFT JOIN QMS_QUEUE_LIST qql
|
|
|
+ ON qqr.LIST_ID = qql.LIST_ID
|
|
|
+ LEFT JOIN RMS_GATEPOST rg
|
|
|
+ ON rg.GATEPOST_ID = qqg.QUEUE_LOCATION_ID
|
|
|
+ LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr
|
|
|
+ ON ttr.RESULT_TOTAL_ID = qqr.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER oo
|
|
|
+ ON ttr.ORDER_ID = oo.ORDER_ID
|
|
|
+ WHERE rc.CAPACITY_NUMBER = #{capacityNumber} and OO.ORDER_STATUS = 1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 通过车牌号查询网格id -->
|
|
|
+ <select id="getGridId" parameterType="java.lang.String" resultType="DECIMAL">
|
|
|
+ SELECT qqg.GRID_ID as "gridId"
|
|
|
+ FROM QMS_QUEUE_RESULT qqr
|
|
|
+ LEFT JOIN QMS_QUEUE_GRID qqg
|
|
|
+ ON qqr.GRID_ID = qqg.GRID_ID
|
|
|
+ LEFT JOIN RMS_CAPACITY rc
|
|
|
+ ON qqr.CAPACITY_ID = rc.CAPACITY_ID
|
|
|
+ WHERE qqr.RESULT_START_TIME IS NULL
|
|
|
+ AND rc.CAPACITY_NUMBER = #{capacityNumber}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getGridIdNotNull" parameterType="java.lang.String" resultType="DECIMAL">
|
|
|
+ SELECT qqg.GRID_ID as "gridId"
|
|
|
+ FROM QMS_QUEUE_RESULT qqr
|
|
|
+ LEFT JOIN QMS_QUEUE_GRID qqg
|
|
|
+ ON qqr.GRID_ID = qqg.GRID_ID
|
|
|
+ LEFT JOIN RMS_CAPACITY rc
|
|
|
+ ON qqr.CAPACITY_ID = rc.CAPACITY_ID
|
|
|
+ WHERE qqr.RESULT_END_TIME IS NULL
|
|
|
+ AND qqr.RESULT_CANCEL_TIME IS NULL
|
|
|
+ AND rc.CAPACITY_NUMBER = #{capacityNumber}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 通过运单号得到总实绩id -->
|
|
|
+ <select id="getResultTotalId" parameterType="java.lang.String" resultType="DECIMAL">
|
|
|
+ SELECT ttr.RESULT_TOTAL_ID
|
|
|
+ FROM TMSTRUCK_TOTAL_RESULT ttr
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER oo
|
|
|
+ ON ttr.ORDER_ID = oo.ORDER_ID
|
|
|
+ WHERE oo.ORDER_NUMBER = #{orderNumber}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 通过车牌号得到实绩id -->
|
|
|
+ <select id="getResultIdByCapacityId" parameterType="java.lang.String" resultType="DECIMAL">
|
|
|
+ SELECT qqr.RESULT_ID
|
|
|
+ FROM QMS_QUEUE_RESULT qqr
|
|
|
+ LEFT JOIN RMS_CAPACITY rc
|
|
|
+ ON rc.CAPACITY_ID = qqr.CAPACITY_ID
|
|
|
+ WHERE rc.CAPACITY_NUMBER = #{capacityNumber}
|
|
|
+ AND qqr.RESULT_END_TIME IS NULL
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 通过运力id和总实绩id查询排队实绩id -->
|
|
|
+ <select id="getQueueResultId" parameterType="java.util.Map" resultType="DECIMAL">
|
|
|
+ SELECT qqr.RESULT_ID as "resultId"
|
|
|
+ FROM QMS_QUEUE_RESULT qqr
|
|
|
+ WHERE qqr.CAPACITY_ID = #{capacityId}
|
|
|
+ AND qqr.RESULT_TOTAL_ID = #{resultTotalId}
|
|
|
+ </select>
|
|
|
+</mapper>
|