1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018 |
- <?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.TmstrainWagonUnloadResultMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstrainWagonUnloadResult">
- <id column="UNLOADING_ID" jdbcType="DECIMAL" property="unloadingId" />
- <result column="PURCHASE_ORDER_RAIL_PLAN_ID" jdbcType="DECIMAL" property="purchaseOrderRailPlanId" />
- <result column="RESULT_WAGON_NO" jdbcType="VARCHAR" property="resultWagonNo" />
- <result column="RESULT_ARRIVAL_DATE" jdbcType="TIMESTAMP" property="resultArrivalDate" />
- <result column="RESULT_UNLOAD_TIME" jdbcType="TIMESTAMP" property="resultUnloadTime" />
- <result column="UNLOADING_POINT_ID" jdbcType="DECIMAL" property="unloadingPointId" />
- <result column="RESULT_BIG_TICKET_WEIGHT" jdbcType="DECIMAL" property="resultBigTicketWeight" />
- <result column="RESULT_RAIL_HORIZONTAL_WEIGHT" jdbcType="DECIMAL" property="resultRailHorizontalWeight" />
- <result column="RESULT_REMARK" jdbcType="VARCHAR" property="resultRemark" />
- <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
- <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
- <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
- <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
- <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
- <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
- <result column="RESULT_TYPE" jdbcType="DECIMAL" property="resultType" />
- </resultMap>
- <sql id="columns">
- UNLOADING_ID, PURCHASE_ORDER_RAIL_PLAN_ID, RESULT_WAGON_NO, RESULT_ARRIVAL_DATE,
- RESULT_UNLOAD_TIME, UNLOADING_POINT_ID, RESULT_BIG_TICKET_WEIGHT, RESULT_RAIL_HORIZONTAL_WEIGHT,
- RESULT_REMARK, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
- DELETED, RESULT_TYPE
- </sql>
- <sql id="columns_alias">
- t.UNLOADING_ID, t.PURCHASE_ORDER_RAIL_PLAN_ID, t.RESULT_WAGON_NO, t.RESULT_ARRIVAL_DATE,
- t.RESULT_UNLOAD_TIME, t.UNLOADING_POINT_ID, t.RESULT_BIG_TICKET_WEIGHT, t.RESULT_RAIL_HORIZONTAL_WEIGHT,
- t.RESULT_REMARK, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
- t.INSERT_UPDATE_REMARK, t.DELETED, t.RESULT_TYPE
- </sql>
- <sql id="select">
- SELECT <include refid="columns"/> FROM TMSTRAIN_WAGON_UNLOAD_RESULT
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias"/> FROM TMSTRAIN_WAGON_UNLOAD_RESULT t
- </sql>
- <sql id="where">
- <where>
- <if test="unloadingId != null">
- and UNLOADING_ID = #{unloadingId}
- </if>
- <if test="purchaseOrderRailPlanId != null">
- and PURCHASE_ORDER_RAIL_PLAN_ID = #{purchaseOrderRailPlanId}
- </if>
- <if test="resultWagonNo != null and resultWagonNo != ''">
- and RESULT_WAGON_NO = #{resultWagonNo}
- </if>
- <if test="resultArrivalDate != null">
- and TO_CHAR(RESULT_ARRIVAL_DATE,'yyyy-MM-dd') = #{resultArrivalDate}
- </if>
- <if test="resultUnloadTime != null">
- and TO_CHAR(RESULT_UNLOAD_TIME,'yyyy-MM-dd') = #{resultUnloadTime}
- </if>
- <if test="unloadingPointId != null">
- and UNLOADING_POINT_ID = #{unloadingPointId}
- </if>
- <if test="resultBigTicketWeight != null">
- and RESULT_BIG_TICKET_WEIGHT = #{resultBigTicketWeight}
- </if>
- <if test="resultRailHorizontalWeight != null">
- and RESULT_RAIL_HORIZONTAL_WEIGHT = #{resultRailHorizontalWeight}
- </if>
- <if test="resultRemark != null and resultRemark != ''">
- and RESULT_REMARK = #{resultRemark}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- and INSERT_USERNAME = #{insertUsername}
- </if>
- <if test="insertTime != null">
- and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- and UPDATE_USERNAME = #{updateUsername}
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- <if test="deleted != null">
- and DELETED = #{deleted}
- </if>
- <if test="resultType != null">
- and RESULT_TYPE = #{resultType}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="unloadingId != null">
- and UNLOADING_ID = #{unloadingId}
- </if>
- <if test="purchaseOrderRailPlanId != null">
- and PURCHASE_ORDER_RAIL_PLAN_ID = #{purchaseOrderRailPlanId}
- </if>
- <if test="resultWagonNo != null and resultWagonNo != ''">
- and RESULT_WAGON_NO LIKE '%${resultWagonNo}%'
- </if>
- <if test="resultArrivalDate != null">
- and TO_CHAR(RESULT_ARRIVAL_DATE,'yyyy-MM-dd') = #{resultArrivalDate}
- </if>
- <if test="resultUnloadTime != null">
- and TO_CHAR(RESULT_UNLOAD_TIME,'yyyy-MM-dd') = #{resultUnloadTime}
- </if>
- <if test="unloadingPointId != null">
- and UNLOADING_POINT_ID = #{unloadingPointId}
- </if>
- <if test="resultBigTicketWeight != null">
- and RESULT_BIG_TICKET_WEIGHT = #{resultBigTicketWeight}
- </if>
- <if test="resultRailHorizontalWeight != null">
- and RESULT_RAIL_HORIZONTAL_WEIGHT = #{resultRailHorizontalWeight}
- </if>
- <if test="resultRemark != null and resultRemark != ''">
- and RESULT_REMARK LIKE '%${resultRemark}%'
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- and INSERT_USERNAME LIKE '%${insertUsername}%'
- </if>
- <if test="insertTime != null">
- and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- and UPDATE_USERNAME LIKE '%${updateUsername}%'
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
- </if>
- <if test="deleted != null">
- and DELETED = #{deleted}
- </if>
- <if test="resultType != null">
- and RESULT_TYPE = #{resultType}
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
- delete from TMSTRAIN_WAGON_UNLOAD_RESULT
- where UNLOADING_ID = #{unloadingId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from TMSTRAIN_WAGON_UNLOAD_RESULT
- where 1!=1
- <if test="purchaseOrderRailPlanId != null">
- or PURCHASE_ORDER_RAIL_PLAN_ID = #{purchaseOrderRailPlanId}
- </if>
- <if test="resultWagonNo != null and resultWagonNo != ''">
- or RESULT_WAGON_NO = #{resultWagonNo}
- </if>
- <if test="resultArrivalDate != null">
- or TO_CHAR(RESULT_ARRIVAL_DATE,'yyyy-MM-dd') = '#{resultArrivalDate}'
- </if>
- <if test="resultUnloadTime != null">
- or TO_CHAR(RESULT_UNLOAD_TIME,'yyyy-MM-dd') = '#{resultUnloadTime}'
- </if>
- <if test="unloadingPointId != null">
- or UNLOADING_POINT_ID = #{unloadingPointId}
- </if>
- <if test="resultBigTicketWeight != null">
- or RESULT_BIG_TICKET_WEIGHT = #{resultBigTicketWeight}
- </if>
- <if test="resultRailHorizontalWeight != null">
- or RESULT_RAIL_HORIZONTAL_WEIGHT = #{resultRailHorizontalWeight}
- </if>
- <if test="resultRemark != null and resultRemark != ''">
- or RESULT_REMARK = #{resultRemark}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- or INSERT_USERNAME = #{insertUsername}
- </if>
- <if test="insertTime != null">
- or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- or UPDATE_USERNAME = #{updateUsername}
- </if>
- <if test="updateTime != null">
- or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- <if test="deleted != null">
- or DELETED = #{deleted}
- </if>
- <if test="resultType != null">
- or RESULT_TYPE = #{resultType}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.TmstrainWagonUnloadResult">
- insert into TMSTRAIN_WAGON_UNLOAD_RESULT (UNLOADING_ID, PURCHASE_ORDER_RAIL_PLAN_ID,
- RESULT_WAGON_NO, RESULT_ARRIVAL_DATE, RESULT_UNLOAD_TIME,
- UNLOADING_POINT_ID, RESULT_BIG_TICKET_WEIGHT,
- RESULT_RAIL_HORIZONTAL_WEIGHT, RESULT_REMARK,
- INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
- RESULT_TYPE)
- values (#{unloadingId,jdbcType=DECIMAL}, #{purchaseOrderRailPlanId,jdbcType=DECIMAL},
- #{resultWagonNo,jdbcType=VARCHAR}, #{resultArrivalDate,jdbcType=TIMESTAMP}, #{resultUnloadTime,jdbcType=TIMESTAMP},
- #{unloadingPointId,jdbcType=DECIMAL}, #{resultBigTicketWeight,jdbcType=DECIMAL},
- #{resultRailHorizontalWeight,jdbcType=DECIMAL}, #{resultRemark,jdbcType=VARCHAR},
- #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
- #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
- #{resultType,jdbcType=DECIMAL})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstrainWagonUnloadResult">
- insert into TMSTRAIN_WAGON_UNLOAD_RESULT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="unloadingId != null">
- UNLOADING_ID,
- </if>
- <if test="purchaseOrderRailPlanId != null">
- PURCHASE_ORDER_RAIL_PLAN_ID,
- </if>
- <if test="resultWagonNo != null">
- RESULT_WAGON_NO,
- </if>
- <if test="resultArrivalDate != null">
- RESULT_ARRIVAL_DATE,
- </if>
- <if test="resultUnloadTime != null">
- RESULT_UNLOAD_TIME,
- </if>
- <if test="unloadingPointId != null">
- UNLOADING_POINT_ID,
- </if>
- <if test="resultBigTicketWeight != null">
- RESULT_BIG_TICKET_WEIGHT,
- </if>
- <if test="resultRailHorizontalWeight != null">
- RESULT_RAIL_HORIZONTAL_WEIGHT,
- </if>
- <if test="resultRemark != null">
- RESULT_REMARK,
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME,
- </if>
- <if test="insertTime != null">
- INSERT_TIME,
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME,
- </if>
- <if test="updateTime != null">
- UPDATE_TIME,
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK,
- </if>
- <if test="deleted != null">
- DELETED,
- </if>
- <if test="resultType != null">
- RESULT_TYPE,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="unloadingId != null">
- #{unloadingId,jdbcType=DECIMAL},
- </if>
- <if test="purchaseOrderRailPlanId != null">
- #{purchaseOrderRailPlanId,jdbcType=DECIMAL},
- </if>
- <if test="resultWagonNo != null">
- #{resultWagonNo,jdbcType=VARCHAR},
- </if>
- <if test="resultArrivalDate != null">
- #{resultArrivalDate,jdbcType=TIMESTAMP},
- </if>
- <if test="resultUnloadTime != null">
- #{resultUnloadTime,jdbcType=TIMESTAMP},
- </if>
- <if test="unloadingPointId != null">
- #{unloadingPointId,jdbcType=DECIMAL},
- </if>
- <if test="resultBigTicketWeight != null">
- #{resultBigTicketWeight,jdbcType=DECIMAL},
- </if>
- <if test="resultRailHorizontalWeight != null">
- #{resultRailHorizontalWeight,jdbcType=DECIMAL},
- </if>
- <if test="resultRemark != null">
- #{resultRemark,jdbcType=VARCHAR},
- </if>
- <if test="insertUsername != null">
- #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUpdateRemark != null">
- #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- <if test="deleted != null">
- #{deleted,jdbcType=DECIMAL},
- </if>
- <if test="resultType != null">
- #{resultType,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstrainWagonUnloadResult">
- update TMSTRAIN_WAGON_UNLOAD_RESULT
- set PURCHASE_ORDER_RAIL_PLAN_ID = #{purchaseOrderRailPlanId,jdbcType=DECIMAL},
- RESULT_WAGON_NO = #{resultWagonNo,jdbcType=VARCHAR},
- RESULT_ARRIVAL_DATE = #{resultArrivalDate,jdbcType=TIMESTAMP},
- RESULT_UNLOAD_TIME = #{resultUnloadTime,jdbcType=TIMESTAMP},
- UNLOADING_POINT_ID = #{unloadingPointId,jdbcType=DECIMAL},
- RESULT_BIG_TICKET_WEIGHT = #{resultBigTicketWeight,jdbcType=DECIMAL},
- RESULT_RAIL_HORIZONTAL_WEIGHT = #{resultRailHorizontalWeight,jdbcType=DECIMAL},
- RESULT_REMARK = #{resultRemark,jdbcType=VARCHAR},
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- DELETED = #{deleted,jdbcType=DECIMAL},
- RESULT_TYPE = #{resultType,jdbcType=DECIMAL}
- where UNLOADING_ID = #{unloadingId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstrainWagonUnloadResult">
- update TMSTRAIN_WAGON_UNLOAD_RESULT
- <set>
- <if test="purchaseOrderRailPlanId != null">
- PURCHASE_ORDER_RAIL_PLAN_ID = #{purchaseOrderRailPlanId,jdbcType=DECIMAL},
- </if>
- <if test="resultWagonNo != null">
- RESULT_WAGON_NO = #{resultWagonNo,jdbcType=VARCHAR},
- </if>
- <if test="resultArrivalDate != null">
- RESULT_ARRIVAL_DATE = #{resultArrivalDate,jdbcType=TIMESTAMP},
- </if>
- <if test="resultUnloadTime != null">
- RESULT_UNLOAD_TIME = #{resultUnloadTime,jdbcType=TIMESTAMP},
- </if>
- <if test="unloadingPointId != null">
- UNLOADING_POINT_ID = #{unloadingPointId,jdbcType=DECIMAL},
- </if>
- <if test="resultBigTicketWeight != null">
- RESULT_BIG_TICKET_WEIGHT = #{resultBigTicketWeight,jdbcType=DECIMAL},
- </if>
- <if test="resultRailHorizontalWeight != null">
- RESULT_RAIL_HORIZONTAL_WEIGHT = #{resultRailHorizontalWeight,jdbcType=DECIMAL},
- </if>
- <if test="resultRemark != null">
- RESULT_REMARK = #{resultRemark,jdbcType=VARCHAR},
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- <if test="deleted != null">
- DELETED = #{deleted,jdbcType=DECIMAL},
- </if>
- <if test="resultType != null">
- RESULT_TYPE = #{resultType,jdbcType=DECIMAL},
- </if>
- </set>
- where UNLOADING_ID = #{unloadingId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
- <include refid="select"/>
- where UNLOADING_ID = #{unloadingId,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 TMSTRAIN_WAGON_UNLOAD_RESULT
- (UNLOADING_ID,
- PURCHASE_ORDER_RAIL_PLAN_ID, RESULT_WAGON_NO,
- RESULT_ARRIVAL_DATE, RESULT_UNLOAD_TIME,
- UNLOADING_POINT_ID, RESULT_BIG_TICKET_WEIGHT,
- RESULT_RAIL_HORIZONTAL_WEIGHT, RESULT_REMARK,
- INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME,
- INSERT_UPDATE_REMARK, DELETED,
- RESULT_TYPE)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.unloadingId,jdbcType=DECIMAL},
- #{item.purchaseOrderRailPlanId,jdbcType=DECIMAL}, #{item.resultWagonNo,jdbcType=VARCHAR},
- #{item.resultArrivalDate,jdbcType=TIMESTAMP}, #{item.resultUnloadTime,jdbcType=TIMESTAMP},
- #{item.unloadingPointId,jdbcType=DECIMAL}, #{item.resultBigTicketWeight,jdbcType=DECIMAL},
- #{item.resultRailHorizontalWeight,jdbcType=DECIMAL}, #{item.resultRemark,jdbcType=VARCHAR},
- #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
- #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
- #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL},
- #{item.resultType,jdbcType=DECIMAL} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update TMSTRAIN_WAGON_UNLOAD_RESULT
- set
- UNLOADING_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.unloadingId,jdbcType=DECIMAL}
- </foreach>
- ,PURCHASE_ORDER_RAIL_PLAN_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.purchaseOrderRailPlanId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_WAGON_NO=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.resultWagonNo,jdbcType=VARCHAR}
- </foreach>
- ,RESULT_ARRIVAL_DATE=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.resultArrivalDate,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_UNLOAD_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.resultUnloadTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UNLOADING_POINT_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.unloadingPointId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_BIG_TICKET_WEIGHT=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.resultBigTicketWeight,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_RAIL_HORIZONTAL_WEIGHT=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.resultRailHorizontalWeight,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_REMARK=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.resultRemark,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- ,DELETED=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_TYPE=
- <foreach collection="list" item="item" index="index" separator=" " open="case UNLOADING_ID" close="end">
- when #{item.unloadingId,jdbcType=DECIMAL} then #{item.resultType,jdbcType=DECIMAL}
- </foreach>
- where UNLOADING_ID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.unloadingId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from TMSTRAIN_WAGON_UNLOAD_RESULT
- where UNLOADING_ID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <select id="getTmsWagonUnLoadInfo" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select * from(
- select t_unload.UNLOADING_ID "unloadingId",
- a_order.PURCHASE_ORDER_NO "purchaseOrderNo",
- t_unload.RESULT_WAGON_NO "resultWagonNo",
- to_char(t_load.RESULT_LOADING_DATE, 'yyyy-mm-dd') "resultLoadingDate",
- to_char(t_unload.RESULT_ARRIVAL_DATE, 'yyyy-mm-dd') "resultArrivalDate",
- to_char(t_unload.RESULT_UNLOAD_TIME, 'yyyy-mm-dd') "resultUnloadTime",
- t_load.RESULT_CLASS "resultClass",
- d_batch.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
- r_material.MATERIAL_NAME "materialName",
- r_s_arrival.ARRIVAL_NAME "sendStationName",
- r_a_arrival.ARRIVAL_NAME "arrivalStationName",
- RW.WAREHOUSE_NAME "unloadPointName",
- t_unload.RESULT_BIG_TICKET_WEIGHT "resultBigTicketWeight",
- t_unload.RESULT_RAIL_HORIZONTAL_WEIGHT "resultRailHorizontalWeight",
- t_unload.RESULT_REMARK "resultRemark"
- from TMSTRAIN_LOADING_RESULT t_load
- left join TMSTRAIN_WAGON_UNLOAD_RESULT t_unload
- on t_load.RESULT_WAGON_NO=t_unload.RESULT_WAGON_NO
- left join AMS_PURCHASE_ORDER a_order
- on t_unload.PURCHASE_ORDER_RAIL_PLAN_ID=a_order.PURCHASE_ORDER_ID
- left join DIL_BATCH d_batch
- on t_load.BATCH_ID=d_batch.BATCH_ID
- left join RMS_MATERIAL r_material
- on d_batch.MATERIAL_ID=r_material.MATERIAL_ID
- left join RMSTRAIN_ARRIVAL_SEND r_s_arrival
- on r_s_arrival.ARRIVAL_ID=t_load.SEND_STATION_ID
- left join RMSTRAIN_ARRIVAL_SEND r_a_arrival
- on r_a_arrival.ARRIVAL_ID=t_load.ARRIVAL_STATION_ID
- left join RMS_WAREHOUSE RW
- on RW.WAREHOUSE_ID = t_unload.UNLOADING_POINT_ID
- where t_unload.DELETED = 0 and t_load.DELETED = 2 and t_unload.RESULT_TYPE = #{resultType}
- )
- <where>
- <if test="purchaseOrderNo != null">
- and
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" like '%${item}%'
- </foreach>
- </if>
- <if test="resultWagonNo != null">
- and
- <foreach collection="resultWagonNo" item="item" open="(" separator="or" close=")">
- "resultWagonNo" like '%${item}%'
- </foreach>
- </if>
- <if test="resultLoadingDate != null">
- and
- <foreach collection="resultLoadingDate" item="item" open="(" separator="or" close=")">
- "resultLoadingDate" like '%${item}%'
- </foreach>
- </if>
- <if test="resultArrivalDate != null">
- and
- <foreach collection="resultArrivalDate" item="item" open="(" separator="or" close=")">
- "resultArrivalDate" like '%${item}%'
- </foreach>
- </if>
- <if test="resultUnloadTime != null">
- and
- <foreach collection="resultUnloadTime" item="item" open="(" separator="or" close=")">
- "resultUnloadTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultClass != null">
- and
- <foreach collection="resultClass" item="item" open="(" separator="or" close=")">
- "resultClass" 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="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="sendStationName != null">
- and
- <foreach collection="sendStationName" item="item" open="(" separator="or" close=")">
- "sendStationName" like '%${item}%'
- </foreach>
- </if>
- <if test="arrivalStationName != null">
- and
- <foreach collection="arrivalStationName" item="item" open="(" separator="or" close=")">
- arrivalStationName like '%${item}%'
- </foreach>
- </if>
- <if test="unloadPointName != null">
- and
- <foreach collection="unloadPointName" item="item" open="(" separator="or" close=")">
- "unloadPointName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultBigTicketWeight != null">
- and
- <foreach collection="resultBigTicketWeight" item="item" open="(" separator="or" close=")">
- "resultBigTicketWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultRailHorizontalWeight != null">
- and
- <foreach collection="resultRailHorizontalWeight" item="item" open="(" separator="or" close=")">
- "resultRailHorizontalWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultRemark != null">
- and
- <foreach collection="resultRemark" item="item" open="(" separator="or" close=")">
- "resultRemark" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultUnloadTime" desc
- </if>
- </select>
- <sql id="orderBy">
- <if test="orderField != null and orderField != ''">
- order by "${orderField}"
- <if test="orderType != null and orderType != ''">
- ${orderType}
- </if>
- </if>
- </sql>
- <select id="getTmstrainResult" resultType="java.util.LinkedHashMap">
- select * from(
- select a_order.PURCHASE_ORDER_NO "purchaseOrderNo",
- t_load.RESULT_WAGON_NO "resultWagonNo",
- d_batch.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
- r_material.MATERIAL_NAME "materialName",
- t_load.RESULT_LOADING_DATE "resultLoadingDate",
- r_s_arrival.ARRIVAL_NAME "sendStationName",
- r_a_arrival.ARRIVAL_NAME "arrivalStationName",
- t_unload.RESULT_UNLOAD_TIME "resultUnloadTime",
- t_load.RESULT_BILLABLE_TONNAGE "resultBillableTonnage",
- t_unload.RESULT_RAIL_HORIZONTAL_WEIGHT "resultRailHorizontalWeight",
- (t_load.RESULT_BILLABLE_TONNAGE-t_unload.RESULT_RAIL_HORIZONTAL_WEIGHT) "differentialWeight"
- from TMSTRAIN_LOADING_RESULT t_load
- left join AMS_PURCHASE_ORDER a_order
- on t_load.PURCHASE_ORDER_RAIL_PLAN_ID=a_order.PURCHASE_ORDER_ID
- left join DIL_BATCH d_batch
- on t_load.BATCH_ID=d_batch.BATCH_ID
- left join RMS_MATERIAL r_material
- on t_load.MATERIAL_ID=r_material.MATERIAL_ID
- left join RMSTRAIN_ARRIVAL_SEND r_s_arrival
- on r_s_arrival.ARRIVAL_ID=t_load.SEND_STATION_ID
- left join RMSTRAIN_ARRIVAL_SEND r_a_arrival
- on r_a_arrival.ARRIVAL_ID=t_load.ARRIVAL_STATION_ID
- left join TMSTRAIN_WAGON_UNLOAD_RESULT t_unload
- on t_unload.RESULT_WAGON_NO=t_load.RESULT_WAGON_NO
- where t_load.DELETED = 0
- )
- <where>
- <if test="purchaseOrderNo != null">
- and
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" like '%${item}%'
- </foreach>
- </if>
- <if test="resultWagonNo != null">
- and
- <foreach collection="resultWagonNo" item="item" open="(" separator="or" close=")">
- "resultWagonNo" 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="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultLoadingDate != null">
- and
- <foreach collection="resultLoadingDate" item="item" open="(" separator="or" close=")">
- "resultLoadingDate" like '%${item}%'
- </foreach>
- </if>
- <if test="sendStationName != null">
- and
- <foreach collection="sendStationName" item="item" open="(" separator="or" close=")">
- "sendStationName" like '%${item}%'
- </foreach>
- </if>
- <if test="arrivalStationName != null">
- and
- <foreach collection="arrivalStationName" item="item" open="(" separator="or" close=")">
- arrivalStationName like '%${item}%'
- </foreach>
- </if>
- <if test="resultUnloadTime != null">
- and
- <foreach collection="resultUnloadTime" item="item" open="(" separator="or" close=")">
- "resultUnloadTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultBillableTonnage != null">
- and
- <foreach collection="resultBillableTonnage" item="item" open="(" separator="or" close=")">
- "resultBillableTonnage" like '%${item}%'
- </foreach>
- </if>
- <if test="resultRailHorizontalWeight != null">
- and
- <foreach collection="resultRailHorizontalWeight" item="item" open="(" separator="or" close=")">
- "resultRailHorizontalWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="differentialWeight != null">
- and
- <foreach collection="differentialWeight" item="item" open="(" separator="or" close=")">
- "differentialWeight" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultUnloadTime" desc
- </if>
- </select>
- <select id="getUnloadingPointName" resultType="java.util.LinkedHashMap">
- select
- UNLOAD_POINT_ID "id",
- UNLOAD_POINT_ID "value",
- UNLOAD_POINT_NAME "label"
- from TMSTRAIN_UNLOAD_POINT
- </select>
- <!-- <select id="getUnloadingRouteName" resultType="java.util.LinkedHashMap">-->
- <!-- select-->
- <!-- UNLOAD_ROUTE_ID "id",-->
- <!-- UNLOAD_ROUTE_ID "value",-->
- <!-- UNLOAD_ROUTE_NAME "label"-->
- <!-- from TMSTRAIN_UNLOAD_ROUTE-->
- <!-- </select>-->
- <select id="selectByUnLoadingId" parameterType="java.math.BigDecimal" resultType="java.util.LinkedHashMap">
- select
- t_unload.RESULT_WAGON_NO "resultWagonNo",
- t_unload.RESULT_ARRIVAL_DATE "resultArrivalDate",
- t_unload.RESULT_UNLOAD_TIME "resultUnloadTime",
- t_unload.UNLOADING_POINT_ID "unloadingPointId",
- t_unload.RESULT_BIG_TICKET_WEIGHT "resultBigTicketWeight",
- t_unload.RESULT_RAIL_HORIZONTAL_WEIGHT "resultRailHorizontalWeight",
- t_unload.RESULT_REMARK "resultRemark"
- from TMSTRAIN_WAGON_UNLOAD_RESULT t_unload
- where t_unload.UNLOADING_ID = #{unloadingId}
- </select>
- <select id="selectWagonUnLoadResultForNZ" parameterType="java.util.Map" resultType="java.util.Map">
- select
- *
- from
- (
- SELECT TWUR.UNLOADING_ID "unloadingId",
- AROD.DAYPLAN_NO "dayPlanNo",
- TWUR.RESULT_WAGON_NO "resultWagonNo",
- TO_CHAR(TWUR.RESULT_UNLOAD_TIME, 'yyyy-mm-dd') "resultUnloadTime",
- RS.SHIPPER_NAME "shipperName",
- RC.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
- RAS.ARRIVAL_NAME "dayplanSendStationName",
- RAS2.ARRIVAL_NAME "dayplanToTheStationName",
- AROD.DAYPLAN_CONSIGNEE_TEL "dayplanConsigneeTel",
- AROD.DAYPLAN_CONSIGNEE_NAME "dayplanConsigneeName",
- AROD.DAYPLAN_DELIVERY_DATE "dayplanDeliveryDate",
- RAS2.DAYPLAN_DEDICATED_LINE "dayplanDedicatedLine",
- TWUR.RESULT_ARRIVAL_DATE "resultArrivalDate",
- TWUR.INSERT_TIME "insertTime",
- RW.WAREHOUSE_NAME "warehouseName",
- TWUR.INSERT_UPDATE_REMARK "insertUpdateRemark"
- FROM TMSTRAIN_WAGON_UNLOAD_RESULT TWUR
- LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
- ON AROD.DAYPLAN_ID = TWUR.PURCHASE_ORDER_RAIL_PLAN_ID
- LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS
- ON RAS.ARRIVAL_ID = AROD.DAYPLAN_SEND_STATION_ID
- LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS2
- ON RAS2.ARRIVAL_ID = AROD.DAYPLAN_TO_THE_STATION_ID
- LEFT JOIN RMS_SHIPPER RS
- ON RS.SHIPPER_ID = AROD.SHIPPER_ID
- LEFT JOIN RMS_CONSIGNEE RC
- ON RC.CONSIGNEE_ID = AROD.RECEIVING_UNIT_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON TWUR.UNLOADING_POINT_ID = RW.WAREHOUSE_ID
- WHERE TWUR.DELETED = 0 AND TWUR.RESULT_TYPE = 4
- )
- <where>
- <if test="dayPlanNo!= null">
- <foreach collection="dayPlanNo" item="item" open="(" separator="or" close=")">
- "dayPlanNo" like '%${item}%'
- </foreach>
- </if>
- <if test="resultWagonNo!= null">
- and
- <foreach collection="resultWagonNo" item="item" open="(" separator="or" close=")">
- "resultWagonNo" like '%${item}%'
- </foreach>
- </if>
- <if test="resultUnloadTime!= null">
- and
- <foreach collection="resultUnloadTime" item="item" open="(" separator="or" close=")">
- "resultUnloadTime" like '%${item}%'
- </foreach>
- </if>
- <if test="shipperName!= null">
- and
- <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
- "shipperName" like '%${item}%'
- </foreach>
- </if>
- <if test="consigneeCompanyName!= null">
- and
- <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
- "consigneeCompanyName" like '%${item}%'
- </foreach>
- </if>
- <if test="dayplanSendStationName!= null">
- and
- <foreach collection="dayplanSendStationName" item="item" open="(" separator="or" close=")">
- "dayplanSendStationName" like '%${item}%'
- </foreach>
- </if>
- <if test="dayplanToTheStationName!= null">
- and
- <foreach collection="dayplanToTheStationName" item="item" open="(" separator="or" close=")">
- "dayplanToTheStationName" like '%${item}%'
- </foreach>
- </if>
- <if test="dayplanConsigneeTel!= null">
- and
- <foreach collection="dayplanConsigneeTel" item="item" open="(" separator="or" close=")">
- "dayplanConsigneeTel" like '%${item}%'
- </foreach>
- </if>
- <if test="dayplanConsigneeName!= null">
- and
- <foreach collection="dayplanConsigneeName" item="item" open="(" separator="or" close=")">
- "dayplanConsigneeName" like '%${item}%'
- </foreach>
- </if>
- <if test="dayplanDedicatedLine!= null">
- and
- <foreach collection="dayplanDedicatedLine" item="item" open="(" separator="or" close=")">
- "dayplanDedicatedLine" like '%${item}%'
- </foreach>
- </if>
- <if test="resultArrivalDate!= null">
- and
- <foreach collection="resultArrivalDate" item="item" open="(" separator="or" close=")">
- "resultArrivalDate" 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="insertUpdateRemark!= null">
- and
- <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
- "insertUpdateRemark" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "insertTime" desc
- </if>
- </select>
- <!-- 火车卸货 -->
- <select id="getTrainResult" resultType="java.util.LinkedHashMap">
- select *
- from(
- select a_order.PURCHASE_ORDER_NO "purchaseOrderNo",
- t_load.RESULT_WAGON_NO "resultWagonNo",
- d_batch.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
- r_material.MATERIAL_NAME "materialName",
- t_unload.RESULT_UNLOAD_TIME "resultUnloadTime",
- (t_load.RESULT_BILLABLE_TONNAGE-t_unload.RESULT_RAIL_HORIZONTAL_WEIGHT) "differentialWeight",
- oo.ORDER_NO "orderNo",
- TUP.UNLOAD_POINT_NAME "unloadPointName"
- from TMSTRAIN_LOADING_RESULT t_load
- left join AMS_PURCHASE_ORDER a_order
- on t_load.PURCHASE_ORDER_RAIL_PLAN_ID=a_order.PURCHASE_ORDER_ID
- left join DIL_BATCH d_batch
- on t_load.BATCH_ID=d_batch.BATCH_ID
- left join RMS_MATERIAL r_material
- on t_load.MATERIAL_ID=r_material.MATERIAL_ID
- left join TMSTRAIN_WAGON_UNLOAD_RESULT t_unload
- on t_unload.RESULT_WAGON_NO=t_load.RESULT_WAGON_NO
- LEFT JOIN OMSTRAIN_ORDER OO
- ON OO.ORDER_WAGON_NO=t_unload.RESULT_WAGON_NO
- left join TMSTRAIN_UNLOAD_POINT TUP
- on TUP.UNLOAD_POINT_ID=t_unload.UNLOADING_ID
- where t_load.DELETED = 0
- )
- </select>
- <!-- 通过运输订单ID查询关联的火运总实绩ID -->
- <select id="getTotalIdByOrderId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
- select DISTINCT
- TTTR.TMSTRAIN_TOTAL_RESULT_ID "trainTotalId",
- TTTR.TMSTRUCK_TOTAL_RESULT_ID "truckTotalId"
- from TMSTRUCK_TOTAL_RESULT TTR
- LEFT JOIN TMSTRAIN_TRUCK_TOTAL_RESULT TTTR
- ON TTR.RESULT_TOTAL_ID = TTTR.TMSTRUCK_TOTAL_RESULT_ID
- WHERE TTR.ORDER_ID = #{orderId}
- </select>
- <!-- 通过火运总实绩ID查询火运装车实绩ID-->
- <select id="getLoadingIdByTrainTotalId" parameterType="java.math.BigDecimal" resultType="java.lang.Integer">
- SELECT TTR.LOADING_ID
- FROM TMSTRAIN_TOTAL_RESULT TTR
- WHERE TTR.TOTAL_RESULT_ID = #{trainTotalId}
- </select>
- <!-- 通过装车实绩ID查询车皮号与发运计划ID -->
- <select id="getWagonNoAndRailPlanByLoadingId" parameterType="int" resultType="java.util.Map">
- SELECT TLR.RESULT_WAGON_NO "resultWagonNo",
- TLR.PURCHASE_ORDER_RAIL_PLAN_ID "railPlanId"
- FROM TMSTRAIN_LOADING_RESULT TLR
- WHERE TLR.RESULT_ID = #{loadingId}
- </select>
- <!-- 通过车皮号与发运计划ID匹配卸车实绩 -->
- <select id="getUnloadIdByWagonNoAndRailPlanId" resultType="java.lang.Integer">
- SELECT TWUR.UNLOADING_ID
- FROM TMSTRAIN_WAGON_UNLOAD_RESULT TWUR
- WHERE TWUR.RESULT_WAGON_NO = #{resultWagonNo} AND TWUR.PURCHASE_ORDER_RAIL_PLAN_ID = #{railPlanId}
- </select>
- <!-- 内转达州站到厂内料场 10003 达州站 -->
- <select id="getTrainUnloadDaZhouToDaGang" parameterType="java.util.Map" resultType="java.util.Map">
- select
- apo.purchase_order_no "purchaseOrderNo",
- db.result_foreign_ship_name "resultForeignShipName",
- rm.material_name "materialName",
- twur.result_wagon_no "resultWagonNo",
- twur.result_unload_time "resultUnloadTime",
- rw.WAREHOUSE_NAME "warehouseName",
- (
- select TLR.RESULT_BILLABLE_TONNAGE
- from TMSTRAIN_LOADING_RESULT TLR
- where TLR.RESULT_WAGON_NO = twur.RESULT_WAGON_NO
- and rownum = 1
- ) "unloadWeight"
- from tmstrain_wagon_unload_result twur
- left join ams_purchase_order apo
- on apo.purchase_order_id = twur.purchase_order_rail_plan_id
- left join dil_batch db
- on db.batch_id = apo.batch_id
- left join rms_material rm
- on rm.material_id = db.material_id
- left join rms_warehouse rw
- on rw.warehouse_id = twur.unloading_id
- where twur.RESULT_TYPE = 1 and twur.UNLOADING_POINT_ID = 9
- </select>
- <!-- 内转老区轨道衡-厂内料场 -->
- <select id="getTrainUnloadLaoQuToDaGgang" parameterType="java.util.Map" resultType="java.util.Map">
- select
- apo.purchase_order_no "purchaseOrderNo",
- db.result_foreign_ship_name "resultForeignShipName",
- rm.material_name "materialName",
- twur.result_wagon_no "resultWagonNo",
- twur.result_unload_time "resultUnloadTime",
- rw.WAREHOUSE_NAME "warehouseName",
- (
- select TLR.RESULT_BILLABLE_TONNAGE
- from TMSTRAIN_LOADING_RESULT TLR
- where TLR.RESULT_WAGON_NO = twur.RESULT_WAGON_NO
- and rownum = 1
- ) "unloadWeight"
- from tmstrain_wagon_unload_result twur
- left join ams_purchase_order apo
- on apo.purchase_order_id = twur.purchase_order_rail_plan_id
- left join dil_batch db
- on db.batch_id = apo.batch_id
- left join rms_material rm
- on rm.material_id = db.material_id
- left join rms_warehouse rw
- on rw.warehouse_id = twur.unloading_id
- where twur.RESULT_TYPE = 1 and twur.UNLOADING_POINT_ID = 13
- </select>
- <!--查询装车实绩中的卸货点 -->
- <select id="getUnloadId" parameterType="java.util.Map" resultType="java.math.BigDecimal">
- select TLR.UNLOADING_POINT_ID
- from TMSTRAIN_LOADING_RESULT TLR
- where TLR.RESULT_ID = #{resultId}
- </select>
- </mapper>
|