|
@@ -2,47 +2,45 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.steerinfo.dil.mapper.TmstruckLoadResultMapper">
|
|
|
<resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckLoadResult">
|
|
|
- <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId"/>
|
|
|
- <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId"/>
|
|
|
- <result column="RESULT_LOAD_START_TIME" jdbcType="TIMESTAMP" property="resultLoadStartTime"/>
|
|
|
- <result column="RESULT_LOAD_END_TIME" jdbcType="TIMESTAMP" property="resultLoadEndTime"/>
|
|
|
- <result column="RESULT_LOAD_DURATION" jdbcType="DECIMAL" property="resultLoadDuration"/>
|
|
|
- <result column="LOAD_STANDARD_TIME_ID" jdbcType="DECIMAL" property="loadStandardTimeId"/>
|
|
|
- <result column="LOADER_ID" jdbcType="DECIMAL" property="loaderId"/>
|
|
|
- <result column="RESULT_ISCLEAR" jdbcType="VARCHAR" property="resultIsclear"/>
|
|
|
- <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName"/>
|
|
|
- <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime"/>
|
|
|
- <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="STATUS" jdbcType="DECIMAL" property="status"/>
|
|
|
- <result column="RESULT_MEASURED_TONNAGE" jdbcType="DECIMAL" property="resultMeasuredTonnage"/>
|
|
|
- <result column="LOADING_ID" jdbcType="DECIMAL" property="loadingId"/>
|
|
|
- <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId"/>
|
|
|
+ <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
|
|
|
+ <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
|
|
|
+ <result column="RESULT_LOAD_START_TIME" jdbcType="TIMESTAMP" property="resultLoadStartTime" />
|
|
|
+ <result column="RESULT_LOAD_END_TIME" jdbcType="TIMESTAMP" property="resultLoadEndTime" />
|
|
|
+ <result column="RESULT_LOAD_DURATION" jdbcType="DECIMAL" property="resultLoadDuration" />
|
|
|
+ <result column="LOAD_STANDARD_TIME_ID" jdbcType="DECIMAL" property="loadStandardTimeId" />
|
|
|
+ <result column="LOADER_ID" jdbcType="DECIMAL" property="loaderId" />
|
|
|
+ <result column="RESULT_ISCLEAR" jdbcType="VARCHAR" property="resultIsclear" />
|
|
|
+ <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
|
|
|
+ <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
|
|
|
+ <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="STATUS" jdbcType="DECIMAL" property="status" />
|
|
|
+ <result column="RESULT_MEASURED_TONNAGE" jdbcType="DECIMAL" property="resultMeasuredTonnage" />
|
|
|
+ <result column="LOADING_ID" jdbcType="DECIMAL" property="loadingId" />
|
|
|
+ <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
|
|
|
+ <result column="LOADING_SEQUENCE" jdbcType="DECIMAL" property="loadingSequence" />
|
|
|
</resultMap>
|
|
|
<sql id="columns">
|
|
|
RESULT_ID, RESULT_TOTAL_ID, RESULT_LOAD_START_TIME, RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION,
|
|
|
- LOAD_STANDARD_TIME_ID, LOADER_ID, RESULT_ISCLEAR, DELETE_NAME, DELETE_TIME, INSERT_USERNAME,
|
|
|
- INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
|
|
|
- LOADING_ID, MATERIAL_ID
|
|
|
+ LOAD_STANDARD_TIME_ID, LOADER_ID, RESULT_ISCLEAR, DELETE_NAME, DELETE_TIME, INSERT_USERNAME,
|
|
|
+ INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
|
|
|
+ LOADING_ID, MATERIAL_ID, LOADING_SEQUENCE
|
|
|
</sql>
|
|
|
<sql id="columns_alias">
|
|
|
t.RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_LOAD_START_TIME, t.RESULT_LOAD_END_TIME,
|
|
|
- t.RESULT_LOAD_DURATION, t.LOAD_STANDARD_TIME_ID, t.LOADER_ID, t.RESULT_ISCLEAR, t.DELETE_NAME,
|
|
|
- t.DELETE_TIME, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
|
|
|
- t.INSERT_UPDATE_REMARK, t.STATUS, t.RESULT_MEASURED_TONNAGE, t.LOADING_ID, t.MATERIAL_ID
|
|
|
+ t.RESULT_LOAD_DURATION, t.LOAD_STANDARD_TIME_ID, t.LOADER_ID, t.RESULT_ISCLEAR, t.DELETE_NAME,
|
|
|
+ t.DELETE_TIME, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
|
|
|
+ t.INSERT_UPDATE_REMARK, t.STATUS, t.RESULT_MEASURED_TONNAGE, t.LOADING_ID, t.MATERIAL_ID,
|
|
|
+ t.LOADING_SEQUENCE
|
|
|
</sql>
|
|
|
<sql id="select">
|
|
|
- SELECT
|
|
|
- <include refid="columns"/>
|
|
|
- FROM TMSTRUCK_LOAD_RESULT
|
|
|
+ SELECT <include refid="columns" /> FROM TMSTRUCK_LOAD_RESULT
|
|
|
</sql>
|
|
|
<sql id="select_alias">
|
|
|
- SELECT
|
|
|
- <include refid="columns_alias"/>
|
|
|
- FROM TMSTRUCK_LOAD_RESULT t
|
|
|
+ SELECT <include refid="columns_alias" /> FROM TMSTRUCK_LOAD_RESULT t
|
|
|
</sql>
|
|
|
<sql id="where">
|
|
|
<where>
|
|
@@ -103,6 +101,9 @@
|
|
|
<if test="materialId != null">
|
|
|
and MATERIAL_ID = #{materialId}
|
|
|
</if>
|
|
|
+ <if test="loadingSequence != null">
|
|
|
+ and LOADING_SEQUENCE = #{loadingSequence}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<sql id="whereLike">
|
|
@@ -164,11 +165,13 @@
|
|
|
<if test="materialId != null">
|
|
|
and MATERIAL_ID = #{materialId}
|
|
|
</if>
|
|
|
+ <if test="loadingSequence != null">
|
|
|
+ and LOADING_SEQUENCE = #{loadingSequence}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
|
|
|
- delete
|
|
|
- from TMSTRUCK_LOAD_RESULT
|
|
|
+ delete from TMSTRUCK_LOAD_RESULT
|
|
|
where RESULT_ID = #{resultId,jdbcType=DECIMAL}
|
|
|
</delete>
|
|
|
<delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
@@ -228,6 +231,9 @@
|
|
|
<if test="materialId != null">
|
|
|
or MATERIAL_ID = #{materialId}
|
|
|
</if>
|
|
|
+ <if test="loadingSequence != null">
|
|
|
+ or LOADING_SEQUENCE = #{loadingSequence}
|
|
|
+ </if>
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
|
|
|
insert into TMSTRUCK_LOAD_RESULT (RESULT_ID, RESULT_TOTAL_ID, RESULT_LOAD_START_TIME,
|
|
@@ -236,16 +242,16 @@
|
|
|
DELETE_NAME, DELETE_TIME, INSERT_USERNAME,
|
|
|
INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
|
|
|
INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
|
|
|
- LOADING_ID, MATERIAL_ID)
|
|
|
- values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL},
|
|
|
- #{resultLoadStartTime,jdbcType=TIMESTAMP},
|
|
|
+ LOADING_ID, MATERIAL_ID, LOADING_SEQUENCE
|
|
|
+ )
|
|
|
+ values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{resultLoadStartTime,jdbcType=TIMESTAMP},
|
|
|
#{resultLoadEndTime,jdbcType=TIMESTAMP}, #{resultLoadDuration,jdbcType=DECIMAL},
|
|
|
#{loadStandardTimeId,jdbcType=DECIMAL}, #{loaderId,jdbcType=DECIMAL}, #{resultIsclear,jdbcType=VARCHAR},
|
|
|
#{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR},
|
|
|
#{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
|
|
|
- #{insertUpdateRemark,jdbcType=VARCHAR}, #{status,jdbcType=DECIMAL},
|
|
|
- #{resultMeasuredTonnage,jdbcType=DECIMAL},
|
|
|
- #{loadingId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL})
|
|
|
+ #{insertUpdateRemark,jdbcType=VARCHAR}, #{status,jdbcType=DECIMAL}, #{resultMeasuredTonnage,jdbcType=DECIMAL},
|
|
|
+ #{loadingId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{loadingSequence,jdbcType=DECIMAL}
|
|
|
+ )
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
|
|
|
insert into TMSTRUCK_LOAD_RESULT
|
|
@@ -307,6 +313,9 @@
|
|
|
<if test="materialId != null">
|
|
|
MATERIAL_ID,
|
|
|
</if>
|
|
|
+ <if test="loadingSequence != null">
|
|
|
+ LOADING_SEQUENCE,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="resultId != null">
|
|
@@ -366,28 +375,32 @@
|
|
|
<if test="materialId != null">
|
|
|
#{materialId,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
+ <if test="loadingSequence != null">
|
|
|
+ #{loadingSequence,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
|
|
|
update TMSTRUCK_LOAD_RESULT
|
|
|
- set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
|
|
|
- RESULT_LOAD_START_TIME = #{resultLoadStartTime,jdbcType=TIMESTAMP},
|
|
|
- RESULT_LOAD_END_TIME = #{resultLoadEndTime,jdbcType=TIMESTAMP},
|
|
|
- RESULT_LOAD_DURATION = #{resultLoadDuration,jdbcType=DECIMAL},
|
|
|
- LOAD_STANDARD_TIME_ID = #{loadStandardTimeId,jdbcType=DECIMAL},
|
|
|
- LOADER_ID = #{loaderId,jdbcType=DECIMAL},
|
|
|
- RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
|
|
|
- DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
|
|
|
- DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
|
|
|
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
|
|
|
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
|
|
|
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
|
|
|
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
- STATUS = #{status,jdbcType=DECIMAL},
|
|
|
+ set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
|
|
|
+ RESULT_LOAD_START_TIME = #{resultLoadStartTime,jdbcType=TIMESTAMP},
|
|
|
+ RESULT_LOAD_END_TIME = #{resultLoadEndTime,jdbcType=TIMESTAMP},
|
|
|
+ RESULT_LOAD_DURATION = #{resultLoadDuration,jdbcType=DECIMAL},
|
|
|
+ LOAD_STANDARD_TIME_ID = #{loadStandardTimeId,jdbcType=DECIMAL},
|
|
|
+ LOADER_ID = #{loaderId,jdbcType=DECIMAL},
|
|
|
+ RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
|
|
|
+ DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
|
|
|
+ DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
|
|
|
+ INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
|
|
|
+ INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
|
|
|
+ UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
|
|
|
+ UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
+ STATUS = #{status,jdbcType=DECIMAL},
|
|
|
RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage,jdbcType=DECIMAL},
|
|
|
- LOADING_ID = #{loadingId,jdbcType=DECIMAL},
|
|
|
- MATERIAL_ID = #{materialId,jdbcType=DECIMAL}
|
|
|
+ LOADING_ID = #{loadingId,jdbcType=DECIMAL},
|
|
|
+ MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
|
|
|
+ LOADING_SEQUENCE = #{loadingSequence,jdbcType=DECIMAL}
|
|
|
where RESULT_ID = #{resultId,jdbcType=DECIMAL}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
|
|
@@ -447,20 +460,23 @@
|
|
|
<if test="materialId != null">
|
|
|
MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
+ <if test="loadingSequence != null">
|
|
|
+ LOADING_SEQUENCE = #{loadingSequence,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where RESULT_ID = #{resultId,jdbcType=DECIMAL}
|
|
|
</update>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
|
|
|
- <include refid="select"/>
|
|
|
+ <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"/>
|
|
|
+ <include refid="select" />
|
|
|
+ <include refid="where" />
|
|
|
</select>
|
|
|
<select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
- <include refid="select"/>
|
|
|
- <include refid="whereLike"/>
|
|
|
+ <include refid="select" />
|
|
|
+ <include refid="whereLike" />
|
|
|
</select>
|
|
|
<insert id="batchInsert" parameterType="java.util.List">
|
|
|
insert into TMSTRUCK_LOAD_RESULT
|
|
@@ -472,20 +488,20 @@
|
|
|
INSERT_USERNAME, INSERT_TIME,
|
|
|
UPDATE_USERNAME, UPDATE_TIME,
|
|
|
INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
|
|
|
- LOADING_ID, MATERIAL_ID)
|
|
|
+ LOADING_ID, MATERIAL_ID, LOADING_SEQUENCE
|
|
|
+ )
|
|
|
( <foreach collection="list" item="item" separator="union all">
|
|
|
select
|
|
|
#{item.resultId,jdbcType=DECIMAL},
|
|
|
#{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultLoadStartTime,jdbcType=TIMESTAMP},
|
|
|
#{item.resultLoadEndTime,jdbcType=TIMESTAMP}, #{item.resultLoadDuration,jdbcType=DECIMAL},
|
|
|
#{item.loadStandardTimeId,jdbcType=DECIMAL}, #{item.loaderId,jdbcType=DECIMAL},
|
|
|
- #{item.resultIsclear,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR},
|
|
|
- #{item.deleteTime,jdbcType=TIMESTAMP},
|
|
|
+ #{item.resultIsclear,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP},
|
|
|
#{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
|
|
|
#{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
|
|
|
- #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.status,jdbcType=DECIMAL},
|
|
|
- #{item.resultMeasuredTonnage,jdbcType=DECIMAL},
|
|
|
- #{item.loadingId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL} from dual
|
|
|
+ #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.status,jdbcType=DECIMAL}, #{item.resultMeasuredTonnage,jdbcType=DECIMAL},
|
|
|
+ #{item.loadingId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL}, #{item.loadingSequence,jdbcType=DECIMAL}
|
|
|
+ from dual
|
|
|
</foreach> )
|
|
|
</insert>
|
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
@@ -567,6 +583,10 @@
|
|
|
<foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
|
|
|
when #{item.resultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
|
|
|
</foreach>
|
|
|
+ ,LOADING_SEQUENCE=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.loadingSequence,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
where RESULT_ID in
|
|
|
<foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
|
|
|
#{item.resultId,jdbcType=DECIMAL}
|
|
@@ -581,7 +601,6 @@
|
|
|
</delete>
|
|
|
<!-- 友情提示!!!-->
|
|
|
<!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
-
|
|
|
<sql id="orderBy">
|
|
|
<if test="orderField != null and orderField != ''">
|
|
|
order by "${orderField}"
|
|
@@ -811,7 +830,7 @@
|
|
|
</select>
|
|
|
|
|
|
<!-- 通过订单ID 和物资Id 查询装车实绩ID 可能会有多条-->
|
|
|
- <select id="getLoadResultIdList" parameterType="java.util.Map" resultType="java.lang.Integer">
|
|
|
+ <select id="getLoadResultId" parameterType="java.util.Map" resultType="java.lang.Integer">
|
|
|
select TLR.RESULT_ID
|
|
|
from OMSTRUCK_ORDER OO
|
|
|
left join TMSTRUCK_TOTAL_RESULT TTR
|
|
@@ -1054,4 +1073,78 @@
|
|
|
where MATERIAL_ONLY_CODE = #{materialOnlyCode}
|
|
|
</select>
|
|
|
|
|
|
+<!-- 查询所有正在进行进厂排队的销售订单 -->
|
|
|
+ <select id="getSaleOrderOnQueue" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ select *
|
|
|
+ from (
|
|
|
+ select OO.ORDER_ID "orderId",
|
|
|
+ OO.ORDER_NUMBER "orderNumber",
|
|
|
+ ASO.SALE_NUMBER "saleNumber",
|
|
|
+ RCD.DRIVER_NAME "driverName",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ OO.ORDER_ISSUE_TIME "orderIssueTime"
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ left join AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
|
|
|
+ left join AMS_SALE_ORDER ASO
|
|
|
+ on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
|
|
|
+ left join RMS_DRIVER_CAPACITY RDC
|
|
|
+ on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
|
|
|
+ left join RMS_CAR_DRIVER RCD
|
|
|
+ on RCD.DRIVER_ID = RDC.DRIVER_ID
|
|
|
+ left join RMS_CAPACITY RC
|
|
|
+ on RDC.CAPACITY_ID = RC.CAPACITY_ID
|
|
|
+ where OO.ORDER_ID in (select OO.ORDER_ID
|
|
|
+ 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
|
|
|
+ where QQR.RESULT_START_TIME is not null
|
|
|
+ and QQR.RESULT_END_TIME is null
|
|
|
+ and OO.ORDER_TYPE = 1)
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="saleNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "saleNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="driverName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="driverName" item="item" open="(" separator="or" close=")">
|
|
|
+ "driverName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "orderIssueTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!-- 通过订单Id和物资Id确定唯一的装车实绩Id -->
|
|
|
+ <select id="getLoadIdByOrderIdAndMId" parameterType="java.util.Map" resultType="java.lang.Integer">
|
|
|
+ select TLR.RESULT_ID
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on TTR.ORDER_ID = OO.ORDER_ID
|
|
|
+ left join TMSTRUCK_LOAD_RESULT TLR
|
|
|
+ on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ where OO.ORDER_ID = #{orderId}
|
|
|
+ and TLR.MATERIAL_ID = #{materialId}
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|