1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123 |
- <?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="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="map">
- select trr.RESULT_EMPTY_CONTAINER_PHOTO "resultEmptyContainerPhoto",
- trr.RESULT_SIGNED_NOTE_PHOTO "resultSignedNotePhoto"
- 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>
- </mapper>
|