12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052 |
- <?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.TmstruckUnloadResultMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckUnloadResult">
- <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
- <result column="RESULT_NUMBER" jdbcType="VARCHAR" property="resultNumber" />
- <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
- <result column="RESULT_START_TIME" jdbcType="TIMESTAMP" property="resultStartTime" />
- <result column="RESULT_END_TIME" jdbcType="TIMESTAMP" property="resultEndTime" />
- <result column="RESULT_DURATION" jdbcType="DECIMAL" property="resultDuration" />
- <result column="UNLOAD_STATUS" jdbcType="VARCHAR" property="unloadStatus" />
- <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="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
- <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
- <result column="RESULT_UNLOAD_PLACE_ID" jdbcType="DECIMAL" property="resultUnloadPlaceId" />
- <result column="SEGMENT_SQE" jdbcType="DECIMAL" property="segmentSqe" />
- <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
- <result column="UNLOADER_ID" jdbcType="DECIMAL" property="unloaderId" />
- </resultMap>
- <sql id="columns">
- RESULT_ID, RESULT_NUMBER, RESULT_TOTAL_ID, RESULT_START_TIME, RESULT_END_TIME, RESULT_DURATION,
- UNLOAD_STATUS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
- DELETE_NAME, DELETE_TIME, RESULT_UNLOAD_PLACE_ID, SEGMENT_SQE, MATERIAL_ID, UNLOADER_ID
- </sql>
- <sql id="columns_alias">
- t.RESULT_ID, t.RESULT_NUMBER, t.RESULT_TOTAL_ID, t.RESULT_START_TIME, t.RESULT_END_TIME,
- t.RESULT_DURATION, t.UNLOAD_STATUS, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
- t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETE_NAME, t.DELETE_TIME, t.RESULT_UNLOAD_PLACE_ID,
- t.SEGMENT_SQE, t.MATERIAL_ID, t.UNLOADER_ID
- </sql>
- <sql id="select">
- SELECT <include refid="columns" /> FROM TMSTRUCK_UNLOAD_RESULT
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias" /> FROM TMSTRUCK_UNLOAD_RESULT t
- </sql>
- <sql id="where">
- <where>
- <if test="resultId != null">
- and RESULT_ID = #{resultId}
- </if>
- <if test="resultNumber != null and resultNumber != ''">
- and RESULT_NUMBER = #{resultNumber}
- </if>
- <if test="resultTotalId != null">
- and RESULT_TOTAL_ID = #{resultTotalId}
- </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="resultDuration != null">
- and RESULT_DURATION = #{resultDuration}
- </if>
- <if test="unloadStatus != null and unloadStatus != ''">
- and UNLOAD_STATUS = #{unloadStatus}
- </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="deleteName != null and deleteName != ''">
- and DELETE_NAME = #{deleteName}
- </if>
- <if test="deleteTime != null">
- and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
- </if>
- <if test="resultUnloadPlaceId != null">
- and RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId}
- </if>
- <if test="segmentSqe != null">
- and SEGMENT_SQE = #{segmentSqe}
- </if>
- <if test="materialId != null">
- and MATERIAL_ID = #{materialId}
- </if>
- <if test="unloaderId != null">
- and UNLOADER_ID = #{unloaderId}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="resultId != null">
- and RESULT_ID = #{resultId}
- </if>
- <if test="resultNumber != null and resultNumber != ''">
- and RESULT_NUMBER LIKE '%${resultNumber}%'
- </if>
- <if test="resultTotalId != null">
- and RESULT_TOTAL_ID = #{resultTotalId}
- </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="resultDuration != null">
- and RESULT_DURATION = #{resultDuration}
- </if>
- <if test="unloadStatus != null and unloadStatus != ''">
- and UNLOAD_STATUS LIKE '%${unloadStatus}%'
- </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="deleteName != null and deleteName != ''">
- and DELETE_NAME LIKE '%${deleteName}%'
- </if>
- <if test="deleteTime != null">
- and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
- </if>
- <if test="resultUnloadPlaceId != null">
- and RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId}
- </if>
- <if test="segmentSqe != null">
- and SEGMENT_SQE = #{segmentSqe}
- </if>
- <if test="materialId != null">
- and MATERIAL_ID = #{materialId}
- </if>
- <if test="unloaderId != null">
- and UNLOADER_ID = #{unloaderId}
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
- delete from TMSTRUCK_UNLOAD_RESULT
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from TMSTRUCK_UNLOAD_RESULT
- where 1!=1
- <if test="resultNumber != null and resultNumber != ''">
- or RESULT_NUMBER = #{resultNumber}
- </if>
- <if test="resultTotalId != null">
- or RESULT_TOTAL_ID = #{resultTotalId}
- </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="resultDuration != null">
- or RESULT_DURATION = #{resultDuration}
- </if>
- <if test="unloadStatus != null and unloadStatus != ''">
- or UNLOAD_STATUS = #{unloadStatus}
- </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="deleteName != null and deleteName != ''">
- or DELETE_NAME = #{deleteName}
- </if>
- <if test="deleteTime != null">
- or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
- </if>
- <if test="resultUnloadPlaceId != null">
- or RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId}
- </if>
- <if test="segmentSqe != null">
- or SEGMENT_SQE = #{segmentSqe}
- </if>
- <if test="materialId != null">
- or MATERIAL_ID = #{materialId}
- </if>
- <if test="unloaderId != null">
- or UNLOADER_ID = #{unloaderId}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
- insert into TMSTRUCK_UNLOAD_RESULT (RESULT_ID, RESULT_NUMBER, RESULT_TOTAL_ID,
- RESULT_START_TIME, RESULT_END_TIME, RESULT_DURATION,
- UNLOAD_STATUS, INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
- DELETE_NAME, DELETE_TIME, RESULT_UNLOAD_PLACE_ID,
- SEGMENT_SQE, MATERIAL_ID, UNLOADER_ID
- )
- values (#{resultId,jdbcType=DECIMAL}, #{resultNumber,jdbcType=VARCHAR}, #{resultTotalId,jdbcType=DECIMAL},
- #{resultStartTime,jdbcType=TIMESTAMP}, #{resultEndTime,jdbcType=TIMESTAMP}, #{resultDuration,jdbcType=DECIMAL},
- #{unloadStatus,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
- #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
- #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{resultUnloadPlaceId,jdbcType=DECIMAL},
- #{segmentSqe,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{unloaderId,jdbcType=DECIMAL}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
- insert into TMSTRUCK_UNLOAD_RESULT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="resultId != null">
- RESULT_ID,
- </if>
- <if test="resultNumber != null">
- RESULT_NUMBER,
- </if>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID,
- </if>
- <if test="resultStartTime != null">
- RESULT_START_TIME,
- </if>
- <if test="resultEndTime != null">
- RESULT_END_TIME,
- </if>
- <if test="resultDuration != null">
- RESULT_DURATION,
- </if>
- <if test="unloadStatus != null">
- UNLOAD_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="deleteName != null">
- DELETE_NAME,
- </if>
- <if test="deleteTime != null">
- DELETE_TIME,
- </if>
- <if test="resultUnloadPlaceId != null">
- RESULT_UNLOAD_PLACE_ID,
- </if>
- <if test="segmentSqe != null">
- SEGMENT_SQE,
- </if>
- <if test="materialId != null">
- MATERIAL_ID,
- </if>
- <if test="unloaderId != null">
- UNLOADER_ID,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="resultId != null">
- #{resultId,jdbcType=DECIMAL},
- </if>
- <if test="resultNumber != null">
- #{resultNumber,jdbcType=VARCHAR},
- </if>
- <if test="resultTotalId != null">
- #{resultTotalId,jdbcType=DECIMAL},
- </if>
- <if test="resultStartTime != null">
- #{resultStartTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultEndTime != null">
- #{resultEndTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultDuration != null">
- #{resultDuration,jdbcType=DECIMAL},
- </if>
- <if test="unloadStatus != null">
- #{unloadStatus,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="deleteName != null">
- #{deleteName,jdbcType=VARCHAR},
- </if>
- <if test="deleteTime != null">
- #{deleteTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultUnloadPlaceId != null">
- #{resultUnloadPlaceId,jdbcType=DECIMAL},
- </if>
- <if test="segmentSqe != null">
- #{segmentSqe,jdbcType=DECIMAL},
- </if>
- <if test="materialId != null">
- #{materialId,jdbcType=DECIMAL},
- </if>
- <if test="unloaderId != null">
- #{unloaderId,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
- update TMSTRUCK_UNLOAD_RESULT
- set RESULT_NUMBER = #{resultNumber,jdbcType=VARCHAR},
- RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
- RESULT_START_TIME = #{resultStartTime,jdbcType=TIMESTAMP},
- RESULT_END_TIME = #{resultEndTime,jdbcType=TIMESTAMP},
- RESULT_DURATION = #{resultDuration,jdbcType=DECIMAL},
- UNLOAD_STATUS = #{unloadStatus,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},
- DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
- DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
- RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId,jdbcType=DECIMAL},
- SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
- MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
- UNLOADER_ID = #{unloaderId,jdbcType=DECIMAL}
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
- update TMSTRUCK_UNLOAD_RESULT
- <set>
- <if test="resultNumber != null">
- RESULT_NUMBER = #{resultNumber,jdbcType=VARCHAR},
- </if>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
- </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="resultDuration != null">
- RESULT_DURATION = #{resultDuration,jdbcType=DECIMAL},
- </if>
- <if test="unloadStatus != null">
- UNLOAD_STATUS = #{unloadStatus,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="deleteName != null">
- DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
- </if>
- <if test="deleteTime != null">
- DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultUnloadPlaceId != null">
- RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId,jdbcType=DECIMAL},
- </if>
- <if test="segmentSqe != null">
- SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
- </if>
- <if test="materialId != null">
- MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
- </if>
- <if test="unloaderId != null">
- UNLOADER_ID = #{unloaderId,jdbcType=DECIMAL},
- </if>
- </set>
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.lang.Short" 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 TMSTRUCK_UNLOAD_RESULT
- (RESULT_ID,
- RESULT_NUMBER, RESULT_TOTAL_ID,
- RESULT_START_TIME, RESULT_END_TIME,
- RESULT_DURATION, UNLOAD_STATUS,
- INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME,
- INSERT_UPDATE_REMARK, DELETE_NAME,
- DELETE_TIME, RESULT_UNLOAD_PLACE_ID,
- SEGMENT_SQE, MATERIAL_ID, UNLOADER_ID
- )
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.resultId,jdbcType=DECIMAL},
- #{item.resultNumber,jdbcType=VARCHAR}, #{item.resultTotalId,jdbcType=DECIMAL},
- #{item.resultStartTime,jdbcType=TIMESTAMP}, #{item.resultEndTime,jdbcType=TIMESTAMP},
- #{item.resultDuration,jdbcType=DECIMAL}, #{item.unloadStatus,jdbcType=VARCHAR},
- #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
- #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
- #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR},
- #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.resultUnloadPlaceId,jdbcType=DECIMAL},
- #{item.segmentSqe,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL}, #{item.unloaderId,jdbcType=DECIMAL}
- from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update TMSTRUCK_UNLOAD_RESULT
- set
- RESULT_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_NUMBER=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultNumber,jdbcType=VARCHAR}
- </foreach>
- ,RESULT_TOTAL_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_START_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultStartTime,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_END_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEndTime,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_DURATION=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultDuration,jdbcType=DECIMAL}
- </foreach>
- ,UNLOAD_STATUS=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.unloadStatus,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- ,DELETE_NAME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
- </foreach>
- ,DELETE_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_UNLOAD_PLACE_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultUnloadPlaceId,jdbcType=DECIMAL}
- </foreach>
- ,SEGMENT_SQE=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.segmentSqe,jdbcType=DECIMAL}
- </foreach>
- ,MATERIAL_ID=
- <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>
- ,UNLOADER_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.unloaderId,jdbcType=DECIMAL}
- </foreach>
- where RESULT_ID in
- <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
- #{item.resultId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from TMSTRUCK_UNLOAD_RESULT
- where RESULT_ID in
- <foreach close=")" collection="list" item="id" open="(" 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>
- <if test="orderField == null ">
- order by "resultEndTime" desc
- </if>
- </sql>
- <!-- 获取采购卸货实绩 -->
- <select id="getCGUnloadResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select *
- from (
- select
- TUR.RESULT_ID "resultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RM.MATERIAL_NAME "materialName",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- RW.WAREHOUSE_NAME "warehouseName",
- TUR.RESULT_END_TIME "resultEndTime",
- TUR.INSERT_TIME "insertTime"
- from TMSTRUCK_UNLOAD_RESULT TUR
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TUR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join TMSTRUCK_WEIGHT_RESULT TWR
- on TWR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on OO.ORDER_ID = TTR.ORDER_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 OOM.MATERIAL_ID = RM.MATERIAL_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_WAREHOUSE RW
- on RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
- where RESULT_END_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" 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="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="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" 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="resultStartTime != null">
- and
- <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
- "resultStartTime" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 通过总实绩Id查询卸货实绩Id -->
- <select id="getResultIdByTotalId" parameterType="DECIMAL" resultType="DECIMAL">
- SELECT RESULT_ID
- FROM TMSTRUCK_UNLOAD_RESULT
- WHERE RESULT_TOTAL_ID = #{resultTotalId}
- </select>
- <!-- 通过运输订单号 查询实绩Id、总实绩ID -->
- <select id="selectTotalIdByOrderNo" parameterType="java.lang.String" resultType="java.util.Map">
- select OO.ORDER_ID "orderId",
- OO.ORDER_TYPE "orderTypee",
- TUR.RESULT_ID "resultId",
- TTR.RESULT_TOTAL_ID "resultTotalId",
- RC.CAPACITY_NUMBER "capacityNumber",
- TUR.SEGMENT_SQE "segmentSqe"
- from OMSTRUCK_ORDER OO
- left join TMSTRUCK_TOTAL_RESULT TTR
- on OO.ORDER_ID = TTR.ORDER_ID
- left join TMSTRUCK_UNLOAD_RESULT TUR
- on TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- where OO.ORDER_NUMBER = #{orderNumber}
- </select>
- <!-- 通过卸货地点查询 仓库ID-->
- <select id="getWarehouseIdByWName" parameterType="string" resultType="java.math.BigDecimal">
- select WAREHOUSE_ID
- from RMS_WAREHOUSE
- where WAREHOUSE_NAME = #{warehouseName}
- </select>
- <!-- 通过总实绩ID查询订单中卸货实绩 -->
- <select id="getUnloadPointId" resultType="java.math.BigDecimal" parameterType="java.util.Map">
- select OO.UNLOAD_POINT_ID from OMSTRUCK_ORDER OO
- left join TMSTRUCK_TOTAL_RESULT TTR
- on OO.ORDER_ID = TTR.ORDER_ID
- where TTR.RESULT_TOTAL_ID = #{resultTotalId}
- </select>
- <!-- 查询内转采购进口矿国产矿实绩 -->
- <select id="getImportedDomesticNzUnloadResult" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select TUR.RESULT_ID "resultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RM.MATERIAL_NAME "materialName",
- DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- RW.WAREHOUSE_NAME "warehouseName",
- TUR.RESULT_START_TIME "resultStartTime",
- TUR.INSERT_TIME "insertTime"
- from TMSTRUCK_UNLOAD_RESULT TUR
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TUR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join TMSTRUCK_WEIGHT_RESULT TWR
- on TWR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on OO.ORDER_ID = TTR.ORDER_ID
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
- left join DIL_BATCH DB
- on DB.BATCH_ID = APO.BATCH_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OOM.ORDER_ID = OO.ORDER_ID
- left join RMS_MATERIAL RM
- on OOM.MATERIAL_ID = RM.MATERIAL_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_WAREHOUSE RW
- on RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
- where RESULT_START_TIME is not null
- and OO.ORDER_TYPE = 9
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" 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="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="orderMaterialNumber != null">
- and
- <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
- "orderMaterialNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" 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="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" 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="resultStartTime != null">
- and
- <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
- "resultStartTime" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 查询内转采购进口矿国产矿实绩(老区-厂内) -->
- <select id="getImportedDomesticNzUnload2Result" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM ( SELECT TUR.RESULT_ID "resultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RM.MATERIAL_NAME "materialName",
- RW.WAREHOUSE_NAME "warehouseName",
- TUR.RESULT_END_TIME "resultEndTime"
- FROM TMSTRUCK_UNLOAD_RESULT TUR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_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 amstruck_inward_plan aip
- on aip.plan_id = oo.order_plan_id
- left join amstruck_requirement_plan arp
- on arp.plan_id = aip.plan_id
- left join amstruck_inward_requirement air
- on air.requirement_id = arp.requirement_id
- LEFT JOIN AMS_PURCHASE_ORDER APO
- ON APO.PURCHASE_ORDER_ID = air.PURCHASE_ORDER_ID
- LEFT JOIN RMS_MATERIAL RM
- ON RM.MATERIAL_ID = OOM.MATERIAL_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
- WHERE TUR.RESULT_END_TIME IS NOT NULL
- AND OO.ORDER_TYPE = 10
- <if test="userId !=null">
- AND AIR.INSERT_USERNAME = #{userId}
- </if>
- )
- <where>
- <if test="orderNumber != null">
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" 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>
- </select>
- <!-- 查询内转厂内卸货实绩 -->
- <select id="getInFactoryUnloadResult" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT TUR.RESULT_ID "resultId",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RM.MATERIAL_NAME "materialName",
- OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
- TUR.RESULT_START_TIME "resultStartTime",
- TUR.RESULT_END_TIME "resultEndTime",
- TUR.RESULT_DURATION "resultDuration",
- RW.WAREHOUSE_NAME "warehouseName"
- FROM TMSTRUCK_UNLOAD_RESULT TUR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_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_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
- WHERE TUR.RESULT_START_TIME IS NOT NULL
- AND OO.ORDER_TYPE = 11
- )
- <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="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialNumber != null">
- and
- <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
- "orderMaterialNumber" 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="resultStartTime != null">
- and
- <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
- "resultStartTime" 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="resultDuration != null">
- and
- <foreach collection="resultDuration" item="item" open="(" separator="or" close=")">
- "resultDuration" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 根据总实绩ID查询卸货地点-->
- <select id="getSporadicSuppliesUnloadResult" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT distinct
- TUR.RESULT_ID "resultId",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- TUR.RESULT_START_TIME "resultStartTime",
- TUR.RESULT_END_TIME "resultEndTime",
- TUR.RESULT_DURATION "resultDuration",
- RW.WAREHOUSE_NAME "warehouseName",
- RM.MATERIAL_NAME "materialName",
- OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
- OOM.ORDER_MATERIAL_NUMBER "materialNumber",
- TWR.RESULT_NET_WEIGHT "orderMaterialNetWeight"
- FROM TMSTRUCK_UNLOAD_RESULT TUR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
- ON TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_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 AMSTRUCK_SPORADIC_ORDER ASO
- ON OO.ORDER_PLAN_ID = ASO.SPORADIC_ORDER_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
- WHERE TUR.RESULT_END_TIME IS NOT NULL
- AND OO.ORDER_TYPE = #{orderTypee}
- <if test="userId != null">
- and ASO.INSERT_USERNAME=#{userId}
- </if>
- <if test="userIds!=null">
- and ASO.UPDATE_USERNAME=#{userIds}
- </if>
- )
- <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="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" 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="resultEndTime != null">
- and
- <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
- "resultEndTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultDuration != null">
- and
- <foreach collection="resultDuration" item="item" open="(" separator="or" close=")">
- "resultDuration" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 根据优先级查询物资 -->
- <select id="selectMaterialForUnload" resultType="java.util.Map">
- select OOM.MATERIAL_ID "materialId",
- OO.ORDER_ID "orderId"
- from OMSTRUCK_ORDER_MATERIAL OOM
- JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID=OOM.ORDER_ID
- where OO.ORDER_NUMBER=#{orderNumber}
- ORDER BY OOM.MATERIAL_PRIORITY
- </select>
- <!-- 根据物资是否计量 -->
- <select id="selectUnloadMaterialId" resultType="java.lang.Integer" parameterType="java.util.Map">
- SELECT
- COUNT( * )
- FROM
- OMSTRUCK_ORDER_MATERIAL OOM
- JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = OOM.ORDER_ID
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- WHERE OOM.MATERIAL_ID=#{materialId} AND OO.ORDER_ID=#{orderId}
- </select>
- </mapper>
|