12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235 |
- <?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.TmstruckReceiptResultMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckReceiptResult">
- <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
-
- <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
- <result column="RESULT_EMPTY_CONTAINER_PHOTO" jdbcType="VARCHAR" property="resultEmptyContainerPhoto" />
- <result column="RESULT_SIGNED_NOTE_PHOTO" jdbcType="VARCHAR" property="resultSignedNotePhoto" />
- <result column="RESULT_RECEIVE_NOTE_PHOTO" jdbcType="VARCHAR" property="resultReceiveNotePhoto" />
- <result column="WAREHOUSE_ID" jdbcType="DECIMAL" property="warehouseId" />
- <result column="ORDER_MILEAGE" jdbcType="DECIMAL" property="orderMileage" />
- <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="STATUS" jdbcType="DECIMAL" property="status" />
- <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
- <result column="RESULT_ARRIVAL_ADDRESS" jdbcType="VARCHAR" property="resultArrivalAddress" />
- </resultMap>
- <sql id="columns">
- RESULT_ID, RESULT_TOTAL_ID, RESULT_EMPTY_CONTAINER_PHOTO, RESULT_SIGNED_NOTE_PHOTO,
- RESULT_RECEIVE_NOTE_PHOTO, WAREHOUSE_ID,ORDER_MILEAGE, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME,STATUS, INSERT_UPDATE_REMARK, RESULT_ARRIVAL_ADDRESS
- </sql>
- <sql id="columns_alias">
- t.RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_EMPTY_CONTAINER_PHOTO, t.RESULT_SIGNED_NOTE_PHOTO,
- t.RESULT_RECEIVE_NOTE_PHOTO, t.WAREHOUSE_ID,ORDER_MILEAGE, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
- t.UPDATE_TIME,STATUS, t.INSERT_UPDATE_REMARK, t.RESULT_ARRIVAL_ADDRESS
- </sql>
- <sql id="select">
- SELECT <include refid="columns" /> FROM TMSTRUCK_RECEIPT_RESULT
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias" /> FROM TMSTRUCK_RECEIPT_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="resultEmptyContainerPhoto != null and resultEmptyContainerPhoto != ''">
- and RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
- </if>
- <if test="resultSignedNotePhoto != null and resultSignedNotePhoto != ''">
- and RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
- </if>
- <if test="resultReceiveNotePhoto != null and resultReceiveNotePhoto != ''">
- and RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
- </if>
- <if test="warehouseId != null">
- and WAREHOUSE_ID = #{warehouseId}
- </if>
- <if test="orderMileage != null">
- and ORDER_MILEAGE = #{orderMileage}
- </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="status != null">
- and STATUS = #{status}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
- and RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress}
- </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="resultEmptyContainerPhoto != null and resultEmptyContainerPhoto != ''">
- and RESULT_EMPTY_CONTAINER_PHOTO LIKE '%${resultEmptyContainerPhoto}%'
- </if>
- <if test="resultSignedNotePhoto != null and resultSignedNotePhoto != ''">
- and RESULT_SIGNED_NOTE_PHOTO LIKE '%${resultSignedNotePhoto}%'
- </if>
- <if test="resultReceiveNotePhoto != null and resultReceiveNotePhoto != ''">
- and RESULT_RECEIVE_NOTE_PHOTO LIKE '%${resultReceiveNotePhoto}%'
- </if>
- <if test="warehouseId != null">
- and WAREHOUSE_ID = #{warehouseId}
- </if>
- <if test="orderMileage != null">
- and ORDER_MILEAGE = #{orderMileage}
- </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="status != null">
- and STATUS = #{status}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
- </if>
- <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
- and RESULT_ARRIVAL_ADDRESS LIKE '%${resultArrivalAddress}%'
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
- delete from TMSTRUCK_RECEIPT_RESULT
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from TMSTRUCK_RECEIPT_RESULT
- where 1!=1
- <if test="resultTotalId != null">
- or RESULT_TOTAL_ID = #{resultTotalId}
- </if>
- <if test="resultEmptyContainerPhoto != null and resultEmptyContainerPhoto != ''">
- or RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
- </if>
- <if test="resultSignedNotePhoto != null and resultSignedNotePhoto != ''">
- or RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
- </if>
- <if test="resultReceiveNotePhoto != null and resultReceiveNotePhoto != ''">
- or RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
- </if>
- <if test="warehouseId != null">
- or WAREHOUSE_ID = #{warehouseId}
- </if>
- <if test="orderMileage != null">
- or ORDER_MILEAGE = #{orderMileage}
- </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="status != null">
- or STATUS = '#{status}'
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
- or RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
- insert into TMSTRUCK_RECEIPT_RESULT (RESULT_ID, RESULT_TOTAL_ID, RESULT_EMPTY_CONTAINER_PHOTO,
- RESULT_SIGNED_NOTE_PHOTO, RESULT_RECEIVE_NOTE_PHOTO,
- WAREHOUSE_ID,ORDER_MILEAGE, INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME,STATUS, INSERT_UPDATE_REMARK,
- RESULT_ARRIVAL_ADDRESS)
- values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
- #{resultSignedNotePhoto,jdbcType=VARCHAR}, #{resultReceiveNotePhoto,jdbcType=VARCHAR},
- #{warehouseId,jdbcType=DECIMAL},#{orderMileage,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
- #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},#{status,jdbcType=DECIMAL}, #{insertUpdateRemark,jdbcType=VARCHAR},
- #{resultArrivalAddress,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
- insert into TMSTRUCK_RECEIPT_RESULT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="resultId != null">
- RESULT_ID,
- </if>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID,
- </if>
- <if test="resultEmptyContainerPhoto != null">
- RESULT_EMPTY_CONTAINER_PHOTO,
- </if>
- <if test="resultSignedNotePhoto != null">
- RESULT_SIGNED_NOTE_PHOTO,
- </if>
- <if test="resultReceiveNotePhoto != null">
- RESULT_RECEIVE_NOTE_PHOTO,
- </if>
- <if test="warehouseId != null">
- WAREHOUSE_ID,
- </if>
- <if test="orderMileage != null">
- ORDER_MILEAGE,
- </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="status != null">
- STATUS,
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK,
- </if>
- <if test="resultArrivalAddress != null">
- RESULT_ARRIVAL_ADDRESS,
- </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="resultEmptyContainerPhoto != null">
- #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
- </if>
- <if test="resultSignedNotePhoto != null">
- #{resultSignedNotePhoto,jdbcType=VARCHAR},
- </if>
- <if test="resultReceiveNotePhoto != null">
- #{resultReceiveNotePhoto,jdbcType=VARCHAR},
- </if>
- <if test="warehouseId != null">
- #{warehouseId,jdbcType=DECIMAL},
- </if>
- <if test="orderMileage != null">
- #{orderMileage,jdbcType=DECIMAL},
- </if>
- <if test="insertUsername != null">
- #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="status != null">
- #{status,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUpdateRemark != null">
- #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- <if test="resultArrivalAddress != null">
- #{resultArrivalAddress,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
- update TMSTRUCK_RECEIPT_RESULT
- set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
- RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
- RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=VARCHAR},
- RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=VARCHAR},
- WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
- ORDER_MILEAGE = #{orderMileage,jdbcType=DECIMAL},
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- STATUS = #{status,jdbcType=DECIMAL},
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress,jdbcType=VARCHAR}
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
- update TMSTRUCK_RECEIPT_RESULT
- <set>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
- </if>
- <if test="resultEmptyContainerPhoto != null">
- RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
- </if>
- <if test="resultSignedNotePhoto != null">
- RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=VARCHAR},
- </if>
- <if test="resultReceiveNotePhoto != null">
- RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=VARCHAR},
- </if>
- <if test="warehouseId != null">
- WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
- </if>
- <if test="orderMileage != null">
- ORDER_MILEAGE = #{orderMileage,jdbcType=DECIMAL},
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="status != null">
- STATUS = #{status,jdbcType=DECIMAL},
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- <if test="resultArrivalAddress != null">
- RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress,jdbcType=VARCHAR},
- </if>
- </set>
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
- <include refid="select" />
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </select>
- <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select" />
- <include refid="where" />
- </select>
- <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select" />
- <include refid="whereLike" />
- </select>
- <insert id="batchInsert" parameterType="java.util.List">
- insert into TMSTRUCK_RECEIPT_RESULT
- (RESULT_ID,
- RESULT_TOTAL_ID, RESULT_EMPTY_CONTAINER_PHOTO,
- RESULT_SIGNED_NOTE_PHOTO, RESULT_RECEIVE_NOTE_PHOTO,
- WAREHOUSE_ID,ORDER_MILEAGE, INSERT_USERNAME,
- INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, STATUS,INSERT_UPDATE_REMARK,
- RESULT_ARRIVAL_ADDRESS)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.resultId,jdbcType=DECIMAL},
- #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultEmptyContainerPhoto,jdbcType=VARCHAR},
- #{item.resultSignedNotePhoto,jdbcType=VARCHAR}, #{item.resultReceiveNotePhoto,jdbcType=VARCHAR},
- #{item.warehouseId,jdbcType=DECIMAL},#{item.orderMileage,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
- #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
- #{item.updateTime,jdbcType=TIMESTAMP},#{item.status,jdbcType=DECIMAL}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
- #{item.resultArrivalAddress,jdbcType=VARCHAR} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update TMSTRUCK_RECEIPT_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_EMPTY_CONTAINER_PHOTO=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEmptyContainerPhoto,jdbcType=VARCHAR}
- </foreach>
- ,RESULT_SIGNED_NOTE_PHOTO=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultSignedNotePhoto,jdbcType=VARCHAR}
- </foreach>
- ,RESULT_RECEIVE_NOTE_PHOTO=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultReceiveNotePhoto,jdbcType=VARCHAR}
- </foreach>
- ,WAREHOUSE_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.warehouseId,jdbcType=DECIMAL}
- </foreach>
- ,ORDER_MILEAGE=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.orderMileage,jdbcType=DECIMAL}
- </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>
- ,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>
- ,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>
- ,RESULT_ARRIVAL_ADDRESS=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultArrivalAddress,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_RECEIPT_RESULT
- where RESULT_ID in
- <foreach close=")" collection="list" item="id" open="(" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-
-
- <!-- 获取最大ID值 -->
-
- <!-- 通过总实绩ID 查询签收实绩ID -->
- <select id="getIdByTotalResultId" parameterType="int" resultType="int">
- select TRR.RESULT_ID from TMSTRUCK_RECEIPT_RESULT TRR where TRR.RESULT_TOTAL_ID = #{totalResultId}
- </select>
-
- <!--通过总实绩Id 更新 状态码 为 1 已签收-->
- <update id="updateByTotalResultId" parameterType="java.util.Map">
- update TMSTRUCK_RECEIPT_RESULT
- <set>
- <if test="warehouseId != null">
- WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- </if>
-
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- STATUS = #{status,jdbcType=DECIMAL},
- </if>
- <if test="resultEmptyContainerPhoto != null">
- RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=BLOB},
- </if>
- <if test="resultSignedNotePhoto != null">
- RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=BLOB},
- </if>
- <if test="resultReceiveNotePhoto != null">
- RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=BLOB},
- </if>
- </set>
- where RESULT_TOTAL_ID = #{resultTotalId}
- </update>
-
- <!-- 通过签收时间排序 -->
- <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 "insertTime" desc
- </if>
- </sql>
-
- <!-- 查询所有签收实绩 -->
- <select id="getCGReceiptResult" parameterType="java.util.Map" resultType="java.util.Map">
- select
- *
- from (
- select
- OO.ORDER_ID "orderId",
- TRR.RESULT_ID "resultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
- TUR.UNLOAD_STATUS "unloadStatus",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- RW.WAREHOUSE_NAME "warehouseName",
- TRR.INSERT_USERNAME "insertUsername",
- TRR.INSERT_TIME "insertTime"
- from TMSTRUCK_RECEIPT_RESULT TRR
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TTR.RESULT_TOTAL_ID = TRR.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 RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join TMSTRUCK_WEIGHT_RESULT TWR
- on TWR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
- left join TMSTRUCK_UNLOAD_RESULT TUR
- on TUR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_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_WAREHOUSE RW
- on RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
- where TRR.STATUS = 1 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="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" like '%${item}%'
- </foreach>
- </if>
- <if test="unloadStatus != null">
- and
- <foreach collection="unloadStatus" item="item" open="(" separator="or" close=")">
- "unloadStatus" 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="insertUsername != null">
- and
- <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
- "insertUsername" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
-
- <!-- 查询内转钢材到异地库收货实绩-->
- <select id="getSteelNzReceiptResult" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT TRR.RESULT_ID "resultId",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RW.WAREHOUSE_NAME "warehouseName",
- TRR.INSERT_TIME "insertTime",
- TRR.INSERT_USERNAME "insertUsername"
- FROM TMSTRUCK_RECEIPT_RESULT TRR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = TRR.WAREHOUSE_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- WHERE OO.ORDER_TYPE = 4 AND TRR.STATUS = 1
- )
- <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="insertTime != null">
- and
- <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
- "insertTime" like '%${item}%'
- </foreach>
- </if>
- <if test="insertUsername != null">
- and
- <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
- "insertUsername" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
-
- <select id="getInwardReceipt" parameterType="java.util.Map" resultType="java.util.Map">
-
- select *
- from (
- select TRR.RESULT_ID "resultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
- TUR.UNLOAD_STATUS "unloadStatus",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- tqr.result_issampling "issampling",
- TRR.INSERT_USERNAME "insertUsername",
- TRR.INSERT_TIME "insertTime",
- RW.WAREHOUSE_NAME "warehouseName"
- from TMSTRUCK_RECEIPT_RESULT TRR
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TTR.RESULT_TOTAL_ID = TRR.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 RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join TMSTRUCK_WEIGHT_RESULT TWR
- on TWR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
- left join TMSTRUCK_UNLOAD_RESULT TUR
- on TUR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_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 tmstruck_quality_result tqr
- on tqr.total_result_id = ttr.result_total_id
- left join RMS_WAREHOUSE RW
- on TUR.RESULT_UNLOAD_PLACE_ID = RW.WAREHOUSE_ID
- where TRR.STATUS = 1
- and OO.ORDER_TYPE = #{orderTypee}
- )
- <where>
- <if test="materialName != null">
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="purchaseOrderNo != null">
- and
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" like '%${item}%'
- </foreach>
- </if>
- <if test="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" like '%${item}%'
- </foreach>
- </if>
- <if test="unloadStatus != null">
- and
- <foreach collection="unloadStatus" item="item" open="(" separator="or" close=")">
- "unloadStatus" 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="issampling != null">
- and
- <foreach collection="issampling" item="item" open="(" separator="or" close=")">
- "issampling" like '%${item}%'
- </foreach>
- </if>
- <if test="insertUsername != null">
- and
- <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
- "insertUsername" like '%${item}%'
- </foreach>
- </if>
- <if test="insertTime != null">
- and
- <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
- "insertTime" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
-
- <!-- 查询是否已收过货 -->
- <select id="getReceiptResult" parameterType="java.math.BigDecimal" resultType="java.lang.Integer">
- select TRR.RESULT_ID
- from TMSTRUCK_RECEIPT_RESULT TRR
- where TRR.RESULT_TOTAL_ID = #{resultTotalId}
- </select>
- <!-- <select id="selectMaxId" resultType="java.math.BigDecimal">-->
- <!-- select max(RESULT_ID) from TMSTRUCK_RECEIPT_RESULT-->
- <!-- </select>-->
-
- <select id="getReceiptResultInfo" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select
- *
- from (
- select distinct OO.ORDER_NUMBER "orderNumber", --运单订单号
- RC.CAPACITY_NUMBER "capacityNumber",--车牌号
- TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",--计毛时间
- TWR.RESULT_NET_WEIGHT "resultNetWeight",--净重
- TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",--出厂时间
- RGOUT.GATEPOST_NAME "outGatepostName",--出厂门禁
- RCR.CARRIER_NAME "carrierName" , --承运商名称
- RRP.ADDRESS_DELIVERY_ADDRESS "deliveryAddress", --详细收货地址
- RM.MATERIAL_NAME "materialName" , --"物质名称"
- RM.MATERIAL_SPECIFICATION "materialSpecification", -- "物质规格"
- RM.MATERIAL_MODEL "materialModel", --"物质型号"
- RCON.CONSIGNEE_COMPANY_NAME "receiveName",--客户名称
- TAR.RESULT_ARRIVAL_ADDRESS "resultArrivalAddress",--抵达收货点的地址
- TAR.INSERT_TIME "insertTime",--抵达作业时间
- TAR.RESULT_FULL_CONTAINER_PHOTO "resultFullContainerPhoto" --车箱照片
- 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_CONSIGNEE RCON --收货客户
- on RCON.CONSIGNEE_ID = ASO.RECEIVE_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 TMSTRUCK_ARRIVAL_RESULT TAR
- on TAR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join RMS_WAREHOUSE RW --装卸货仓库
- on RW.WAREHOUSE_ID = TLR.LOADING_ID
- left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR --离厂实绩
- on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join RMS_GATEPOST RGOUT --门岗
- on RGOUT.GATEPOST_ID = TLFR.GATEPOST_ID
- left join RMS_CAPACITY RC --运力
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join AMS_DISPATCH_SALE_ORDER ADSO
- on ASOM.SALE_ORDER_MATERIAL_ID=ADSO.SALE_ORDER_MATERIAL_ID
- left join RMS_CARRIER RCR --承运单位
- on ADSO.CARRIER_ID=RCR.CARRIER_ID
- left join RMS_RECEIVE_PLACE RRP --收货地址
- on ASOM.SALE_SHIPPING_ADDRESS_ID=RRP.PLACE_ID
- left join RMS_RECEIVE_ADDRESS REA
- on RRP.ADDRESS_ID=REA.ADDRESS_ID
- left join AMS_SALE_TRUCKNO_MATERIAL ASTM
- on ASOM.SALE_ORDER_MATERIAL_ID=ASTM.SALE_ORDER_MATERIAL_ID
- left join AMS_SALE_MATERIAL ASM1
- on ASTM.MATERIAL_ID =ASM1.SALE_MATERIAL_ID
- left join TMSTRUCK_WEIGHT_RESULT TWR --运输实绩计重
- on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID and ASM1.MATERIAL_ID =TWR.MATERIAL_ID
- left join RMS_MATERIAL RM
- on ASM1.MATERIAL_ID=RM.MATERIAL_ID
- where OO.ORDER_TYPE in (1) and TAR.INSERT_TIME IS NOT NULL
- <if test="oneDate != null">
- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = TAR.INSERT_TIME
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TAR.INSERT_TIME
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TAR.INSERT_TIME
- </if>
- <if test="con!=null">
- and (instr(RC.CAPACITY_NUMBER,#{con})>0 or instr(RM.MATERIAL_NAME,#{con})>0
- or instr(RCON.CONSIGNEE_COMPANY_NAME,#{con})>0)
- </if>
- )
- <where>
- <if test="orderNumbers !=null">
- and "orderNumber" like '%${orderNumbers}%'
- </if>
- <if test="capacityNumbers !=null">
- and "capacityNumber" like '%${capacityNumbers}%'
- </if>
- <if test="resultGrossWeightTimes !=null">
- and "resultGrossWeightTime" like '%${resultGrossWeightTimes}%'
- </if>
- <if test="resultGrossWeightTimes !=null">
- and "resultGrossWeightTime" like '%${resultGrossWeightTimes}%'
- </if>
- <if test="resultOutGateTimes !=null">
- and "resultOutGateTime" like '%${resultOutGateTimes}%'
- </if>
- <if test="resultNetWeights !=null">
- and "resultNetWeight" like '%${resultNetWeights}%'
- </if>
- <if test="resultOutGateTimes !=null">
- and "resultOutGateTime" like '%${resultOutGateTimes}%'
- </if>
- <if test="outGatepostNames !=null">
- and "outGatepostName" like '%${outGatepostNames}%'
- </if>
- <if test="carrierNames !=null">
- and "carrierName" like '%${carrierNames}%'
- </if>
- <if test="deliveryAddresss !=null">
- and "deliveryAddress" like '%${deliveryAddresss}%'
- </if>
- <if test="materialNames !=null">
- and "materialName" like '%${materialNames}%'
- </if>
- <if test="materialSpecifications !=null">
- and "materialSpecification" like '%${materialSpecifications}%'
- </if>
- <if test="materialModels !=null">
- and "materialModel" like '%${materialModels}%'
- </if>
- <if test="receiveNames !=null">
- and "receiveName" like '%${receiveNames}%'
- </if>
- <if test="orderNumber !=null">
- and "orderNumber" in
- <foreach collection="orderNumber" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="capacityNumber !=null">
- and "capacityNumber" in
- <foreach collection="capacityNumber" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="resultGrossWeightTime !=null">
- and "resultGrossWeightTime" in
- <foreach collection="resultGrossWeightTime" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="resultNetWeight !=null">
- and "resultNetWeight" in
- <foreach collection="resultNetWeight" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="resultOutGateTime !=null">
- and "resultOutGateTime" in
- <foreach collection="resultOutGateTime" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="outGatepostName !=null">
- and "outGatepostName" in
- <foreach collection="outGatepostName" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="carrierName !=null">
- and "carrierName" in
- <foreach collection="carrierName" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="deliveryAddress !=null">
- and "deliveryAddress" in
- <foreach collection="deliveryAddress" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="materialSpecification !=null">
- and "materialSpecification" in
- <foreach collection="materialSpecification" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="materialModel !=null">
- and "materialModel" in
- <foreach collection="materialModel" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="receiveName !=null">
- and "receiveName" in
- <foreach collection="receiveName" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="resultArrivalAddress !=null">
- and "resultArrivalAddress" in
- <foreach collection="resultArrivalAddress" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="insertTime !=null">
- and "insertTime" in
- <foreach collection="insertTime" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="resultFullContainerPhoto !=null">
- and "resultFullContainerPhoto" in
- <foreach collection="resultFullContainerPhoto" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <select id="getReceiptPhoto" parameterType="java.lang.String" resultType="java.lang.String">
- select tar.RESULT_FULL_CONTAINER_PHOTO
- from TMSTRUCK_ARRIVAL_RESULT tar
- left join TMSTRUCK_TOTAL_RESULT ttr
- on ttr.RESULT_TOTAL_ID = tar.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER oo
- on oo.ORDER_ID = ttr.ORDER_ID
- where oo.ORDER_NUMBER = #{orderNumber}
- </select>
- <select id="getReceivingResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select
- *
- from (
- select distinct OO.ORDER_NUMBER "orderNumber", --运单订单号
- RC.CAPACITY_NUMBER "capacityNumber",--车牌号
- TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",--计毛时间
- TWR.RESULT_NET_WEIGHT "resultNetWeight",--净重
- TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",--出厂时间
- RGOUT.GATEPOST_NAME "outGatepostName",--出厂门禁
- RCR.CARRIER_NAME "carrierName" , --承运商名称
- RRP.ADDRESS_DELIVERY_ADDRESS "deliveryAddress", --详细收货地址
- RM.MATERIAL_NAME "materialName" , --"物质名称"
- RM.MATERIAL_SPECIFICATION "materialSpecification", -- "物质规格"
- RM.MATERIAL_MODEL "materialModel", --"物质型号"
- RCON.CONSIGNEE_COMPANY_NAME "receiveName",--客户名称
- TRR.RESULT_ARRIVAL_ADDRESS "resultArrivalAddress",--签收收货点的地址
- TRR.INSERT_TIME "insertTime",--签收作业时间
- TRR.ORDER_MILEAGE "orderMileage" --运输距离
- 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_CONSIGNEE RCON --收货客户
- on RCON.CONSIGNEE_ID = ASO.RECEIVE_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 TMSTRUCK_RECEIPT_RESULT TRR
- on TRR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join RMS_WAREHOUSE RW --装卸货仓库
- on RW.WAREHOUSE_ID = TLR.LOADING_ID
- left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR --离厂实绩
- on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join RMS_GATEPOST RGOUT --门岗
- on RGOUT.GATEPOST_ID = TLFR.GATEPOST_ID
- left join RMS_CAPACITY RC --运力
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join AMS_DISPATCH_SALE_ORDER ADSO
- on ASOM.SALE_ORDER_MATERIAL_ID=ADSO.SALE_ORDER_MATERIAL_ID
- left join RMS_CARRIER RCR --承运单位
- on ADSO.CARRIER_ID=RCR.CARRIER_ID
- left join RMS_RECEIVE_PLACE RRP --收货地址
- on ASOM.SALE_SHIPPING_ADDRESS_ID=RRP.PLACE_ID
- left join RMS_RECEIVE_ADDRESS REA
- on RRP.ADDRESS_ID=REA.ADDRESS_ID
- left join AMS_SALE_TRUCKNO_MATERIAL ASTM
- on ASOM.SALE_ORDER_MATERIAL_ID=ASTM.SALE_ORDER_MATERIAL_ID
- left join AMS_SALE_MATERIAL ASM1
- on ASTM.MATERIAL_ID =ASM1.SALE_MATERIAL_ID
- left join TMSTRUCK_WEIGHT_RESULT TWR --运输实绩计重
- on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID and ASM1.MATERIAL_ID =TWR.MATERIAL_ID
- left join RMS_MATERIAL RM
- on ASM1.MATERIAL_ID=RM.MATERIAL_ID
- where OO.ORDER_TYPE in (1) and TRR.INSERT_TIME IS NOT NULL
- <if test="oneDate != null">
- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = TRR.INSERT_TIME
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TRR.INSERT_TIME
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TRR.INSERT_TIME
- </if>
- <if test="con!=null">
- and (instr(RC.CAPACITY_NUMBER,#{con})>0 or instr(RM.MATERIAL_NAME,#{con})>0
- or instr(RCON.CONSIGNEE_COMPANY_NAME,#{con})>0)
- </if>
- )
- <where>
- <if test="orderNumbers !=null">
- and "orderNumber" like '${orderNumbers}'
- </if>
- <if test="capacityNumbers !=null">
- and "capacityNumber" like '${capacityNumbers}'
- </if>
- <if test="resultGrossWeightTimes !=null">
- and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
- </if>
- <if test="resultGrossWeightTimes !=null">
- and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
- </if>
- <if test="resultOutGateTimes !=null">
- and "resultOutGateTime" like '${resultOutGateTimes}'
- </if>
- <if test="resultNetWeights !=null">
- and "resultNetWeight" like '${resultNetWeights}'
- </if>
- <if test="resultOutGateTimes !=null">
- and "resultOutGateTime" like '${resultOutGateTimes}'
- </if>
- <if test="outGatepostNames !=null">
- and "outGatepostName" like '${outGatepostNames}'
- </if>
- <if test="carrierNames !=null">
- and "carrierName" like '${carrierNames}'
- </if>
- <if test="deliveryAddresss !=null">
- and "deliveryAddress" like '${deliveryAddresss}'
- </if>
- <if test="materialNames !=null">
- and "materialName" like '${materialNames}'
- </if>
- <if test="materialSpecifications !=null">
- and "materialSpecification" like '${materialSpecifications}'
- </if>
- <if test="materialModels !=null">
- and "materialModel" like '${materialModels}'
- </if>
- <if test="receiveNames !=null">
- and "receiveName" like '${receiveNames}'
- </if>
- <if test="orderNumber !=null">
- and "orderNumber" in
- <foreach collection="orderNumber" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="capacityNumber !=null">
- and "capacityNumber" in
- <foreach collection="capacityNumber" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="resultGrossWeightTime !=null">
- and "resultGrossWeightTime" in
- <foreach collection="resultGrossWeightTime" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="resultNetWeight !=null">
- and "resultNetWeight" in
- <foreach collection="resultNetWeight" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="resultOutGateTime !=null">
- and "resultOutGateTime" in
- <foreach collection="resultOutGateTime" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="outGatepostName !=null">
- and "outGatepostName" in
- <foreach collection="outGatepostName" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="carrierName !=null">
- and "carrierName" in
- <foreach collection="carrierName" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="deliveryAddress !=null">
- and "deliveryAddress" in
- <foreach collection="deliveryAddress" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="materialSpecification !=null">
- and "materialSpecification" in
- <foreach collection="materialSpecification" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="materialModel !=null">
- and "materialModel" in
- <foreach collection="materialModel" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="receiveName !=null">
- and "receiveName" in
- <foreach collection="receiveName" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="resultArrivalAddress !=null">
- and "resultArrivalAddress" in
- <foreach collection="resultArrivalAddress" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="insertTime !=null">
- and "insertTime" in
- <foreach collection="insertTime" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- <if test="orderMileage !=null">
- and "orderMileage" in
- <foreach collection="orderMileage" separator="," open="(" close=")" item="item" >
- #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <select id="getReceivingPhoto" parameterType="java.lang.String" resultType="java.util.Map">
- select trr.RESULT_EMPTY_CONTAINER_PHOTO "resultEmptyContainerPhoto",
- trr.RESULT_SIGNED_NOTE_PHOTO "resultSignedNotePhoto",
- trr.RESULT_RECEIVE_NOTE_PHOTO "resultReceiveNotePhoto"
- from TMSTRUCK_RECEIPT_RESULT trr
- left join TMSTRUCK_TOTAL_RESULT ttr
- on ttr.RESULT_TOTAL_ID = trr.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER oo
- on oo.ORDER_ID = ttr.ORDER_ID
- where oo.ORDER_NUMBER = #{orderNumber}
- </select>
- <select id="getChildPhoto" parameterType="java.lang.String" resultType="java.util.Map">
- select trrc.OTHER_PHOTO1 "otherPhoto1",
- trrc.OTHER_PHOTO2 "otherPhoto2",
- trrc.OTHER_PHOTO3 "otherPhoto3"
- from TMSTRUCK_RECEIPT_RESULT trr
- left join TMSTRUCK_TOTAL_RESULT ttr
- on ttr.RESULT_TOTAL_ID = trr.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER oo
- on oo.ORDER_ID = ttr.ORDER_ID
- left join TMSTRUCK_RECEIPT_RESULT_CHILD trrc
- on trr.RESULT_ID = trrc.RECEIPT_RESULT_ID
- where oo.ORDER_NUMBER = #{orderNumber}
- </select>
- </mapper>
|