12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781 |
- <?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.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" />
- <result column="LOADING_SEQUENCE" jdbcType="DECIMAL" property="loadingSequence" />
- <result column="ISDEDUCT" jdbcType="DECIMAL" property="isdeduct" />
- <result column="SEGMENT_SQE" jdbcType="DECIMAL" property="segmentSqe" />
- <result column="CASE_NUMBER" jdbcType="VARCHAR" property="caseNumber" />
- <result column="CASE_NUMBERTWO" jdbcType="VARCHAR" property="caseNumbertwo" />
- <result column="CAPACITY_REMARK" jdbcType="VARCHAR" property="capacityRemark" />
- </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, LOADING_SEQUENCE, ISDEDUCT, SEGMENT_SQE, CASE_NUMBER, CASE_NUMBERTWO,
- CAPACITY_REMARK
- </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.LOADING_SEQUENCE, t.ISDEDUCT, t.SEGMENT_SQE, t.CASE_NUMBER, t.CASE_NUMBERTWO, t.CAPACITY_REMARK
- </sql>
- <sql id="select">
- SELECT <include refid="columns" /> FROM TMSTRUCK_LOAD_RESULT
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias" /> FROM TMSTRUCK_LOAD_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="resultLoadStartTime != null">
- and TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = #{resultLoadStartTime}
- </if>
- <if test="resultLoadEndTime != null">
- and TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = #{resultLoadEndTime}
- </if>
- <if test="resultLoadDuration != null">
- and RESULT_LOAD_DURATION = #{resultLoadDuration}
- </if>
- <if test="loadStandardTimeId != null">
- and LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
- </if>
- <if test="loaderId != null">
- and LOADER_ID = #{loaderId}
- </if>
- <if test="resultIsclear != null and resultIsclear != ''">
- and RESULT_ISCLEAR = #{resultIsclear}
- </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="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="status != null">
- and STATUS = #{status}
- </if>
- <if test="resultMeasuredTonnage != null">
- and RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
- </if>
- <if test="loadingId != null">
- and LOADING_ID = #{loadingId}
- </if>
- <if test="materialId != null">
- and MATERIAL_ID = #{materialId}
- </if>
- <if test="loadingSequence != null">
- and LOADING_SEQUENCE = #{loadingSequence}
- </if>
- <if test="isdeduct != null">
- and ISDEDUCT = #{isdeduct}
- </if>
- <if test="segmentSqe != null">
- and SEGMENT_SQE = #{segmentSqe}
- </if>
- <if test="caseNumber != null and caseNumber != ''">
- and CASE_NUMBER = #{caseNumber}
- </if>
- <if test="caseNumbertwo != null and caseNumbertwo != ''">
- and CASE_NUMBERTWO = #{caseNumbertwo}
- </if>
- <if test="capacityRemark != null and capacityRemark != ''">
- and CAPACITY_REMARK = #{capacityRemark}
- </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="resultLoadStartTime != null">
- and TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = #{resultLoadStartTime}
- </if>
- <if test="resultLoadEndTime != null">
- and TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = #{resultLoadEndTime}
- </if>
- <if test="resultLoadDuration != null">
- and RESULT_LOAD_DURATION = #{resultLoadDuration}
- </if>
- <if test="loadStandardTimeId != null">
- and LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
- </if>
- <if test="loaderId != null">
- and LOADER_ID = #{loaderId}
- </if>
- <if test="resultIsclear != null and resultIsclear != ''">
- and RESULT_ISCLEAR LIKE '%${resultIsclear}%'
- </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="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="status != null">
- and STATUS = #{status}
- </if>
- <if test="resultMeasuredTonnage != null">
- and RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
- </if>
- <if test="loadingId != null">
- and LOADING_ID = #{loadingId}
- </if>
- <if test="materialId != null">
- and MATERIAL_ID = #{materialId}
- </if>
- <if test="loadingSequence != null">
- and LOADING_SEQUENCE = #{loadingSequence}
- </if>
- <if test="isdeduct != null">
- and ISDEDUCT = #{isdeduct}
- </if>
- <if test="segmentSqe != null">
- and SEGMENT_SQE = #{segmentSqe}
- </if>
- <if test="caseNumber != null and caseNumber != ''">
- and CASE_NUMBER LIKE '%${caseNumber}%'
- </if>
- <if test="caseNumbertwo != null and caseNumbertwo != ''">
- and CASE_NUMBERTWO LIKE '%${caseNumbertwo}%'
- </if>
- <if test="capacityRemark != null and capacityRemark != ''">
- and CAPACITY_REMARK LIKE '%${capacityRemark}%'
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
- delete from TMSTRUCK_LOAD_RESULT
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from TMSTRUCK_LOAD_RESULT
- where 1!=1
- <if test="resultTotalId != null">
- or RESULT_TOTAL_ID = #{resultTotalId}
- </if>
- <if test="resultLoadStartTime != null">
- or TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = '#{resultLoadStartTime}'
- </if>
- <if test="resultLoadEndTime != null">
- or TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = '#{resultLoadEndTime}'
- </if>
- <if test="resultLoadDuration != null">
- or RESULT_LOAD_DURATION = #{resultLoadDuration}
- </if>
- <if test="loadStandardTimeId != null">
- or LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
- </if>
- <if test="loaderId != null">
- or LOADER_ID = #{loaderId}
- </if>
- <if test="resultIsclear != null and resultIsclear != ''">
- or RESULT_ISCLEAR = #{resultIsclear}
- </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="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="status != null">
- or STATUS = #{status}
- </if>
- <if test="resultMeasuredTonnage != null">
- or RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
- </if>
- <if test="loadingId != null">
- or LOADING_ID = #{loadingId}
- </if>
- <if test="materialId != null">
- or MATERIAL_ID = #{materialId}
- </if>
- <if test="loadingSequence != null">
- or LOADING_SEQUENCE = #{loadingSequence}
- </if>
- <if test="isdeduct != null">
- or ISDEDUCT = #{isdeduct}
- </if>
- <if test="segmentSqe != null">
- or SEGMENT_SQE = #{segmentSqe}
- </if>
- <if test="caseNumber != null and caseNumber != ''">
- or CASE_NUMBER = #{caseNumber}
- </if>
- <if test="caseNumbertwo != null and caseNumbertwo != ''">
- or CASE_NUMBERTWO = #{caseNumbertwo}
- </if>
- <if test="capacityRemark != null and capacityRemark != ''">
- or CAPACITY_REMARK = #{capacityRemark}
- </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,
- 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, LOADING_SEQUENCE,
- ISDEDUCT, SEGMENT_SQE, CASE_NUMBER,
- CASE_NUMBERTWO, CAPACITY_REMARK)
- 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}, #{loadingSequence,jdbcType=DECIMAL},
- #{isdeduct,jdbcType=DECIMAL}, #{segmentSqe,jdbcType=DECIMAL}, #{caseNumber,jdbcType=VARCHAR},
- #{caseNumbertwo,jdbcType=VARCHAR}, #{capacityRemark,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
- insert into TMSTRUCK_LOAD_RESULT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="resultId != null">
- RESULT_ID,
- </if>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID,
- </if>
- <if test="resultLoadStartTime != null">
- RESULT_LOAD_START_TIME,
- </if>
- <if test="resultLoadEndTime != null">
- RESULT_LOAD_END_TIME,
- </if>
- <if test="resultLoadDuration != null">
- RESULT_LOAD_DURATION,
- </if>
- <if test="loadStandardTimeId != null">
- LOAD_STANDARD_TIME_ID,
- </if>
- <if test="loaderId != null">
- LOADER_ID,
- </if>
- <if test="resultIsclear != null">
- RESULT_ISCLEAR,
- </if>
- <if test="deleteName != null">
- DELETE_NAME,
- </if>
- <if test="deleteTime != null">
- DELETE_TIME,
- </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="status != null">
- STATUS,
- </if>
- <if test="resultMeasuredTonnage != null">
- RESULT_MEASURED_TONNAGE,
- </if>
- <if test="loadingId != null">
- LOADING_ID,
- </if>
- <if test="materialId != null">
- MATERIAL_ID,
- </if>
- <if test="loadingSequence != null">
- LOADING_SEQUENCE,
- </if>
- <if test="isdeduct != null">
- ISDEDUCT,
- </if>
- <if test="segmentSqe != null">
- SEGMENT_SQE,
- </if>
- <if test="caseNumber != null">
- CASE_NUMBER,
- </if>
- <if test="caseNumbertwo != null">
- CASE_NUMBERTWO,
- </if>
- <if test="capacityRemark != null">
- CAPACITY_REMARK,
- </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="resultLoadStartTime != null">
- #{resultLoadStartTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultLoadEndTime != null">
- #{resultLoadEndTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultLoadDuration != null">
- #{resultLoadDuration,jdbcType=DECIMAL},
- </if>
- <if test="loadStandardTimeId != null">
- #{loadStandardTimeId,jdbcType=DECIMAL},
- </if>
- <if test="loaderId != null">
- #{loaderId,jdbcType=DECIMAL},
- </if>
- <if test="resultIsclear != null">
- #{resultIsclear,jdbcType=VARCHAR},
- </if>
- <if test="deleteName != null">
- #{deleteName,jdbcType=VARCHAR},
- </if>
- <if test="deleteTime != null">
- #{deleteTime,jdbcType=TIMESTAMP},
- </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="status != null">
- #{status,jdbcType=DECIMAL},
- </if>
- <if test="resultMeasuredTonnage != null">
- #{resultMeasuredTonnage,jdbcType=DECIMAL},
- </if>
- <if test="loadingId != null">
- #{loadingId,jdbcType=DECIMAL},
- </if>
- <if test="materialId != null">
- #{materialId,jdbcType=DECIMAL},
- </if>
- <if test="loadingSequence != null">
- #{loadingSequence,jdbcType=DECIMAL},
- </if>
- <if test="isdeduct != null">
- #{isdeduct,jdbcType=DECIMAL},
- </if>
- <if test="segmentSqe != null">
- #{segmentSqe,jdbcType=DECIMAL},
- </if>
- <if test="caseNumber != null">
- #{caseNumber,jdbcType=VARCHAR},
- </if>
- <if test="caseNumbertwo != null">
- #{caseNumbertwo,jdbcType=VARCHAR},
- </if>
- <if test="capacityRemark != null">
- #{capacityRemark,jdbcType=VARCHAR},
- </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},
- RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage,jdbcType=DECIMAL},
- LOADING_ID = #{loadingId,jdbcType=DECIMAL},
- MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
- LOADING_SEQUENCE = #{loadingSequence,jdbcType=DECIMAL},
- ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
- SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
- CASE_NUMBER = #{caseNumber,jdbcType=VARCHAR},
- CASE_NUMBERTWO = #{caseNumbertwo,jdbcType=VARCHAR},
- CAPACITY_REMARK = #{capacityRemark,jdbcType=VARCHAR}
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
- update TMSTRUCK_LOAD_RESULT
- <set>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
- </if>
- <if test="resultLoadStartTime != null">
- RESULT_LOAD_START_TIME = #{resultLoadStartTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultLoadEndTime != null">
- RESULT_LOAD_END_TIME = #{resultLoadEndTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultLoadDuration != null">
- RESULT_LOAD_DURATION = #{resultLoadDuration,jdbcType=DECIMAL},
- </if>
- <if test="loadStandardTimeId != null">
- LOAD_STANDARD_TIME_ID = #{loadStandardTimeId,jdbcType=DECIMAL},
- </if>
- <if test="loaderId != null">
- LOADER_ID = #{loaderId,jdbcType=DECIMAL},
- </if>
- <if test="resultIsclear != null">
- RESULT_ISCLEAR = #{resultIsclear,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="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="status != null">
- STATUS = #{status,jdbcType=DECIMAL},
- </if>
- <if test="resultMeasuredTonnage != null">
- RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage,jdbcType=DECIMAL},
- </if>
- <if test="loadingId != null">
- LOADING_ID = #{loadingId,jdbcType=DECIMAL},
- </if>
- <if test="materialId != null">
- MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
- </if>
- <if test="loadingSequence != null">
- LOADING_SEQUENCE = #{loadingSequence,jdbcType=DECIMAL},
- </if>
- <if test="isdeduct != null">
- ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
- </if>
- <if test="segmentSqe != null">
- SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
- </if>
- <if test="caseNumber != null">
- CASE_NUMBER = #{caseNumber,jdbcType=VARCHAR},
- </if>
- <if test="caseNumbertwo != null">
- CASE_NUMBERTWO = #{caseNumbertwo,jdbcType=VARCHAR},
- </if>
- <if test="capacityRemark != null">
- CAPACITY_REMARK = #{capacityRemark,jdbcType=VARCHAR},
- </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_LOAD_RESULT
- (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, LOADING_SEQUENCE,
- ISDEDUCT, SEGMENT_SQE, CASE_NUMBER,
- CASE_NUMBERTWO, CAPACITY_REMARK
- )
- ( <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.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}, #{item.loadingSequence,jdbcType=DECIMAL},
- #{item.isdeduct,jdbcType=DECIMAL}, #{item.segmentSqe,jdbcType=DECIMAL}, #{item.caseNumber,jdbcType=VARCHAR},
- #{item.caseNumbertwo,jdbcType=VARCHAR}, #{item.capacityRemark,jdbcType=VARCHAR}
- from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update TMSTRUCK_LOAD_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_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_LOAD_START_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadStartTime,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_LOAD_END_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadEndTime,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_LOAD_DURATION=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadDuration,jdbcType=DECIMAL}
- </foreach>
- ,LOAD_STANDARD_TIME_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.loadStandardTimeId,jdbcType=DECIMAL}
- </foreach>
- ,LOADER_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.loaderId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_ISCLEAR=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultIsclear,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>
- ,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>
- ,STATUS=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_MEASURED_TONNAGE=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultMeasuredTonnage,jdbcType=DECIMAL}
- </foreach>
- ,LOADING_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.loadingId,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>
- ,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>
- ,ISDEDUCT=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.isdeduct,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>
- ,CASE_NUMBER=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.caseNumber,jdbcType=VARCHAR}
- </foreach>
- ,CASE_NUMBERTWO=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.caseNumbertwo,jdbcType=VARCHAR}
- </foreach>
- ,CAPACITY_REMARK=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.capacityRemark,jdbcType=VARCHAR}
- </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_LOAD_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>
- </sql>
- <!-- 获取所有装车实绩 -->
- <select id="getCGJKLoadResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select *
- from (
- select TLR.RESULT_ID "resultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- TLR.RESULT_MEASURED_TONNAGE "resultMeasuredTonnage",
- TLR.RESULT_ISCLEAR "resultIsclear",
- to_char(TLR.RESULT_LOAD_START_TIME, 'yyyy-mm-dd') "resultLoadStartTime",
- TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
- TLR.INSERT_TIME "insertTime",
- RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
- RS.SUPPLIER_NAME "supplierName"
- from TMSTRUCK_LOAD_RESULT TLR
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on TTR.ORDER_ID = OO.ORDER_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OO.ORDER_ID = OOM.ORDER_ID
- left join AMS_PURCHASE_ORDER APO
- on OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
- left join DIL_BATCH DB
- on DB.BATCH_ID = APO.BATCH_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_SUPPLIER RS
- on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
- left join RMS_CONSIGNEE RCON
- on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
- where TLR.STATUS = #{status} and OO.ORDER_TYPE = #{orderTypee}
- )
- <where>
- <if test="purchaseOrderId != null">
- <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
- "purchaseOrderId" 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="orderMaterialWeight != null">
- and
- <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
- "orderMaterialWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultIsclear != null">
- and
- <foreach collection="resultIsclear" item="item" open="(" separator="or" close=")">
- "resultIsclear" like '%${item}%'
- </foreach>
- </if>
- <if test="resultLoadStartTime != null">
- and
- <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
- "resultLoadStartTime" like '%${item}%'
- </foreach>
- </if>
- <if test="insertUpdateRemark != null">
- and
- <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
- "insertUpdateRemark" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultLoadStartTime" desc
- </if>
- </select>
- <!-- 通过Id获取装车实绩 数据 用于修改-->
- <select id="getLoadResultById" parameterType="int" resultType="java.util.LinkedHashMap">
- select TLR.RESULT_ISCLEAR "resultIsclear",
- TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
- TLR.INSERT_UPDATE_REMARK "insertUpdateRemark"
- from TMSTRUCK_LOAD_RESULT TLR
- where RESULT_ID = #{resultId}
- </select>
- <!-- 通过发站查询所属港口 -->
- <select id="getPortIdBySendStationId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
- select RAS.OWNED_PORT_ID
- from RMSTRAIN_ARRIVAL_SEND RAS
- where RAS.ARRIVAL_ID = #{sendStationId}
- </select>
- <!-- 通过运输订单查询批次 -->
- <select id="getBatchIdByOrderId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
- select APO.BATCH_ID
- from OMSTRUCK_ORDER OO
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
- where OO.ORDER_ID = #{orderId}
- </select>
- <!--通过运输订单号查找运输订单类型-->
- <select id="selectOrderTypeByOrderNumber" resultType="java.lang.Integer" parameterType="java.lang.String">
- select OO.ORDER_TYPE "orderType"
- from OMSTRUCK_ORDER OO
- where OO.ORDER_NUMBER = #{oderNumber}
- </select>
- <!-- 通过运输订单号查询 出库实绩 最小Id(第一件扫描时间) 0 成功 1 失败-->
- <select id="getMinScanIdByOrderNum" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select WOSR.RESULT_ID "resultId",
- WOSR.LOAD_ID "loadId"
- from WMSP_OUTBOUND_RESULT WOR
- left join WMSP_OUTBOUND_SCAN_RESULT WOSR
- on WOSR.OUTBOUND_RESULT_ID = WOR.RESULT_ID
- left join OMSTRUCK_ORDER OO
- on OO.ORDER_ID = WOR.BILL_LADING_ID
- WHERE OO.ORDER_NUMBER = #{orderNumber}
- and WOR.MATERIAL_ID = #{materialId}
- and WOSR.RESULT_CHECK = 0
- ORDER BY WOSR.RESULT_LOAD_TIME
- )
- where rownum = 1
- </select>
- <!-- 根据运输订单号查找 -->
- <select id="selectResultIdByOrderNumber" resultType="java.lang.Integer" parameterType="java.lang.String">
- select WOSR.RESULT_ID "resultId"
- from OMSTRUCK_ORDER OO
- left join WMSP_OUTBOUND_RESULT WOR
- on OO.ORDER_ID = WOR.BILL_LADING_ID
- left join WMSP_OUTBOUND_SCAN_RESULT WOSR
- on WOSR.OUTBOUND_RESULT_ID = WOR.RESULT_ID
- WHERE OO.ORDER_NUMBER = #{orderNumber}
- and WOSR.RESULT_CHECK = 0
- </select>
- <!-- 根据实绩id查找扫描时间 -->
- <select id="selectLoadTimeByResultId" resultType="java.util.Date" parameterType="java.math.BigDecimal">
- select WOSR.RESULT_LOAD_TIME "loadTime"
- from WMSP_OUTBOUND_SCAN_RESULT WOSR
- where WOSR.RESULT_ID = #{resultId}
- </select>
- <!-- 根据扫描实绩id查询装卸工id -->
- <select id="selecLoadIdByresultId" resultType="java.lang.Integer">
- select WOSR.LOAD_ID "loadId"
- from WMSP_OUTBOUND_SCAN_RESULT WOSR
- where WOSR.RESULT_ID = #{resultId}
- </select>
- <!-- 销售装车实绩查询-->
- <select id="selectLoadResultForSale" resultType="java.util.Map" parameterType="java.lang.Integer">
- SELECT (SELECT ORDER_MATERIAL_NUMBER
- FROM OMSTRUCK_ORDER_MATERIAL OOM
- WHERE OOM.ORDER_ID = OO.ORDER_ID
- AND TLR.MATERIAL_ID = OOM.MATERIAL_ID) "orderMaterialNumber",
- TLR.RESULT_LOAD_START_TIME "startTime",
- TLR.RESULT_LOAD_END_TIME "endTime",
- TLR.RESULT_LOAD_DURATION "loadDuration",
- RM.MATERIAL_NAME "materialName",
- RP.PERSONNEL_NAME "name",
- RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
- OO.ORDER_NUMBER "orderNumber",
- ASO.SALE_NUMBER "saleNumber",
- RC.CAPACITY_NUMBER "capacityNumber"
- FROM TMSTRUCK_LOAD_RESULT TLR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN RMS_MATERIAL_STEEL RMS ON RMS.MATERIAL_STEEL_ID = TLR.MATERIAL_ID
- LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = RMS.MATERIAL_ID
- LEFT JOIN RMS_PERSONNEL RP ON TLR.LOADER_ID = RP.PERSONNEL_ID
- LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
- LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
- where TLR.STATUS = #{status}
- and OO.ORDER_TYPE = 1
- </select>
- <!--通过运输订单号查找物资id-->
- <select id="selectMaterialIdByOrderNumber" parameterType="java.lang.String" resultType="java.util.Map">
- SELECT
- OOM.MATERIAL_ID "materialId"
- FROM
- OMSTRUCK_ORDER OO
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
- WHERE
- <if test="orderNumber != null">
- OO.ORDER_NUMBER = #{orderNumber}
- </if>
- <if test="orderId != null">
- and OO.ORDER_ID = #{orderId}
- </if>
- </select>
- <!-- 通过订单ID 和物资Id 查询装车实绩ID 可能会有多条-->
- <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
- 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>
- <!--通过运输订单号查找装车实绩id-->
- <select id="selectLoadResultIdByOrderNumber" resultType="java.lang.Integer" parameterType="java.util.Map">
- SELECT TLR.RESULT_ID "loadResultId",
- TLR.RESULT_LOAD_START_TIME "startTime"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN TMSTRUCK_LOAD_RESULT TLR
- ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- WHERE OO.ORDER_NUMBER = #{orderNumber}
- </select>
- <!--内转物流查询汽车装车实绩 -->
- <select id="selectLoadResultForConverted" resultType="java.util.LinkedHashMap">
- select APO.PURCHASE_ORDER_NO "orderNo",
- TLR.INSERT_TIME "insertTime",
- RC.CAPACITY_NUMBER "capacityNumber",
- TLR.RESULT_MEASURED_TONNAGE "toggage",
- RAS.ARRIVAL_NAME "arrivelName",
- DB.RESULT_FOREIGN_SHIP_NAME "foreignShipName",
- OO.ORDER_NUMBER "orderNumber",
- RM.MATERIAL_NAME "materialName"
- from TMSTRUCK_LOAD_RESULT TLR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.RESULT_TOTAL_ID = TLR.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 DIL_BATCH DB
- ON DB.BATCH_ID = APO.BATCH_ID
- LEFT JOIN RMS_MATERIAL RM
- ON RM.MATERIAL_ID = TLR.MATERIAL_ID
- LEFT JOIN RMS_CAPACITY RC
- ON OO.CAPACITY_ID = RC.CAPACITY_ID
- LEFT JOIN TMSTRAIN_LOADING_RESULT TLR2
- ON TLR2.PURCHASE_ORDER_RAIL_PLAN_ID = OO.ORDER_PLAN_ID
- LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS
- ON RAS.ARRIVAL_ID = TLR.LOADING_ID
- </select>
- <!-- 根据实绩id渲染数据 -->
- <select id="selectLoadResultByResultId" resultType="java.lang.Integer">
- SELECT TLR.LOADING_ID "loadingId",
- TLR.MATERIAL_ID "materialId",
- TLR.RESULT_TOTAL_ID "totalId"
- FROM TMSTRUCK_LOAD_RESULT TLR
- WHERE TLR.RESULT_ID = #{resultId}
- </select>
- <!--通过车牌号号查找物资id和运力id以及总实绩id-->
- <select id="selectMaterialIdAndCapacityId" resultType="java.util.Map" parameterType="java.lang.Integer">
- select OOM.MATERIAL_ID "materialId",
- OO.CAPACITY_ID "capacityId",
- TTR.RESULT_TOTAL_ID "resultTotalId"
- from TMSTRUCK_TOTAL_RESULT TTR
- 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_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- where RC.CAPACITY_NUMBER = #{capacityNumber}
- </select>
- <!--根据id查找用户名 -->
- <select id="selectPersonNameByPersonnelId" resultType="java.lang.String" parameterType="java.lang.Integer">
- select RP.PERSONNEL_NAME "personnelName"
- from RMS_PERSONNEL RP
- where RP.PERSONNEL_ID = #{personnelId}
- </select>
- <select id="selectMaterialTypeByMaterialId" parameterType="java.lang.Integer" resultType="java.lang.Integer">
- select RMT.MATERIAL_TYPE_ID "materialTypeId"
- FROM RMS_MATERIAL RM
- LEFT JOIN RMS_MATERIAL_TYPE RMT
- ON RMT.MATERIAL_TYPE_ID = RM.MATERIAL_TYPE_ID
- where RM.MATERIAL_ID = #{materialId}
- </select>
- <!-- 查询销售装车实绩 -->
- <select id="getXSLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
- TLR.RESULT_LOAD_END_TIME "resultLoadEndTime",
- TLR.RESULT_LOAD_DURATION "resultLoadDuration",
- RP.PERSONNEL_NAME "personnelName",
- RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
- RM.MATERIAL_NAME "materialName",
- ASO.SALE_NUMBER "no",
- (CASE WHEN OOM.ORDER_MATERIAL_NUMBER is not null
- THEN OOM.ORDER_MATERIAL_NUMBER
- ELSE OOM.ORDER_MATERIAL_WEIGHT
- END) "materialNumWei",
- TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
- TLR.CASE_NUMBER "caseNumber"
- FROM TMSTRUCK_LOAD_RESULT TLR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
- ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
- LEFT JOIN AMS_SALE_ORDER ASO
- ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
- LEFT JOIN 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_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- LEFT JOIN RMS_PERSONNEL RP
- ON TLR.LOADER_ID = RP.PERSONNEL_ID
- where
- OO.ORDER_TYPE in (1, 2, 3)
- and TLR.STATUS = #{status}
- )
- <where>
- <if test="orderNumber != null">
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="no != null">
- and
- <foreach collection="no" item="item" open="(" separator="or" close=")">
- "no" like '%${item}%'
- </foreach>
- </if>
- <if test="materialNumWei != null">
- and
- <foreach collection="materialNumWei" item="item" open="(" separator="or" close=")">
- "materialNumWei" like '%${item}%'
- </foreach>
- </if>
- <if test="materialTheoreticalWeight != null">
- and
- <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
- "materialTheoreticalWeight" 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="resultLoadStartTime != null">
- and
- <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
- "resultLoadStartTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultLoadEndTime != null">
- and
- <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
- "resultLoadEndTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultLoadDuration != null">
- and
- <foreach collection="resultLoadDuration" item="item" open="(" separator="or" close=")">
- "resultLoadDuration" like '%${item}%'
- </foreach>
- </if>
- <if test="standardDataMax != null">
- and
- <foreach collection="standardDataMax" item="item" open="(" separator="or" close=")">
- "standardDataMax" like '%${item}%'
- </foreach>
- </if>
- <if test="personnelName != null">
- and
- <foreach collection="personnelName" item="item" open="(" separator="or" close=")">
- "personnelName" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultLoadStartTime" desc
- </if>
- </select>
- <!-- 通过港口ID获取仓库ID -->
- <select id="getWarehouseIdByPortId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
- select RW.WAREHOUSE_ID
- from RMS_WAREHOUSE RW
- where RW.WAREHOUSE_TYPE_ID = 4 and RW.PORT_ID = #{portId}
- </select>
- <!-- 通过物资ID和总实绩Id查询唯一的装车实绩Id -->
- <select id="getLoadResultIdByMIdAndTotalId" parameterType="java.util.Map" resultType="java.util.Map">
- select
- *
- from(
- select TLR.RESULT_ID "resultId",
- TLR.SEGMENT_SQE "segmentSqe"
- from TMSTRUCK_LOAD_RESULT TLR
- where TLR.RESULT_TOTAL_ID = #{resultTotalId}
- <if test="updateUnloadResult != null">
- and TLR.RESULT_LOAD_END_TIME is null
- </if>
- order by TLR.SEGMENT_SQE
- )
- where rownum = 1
- </select>
- <!-- 通过物资唯一编码 查找物资ID -->
- <select id="getMaterialIdByMaterialCode" parameterType="string" resultType="java.math.BigDecimal">
- select MATERIAL_ID
- from RMS_MATERIAL_STEEL
- 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",
- 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_CAPACITY RC
- on OO.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>
- <!-- 查询内转钢材到异地库装车实绩 -->
- <select id="getSteelNzLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM (
- select TLR.RESULT_ID "resultId",
- AROD.DAYPLAN_NO "dayplanNo",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
- TLR.RESULT_LOAD_END_TIME "resultLoadEndTime",
- TLR.RESULT_LOAD_DURATION "resultLoadDuration",
- RSD.STANDARD_DATA_MIN "standardDataMin",
- RM.MATERIAL_NAME "materialName",
- OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
- RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
- RP.PERSONNEL_NAME "personnelName"
- from TMSTRUCK_LOAD_RESULT TLR
- left join TMSTRUCK_TOTAL_RESULT TTR
- ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
- ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- LEFT JOIN RMS_PERSONNEL RP
- ON RP.PERSONNEL_ID = TLR.LOADER_ID
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
- ON OO.ORDER_ID = OOM.ORDER_ID AND OOM.MATERIAL_ID = TLR.MATERIAL_ID
- LEFT JOIN RMS_MATERIAL RM
- ON RM.MATERIAL_ID = OOM.MATERIAL_ID
- LEFT JOIN RMS_STANDARD_DATA RSD
- ON RSD.STANDARD_DATA_ID = TLR.LOAD_STANDARD_TIME_ID
- WHERE OO.ORDER_TYPE = 4
- AND TLR.RESULT_LOAD_START_TIME IS NOT NULL
- AND TLR.STATUS = 0
- )
- <where>
- <if test="dayplanNo != null">
- <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
- "dayplanNo" like '%${item}%'
- </foreach>
- <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="resultLoadStartTime != null">
- and
- <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
- "resultLoadStartTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultLoadEndTime != null">
- and
- <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
- "resultLoadEndTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultLoadDuration != null">
- and
- <foreach collection="resultLoadDuration" item="item" open="(" separator="or" close=")">
- "resultLoadDuration" like '%${item}%'
- </foreach>
- </if>
- <if test="standardDataMin != null">
- and
- <foreach collection="standardDataMin" item="item" open="(" separator="or" close=")">
- "standardDataMin" 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="materialTheoreticalWeight != null">
- and
- <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
- "materialTheoreticalWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="personnelName != null">
- and
- <foreach collection="personnelName" item="item" open="(" separator="or" close=")">
- "personnelName" like '%${item}%'
- </foreach>
- </if>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultLoadStartTime" desc
- </if>
- </select>
- <!-- 查询内转进口矿/国产矿装车实绩 -->
- <select id="getImportedDomesticNzLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT
- *
- FROM (
- SELECT APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
- RW.WAREHOUSE_NAME "warehouseName",
- TLR.RESULT_LOAD_END_TIME "resultLoadEndTime",
- TLR.RESULT_LOAD_DURATION "loadDuration"
- FROM TMSTRUCK_LOAD_RESULT TLR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.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 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 RM.MATERIAL_ID = OOM.MATERIAL_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = TLR.LOADING_ID
- WHERE OO.ORDER_TYPE in (10,20,15,16)
- AND TLR.RESULT_LOAD_START_TIME IS NOT NULL
- <if test="userId !=null">
- and AIR.INSERT_USERNAME = #{userId}
- </if>
- order by tlr.result_load_end_time
- )
- <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="resultLoadStartTime != null">
- and
- <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
- "resultLoadStartTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultLoadEndTime != null">
- and
- <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
- "resultLoadEndTime" 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="loadDuration != null">
- and
- <foreach collection="loadDuration" item="item" open="(" separator="or" close=")">
- "loadDuration" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultLoadStartTime" desc
- </if>
- </select>
- <!-- 查询内转厂内物资装车实绩 -->
- <select id="getInFactoryLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
- TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
- TLR.RESULT_LOAD_END_TIME "resultLoadEndTime",
- TLR.RESULT_LOAD_DURATION "resultLoadDuration",
- RW.WAREHOUSE_NAME "warehouseName",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- RC.CAPACITY_NUMBER || RM.MATERIAL_NAME || RW.WAREHOUSE_NAME "likeCon"
- FROM TMSTRUCK_LOAD_RESULT TLR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.RESULT_TOTAL_ID = TLR.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 RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = TLR.LOADING_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
- ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
- WHERE OO.ORDER_TYPE = #{orderTypee}
- AND TLR.RESULT_LOAD_START_TIME IS NOT NULL
- <if test="oneDate != null">
- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TLR.RESULT_LOAD_END_TIME
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TLR.RESULT_LOAD_END_TIME
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLR.RESULT_LOAD_END_TIME
- </if>
- )
- <where>
- <if test="con != null">
- and "likeCon" like #{con}
- </if>
- <if test="resultLoadEndTime != null">
- and <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
- "resultLoadEndTime" 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="resultLoadDuration != null">
- and
- <foreach collection="resultLoadDuration" item="item" open="(" separator="or" close=")">
- "resultLoadDuration" 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="orderMaterialWeight != null">
- and
- <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
- "orderMaterialWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultLoadStartTime != null">
- and
- <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
- to_char("resultLoadStartTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
- </foreach>
- </if>
- <if test="resultLoadEndTime != null">
- and
- <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
- to_char("resultLoadEndTime",'yyyy-mm-dd hh24:mi:ss') 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>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultLoadStartTime" desc
- </if>
- </select>
- <select id="getResultId" resultType="java.math.BigDecimal" parameterType="DeCimal">
- select tlr.result_id "resultId" from tmstruck_load_result tlr
- where tlr.result_total_id=#{totalId}
- </select>
- <select id="getOrderType" resultType="java.lang.Integer">
- select oo.order_type
- from tmstruck_total_result ttr
- left join omstruck_order oo
- on oo.order_id = ttr.order_id
- where ttr.result_total_id = #{totalId}
- </select>
- <!-- 根据订单id查询所有的零星物资出厂实绩-->
- <select id="getSporadicSuppliesLoadResult" resultType="java.util.Map">
- select *
- from (
- select distinct
- TLR.RESULT_ID "resultId",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- TLR.RESULT_MEASURED_TONNAGE "resultMeasuredTonnage",
- TLR.RESULT_ISCLEAR "resultIsclear",
- to_char(TLR.RESULT_LOAD_START_TIME, 'yyyy-mm-dd') "resultLoadStartTime",
- TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
- TLR.INSERT_TIME "insertTime",
- RM.MATERIAL_NAME "materialName",
- OOM.ORDER_MATERIAL_NUMBER "materialNumber",
- OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
- TWR.RESULT_NET_WEIGHT "netWeight"
- from TMSTRUCK_LOAD_RESULT TLR
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join TMSTRUCK_WEIGHT_RESULT TWR
- on TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on TTR.ORDER_ID = OO.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
- where TLR.STATUS = #{status}
- and TLR.RESULT_LOAD_START_TIME IS NOT NULL
- <if test="orderTypee != 100">
- AND OO.ORDER_TYPE = #{orderTypee}
- </if>
- <if test="orderTypee == 100">
- AND OO.ORDER_TYPE in (12, 13 ,14,19)
- </if>
- <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">
- 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="resultIsclear != null">
- and
- <foreach collection="resultIsclear" item="item" open="(" separator="or" close=")">
- "resultIsclear" like '%${item}%'
- </foreach>
- </if>
- <if test="resultLoadStartTime != null">
- and
- <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
- "resultLoadStartTime" like '%${item}%'
- </foreach>
- </if>
- <if test="insertUpdateRemark != null">
- and
- <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
- "insertUpdateRemark" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultLoadStartTime" desc
- </if>
- </select>
- <!-- 获取采购内转装车实绩 -->
- <select id="getCgNzLoadingResult" resultType="java.util.Map" parameterType="java.lang.Integer">
- select *from ( select OO.ORDER_NUMBER "orderNumber",
- OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
- OO.ORDER_RECEIVE_REFUSE_TIME "orderReceiveRefuseTime",
- RW.WAREHOUSE_NAME "warehouseName",
- RM.MATERIAL_NAME "materialName",
- RC.CAPACITY_NUMBER "capacityNumber",
- RW2.WAREHOUSE_NAME "warehouseName2",
- OO.INSERT_UPDATE_REMARK "insertUpdateRemark",
- TTR.RESULT_TOTAL_ID "resultTotalId"
- from OMSTRUCK_ORDER OO
- 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 = OO.UNLOAD_POINT_ID
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TTR.ORDER_ID = OO.ORDER_ID
- left join TMSTRUCK_LOAD_RESULT TLR
- on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join RMS_WAREHOUSE RW2
- on RW2.WAREHOUSE_ID = TLR.LOADING_ID
- where OO.ORDER_STATUS = #{orderStatus}
- and TLR.RESULT_LOAD_END_TIME IS NULL
- and OO.ORDER_TYPE = #{orderType})
- </select>
- <select id="getInsertUpdateRemark" resultType="java.util.Map" parameterType="java.util.Map">
- select OO.LINE_ID "lineId",
- OO.ORDER_ID "orderId"
- from OMSTRUCK_ORDER OO
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TTR.ORDER_ID=OO.ORDER_ID
- left join TMSTRUCK_LOAD_RESULT TLR
- on TTR.RESULT_TOTAL_ID=TLR.RESULT_TOTAL_ID
- where TTR.RESULT_TOTAL_ID=#{resultTotalId}
- </select>
- <select id="allOutFactoryNum" resultType="int" parameterType="java.math.BigDecimal">
- select TLFR.RESULT_ID
- from OMSTRUCK_ORDER OO
- left join TMSTRUCK_TOTAL_RESULT TTR on TTR.ORDER_ID = OO.ORDER_ID
- left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
- where OO.ORDER_ID = #{orderId}
- and TLFR.RESULT_OUT_GATE_TIME is null
- order by TLFR.SEGMENT_SQE
- </select>
- <update id="updateSqe" parameterType="java.util.Map">
- update OMSTRUCK_ORDER OO
- set OO.ORDER_LINE_SEQUENCE =
- (
- select MAX(RLS.SEGMENT_SQE)
- from OMSTRUCK_ORDER OO
- left join RMS_LINE RL
- on OO.LINE_ID = RL.LINE_ID
- left join RMS_LINE_SEGEMNT RLS
- on RL.LINE_ID = RLS.LINE_ID
- where OO.ORDER_ID = #{orderId}
- ) - 1
- where OO.ORDER_ID = #{orderId}
- </update>
- <select id="checkMaterialIdLoad" resultType="java.lang.Integer">
- select TLR.RESULT_ID
- from TMSTRUCK_LOAD_RESULT TLR
- where TLR.RESULT_TOTAL_ID = #{resultTotalId}
- and TLR.MATERIAL_ID = #{materialId}
- </select>
- <select id="getSteelLoadResult" parameterType="java.math.BigDecimal" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT OO.ORDER_ID "orderId",
- OO.ORDER_TYPE "orderType",
- TTR.RESULT_TOTAL_ID "resultTotalId",
- TLR.RESULT_ID "resultId",
- TLR.SEGMENT_SQE "segmentSqe",
- RC.CAPACITY_NUMBER "capacityNumber"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN TMSTRUCK_LOAD_RESULT TLR ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
- LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
- WHERE TLR.RESULT_LOAD_END_TIME IS NULL
- <if test="orderId != null">
- AND OO.ORDER_ID = #{orderId}
- </if>
- <if test="orderNumber != null">
- AND OO.ORDER_NUMBER = #{orderNumber}
- </if>
- ORDER BY TLR.SEGMENT_SQE
- )
- WHERE ROWNUM = 1
- </select>
- <select id="getLoadResultMap" resultType="java.util.Map" parameterType="decimal">
- select TLR.RESULT_LOAD_END_TIME "loadEndTime" from TMSTRUCK_LOAD_RESULT TLR
- WHERE TLR.RESULT_TOTAL_ID = #{resultTotalId}
- </select>
- </mapper>
|