1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.steerinfo.dil.mapper.TmstruckUnloadResultMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckUnloadResult">
- <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
- <result column="RESULT_NUMBER" jdbcType="VARCHAR" property="resultNumber" />
- <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
- <result column="RESULT_START_TIME" jdbcType="TIMESTAMP" property="resultStartTime" />
- <result column="RESULT_END_TIME" jdbcType="TIMESTAMP" property="resultEndTime" />
- <result column="RESULT_DURATION" jdbcType="DECIMAL" property="resultDuration" />
- <result column="UNLOAD_STATUS" jdbcType="VARCHAR" property="unloadStatus" />
- <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
- <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
- <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
- <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
- <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
- <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
- <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
- <result column="RESULT_UNLOAD_PLACE_ID" jdbcType="DECIMAL" property="resultUnloadPlaceId" />
- <result column="SEGMENT_SQE" jdbcType="DECIMAL" property="segmentSqe" />
- <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
- <result column="UNLOADER_ID" jdbcType="DECIMAL" property="unloaderId" />
- </resultMap>
- <sql id="columns">
- RESULT_ID, RESULT_NUMBER, RESULT_TOTAL_ID, RESULT_START_TIME, RESULT_END_TIME, RESULT_DURATION,
- UNLOAD_STATUS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
- DELETE_NAME, DELETE_TIME, RESULT_UNLOAD_PLACE_ID, SEGMENT_SQE, MATERIAL_ID, UNLOADER_ID
- </sql>
- <sql id="columns_alias">
- t.RESULT_ID, t.RESULT_NUMBER, t.RESULT_TOTAL_ID, t.RESULT_START_TIME, t.RESULT_END_TIME,
- t.RESULT_DURATION, t.UNLOAD_STATUS, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
- t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETE_NAME, t.DELETE_TIME, t.RESULT_UNLOAD_PLACE_ID,
- t.SEGMENT_SQE, t.MATERIAL_ID, t.UNLOADER_ID
- </sql>
- <sql id="select">
- SELECT <include refid="columns" /> FROM TMSTRUCK_UNLOAD_RESULT
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias" /> FROM TMSTRUCK_UNLOAD_RESULT t
- </sql>
- <sql id="where">
- <where>
- <if test="resultId != null">
- and RESULT_ID = #{resultId}
- </if>
- <if test="resultNumber != null and resultNumber != ''">
- and RESULT_NUMBER = #{resultNumber}
- </if>
- <if test="resultTotalId != null">
- and RESULT_TOTAL_ID = #{resultTotalId}
- </if>
- <if test="resultStartTime != null">
- and TO_CHAR(RESULT_START_TIME,'yyyy-MM-dd') = #{resultStartTime}
- </if>
- <if test="resultEndTime != null">
- and TO_CHAR(RESULT_END_TIME,'yyyy-MM-dd') = #{resultEndTime}
- </if>
- <if test="resultDuration != null">
- and RESULT_DURATION = #{resultDuration}
- </if>
- <if test="unloadStatus != null and unloadStatus != ''">
- and UNLOAD_STATUS = #{unloadStatus}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- and INSERT_USERNAME = #{insertUsername}
- </if>
- <if test="insertTime != null">
- and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- and UPDATE_USERNAME = #{updateUsername}
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- <if test="deleteName != null and deleteName != ''">
- and DELETE_NAME = #{deleteName}
- </if>
- <if test="deleteTime != null">
- and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
- </if>
- <if test="resultUnloadPlaceId != null">
- and RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId}
- </if>
- <if test="segmentSqe != null">
- and SEGMENT_SQE = #{segmentSqe}
- </if>
- <if test="materialId != null">
- and MATERIAL_ID = #{materialId}
- </if>
- <if test="unloaderId != null">
- and UNLOADER_ID = #{unloaderId}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="resultId != null">
- and RESULT_ID = #{resultId}
- </if>
- <if test="resultNumber != null and resultNumber != ''">
- and RESULT_NUMBER LIKE '%${resultNumber}%'
- </if>
- <if test="resultTotalId != null">
- and RESULT_TOTAL_ID = #{resultTotalId}
- </if>
- <if test="resultStartTime != null">
- and TO_CHAR(RESULT_START_TIME,'yyyy-MM-dd') = #{resultStartTime}
- </if>
- <if test="resultEndTime != null">
- and TO_CHAR(RESULT_END_TIME,'yyyy-MM-dd') = #{resultEndTime}
- </if>
- <if test="resultDuration != null">
- and RESULT_DURATION = #{resultDuration}
- </if>
- <if test="unloadStatus != null and unloadStatus != ''">
- and UNLOAD_STATUS LIKE '%${unloadStatus}%'
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- and INSERT_USERNAME LIKE '%${insertUsername}%'
- </if>
- <if test="insertTime != null">
- and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- and UPDATE_USERNAME LIKE '%${updateUsername}%'
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
- </if>
- <if test="deleteName != null and deleteName != ''">
- and DELETE_NAME LIKE '%${deleteName}%'
- </if>
- <if test="deleteTime != null">
- and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
- </if>
- <if test="resultUnloadPlaceId != null">
- and RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId}
- </if>
- <if test="segmentSqe != null">
- and SEGMENT_SQE = #{segmentSqe}
- </if>
- <if test="materialId != null">
- and MATERIAL_ID = #{materialId}
- </if>
- <if test="unloaderId != null">
- and UNLOADER_ID = #{unloaderId}
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
- delete from TMSTRUCK_UNLOAD_RESULT
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from TMSTRUCK_UNLOAD_RESULT
- where 1!=1
- <if test="resultNumber != null and resultNumber != ''">
- or RESULT_NUMBER = #{resultNumber}
- </if>
- <if test="resultTotalId != null">
- or RESULT_TOTAL_ID = #{resultTotalId}
- </if>
- <if test="resultStartTime != null">
- or TO_CHAR(RESULT_START_TIME,'yyyy-MM-dd') = '#{resultStartTime}'
- </if>
- <if test="resultEndTime != null">
- or TO_CHAR(RESULT_END_TIME,'yyyy-MM-dd') = '#{resultEndTime}'
- </if>
- <if test="resultDuration != null">
- or RESULT_DURATION = #{resultDuration}
- </if>
- <if test="unloadStatus != null and unloadStatus != ''">
- or UNLOAD_STATUS = #{unloadStatus}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- or INSERT_USERNAME = #{insertUsername}
- </if>
- <if test="insertTime != null">
- or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- or UPDATE_USERNAME = #{updateUsername}
- </if>
- <if test="updateTime != null">
- or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- <if test="deleteName != null and deleteName != ''">
- or DELETE_NAME = #{deleteName}
- </if>
- <if test="deleteTime != null">
- or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
- </if>
- <if test="resultUnloadPlaceId != null">
- or RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId}
- </if>
- <if test="segmentSqe != null">
- or SEGMENT_SQE = #{segmentSqe}
- </if>
- <if test="materialId != null">
- or MATERIAL_ID = #{materialId}
- </if>
- <if test="unloaderId != null">
- or UNLOADER_ID = #{unloaderId}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
- insert into TMSTRUCK_UNLOAD_RESULT (RESULT_ID, RESULT_NUMBER, RESULT_TOTAL_ID,
- RESULT_START_TIME, RESULT_END_TIME, RESULT_DURATION,
- UNLOAD_STATUS, INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
- DELETE_NAME, DELETE_TIME, RESULT_UNLOAD_PLACE_ID,
- SEGMENT_SQE, MATERIAL_ID, UNLOADER_ID
- )
- values (#{resultId,jdbcType=DECIMAL}, #{resultNumber,jdbcType=VARCHAR}, #{resultTotalId,jdbcType=DECIMAL},
- #{resultStartTime,jdbcType=TIMESTAMP}, #{resultEndTime,jdbcType=TIMESTAMP}, #{resultDuration,jdbcType=DECIMAL},
- #{unloadStatus,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
- #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
- #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{resultUnloadPlaceId,jdbcType=DECIMAL},
- #{segmentSqe,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{unloaderId,jdbcType=DECIMAL}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
- insert into TMSTRUCK_UNLOAD_RESULT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="resultId != null">
- RESULT_ID,
- </if>
- <if test="resultNumber != null">
- RESULT_NUMBER,
- </if>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID,
- </if>
- <if test="resultStartTime != null">
- RESULT_START_TIME,
- </if>
- <if test="resultEndTime != null">
- RESULT_END_TIME,
- </if>
- <if test="resultDuration != null">
- RESULT_DURATION,
- </if>
- <if test="unloadStatus != null">
- UNLOAD_STATUS,
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME,
- </if>
- <if test="insertTime != null">
- INSERT_TIME,
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME,
- </if>
- <if test="updateTime != null">
- UPDATE_TIME,
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK,
- </if>
- <if test="deleteName != null">
- DELETE_NAME,
- </if>
- <if test="deleteTime != null">
- DELETE_TIME,
- </if>
- <if test="resultUnloadPlaceId != null">
- RESULT_UNLOAD_PLACE_ID,
- </if>
- <if test="segmentSqe != null">
- SEGMENT_SQE,
- </if>
- <if test="materialId != null">
- MATERIAL_ID,
- </if>
- <if test="unloaderId != null">
- UNLOADER_ID,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="resultId != null">
- #{resultId,jdbcType=DECIMAL},
- </if>
- <if test="resultNumber != null">
- #{resultNumber,jdbcType=VARCHAR},
- </if>
- <if test="resultTotalId != null">
- #{resultTotalId,jdbcType=DECIMAL},
- </if>
- <if test="resultStartTime != null">
- #{resultStartTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultEndTime != null">
- #{resultEndTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultDuration != null">
- #{resultDuration,jdbcType=DECIMAL},
- </if>
- <if test="unloadStatus != null">
- #{unloadStatus,jdbcType=VARCHAR},
- </if>
- <if test="insertUsername != null">
- #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUpdateRemark != null">
- #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- <if test="deleteName != null">
- #{deleteName,jdbcType=VARCHAR},
- </if>
- <if test="deleteTime != null">
- #{deleteTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultUnloadPlaceId != null">
- #{resultUnloadPlaceId,jdbcType=DECIMAL},
- </if>
- <if test="segmentSqe != null">
- #{segmentSqe,jdbcType=DECIMAL},
- </if>
- <if test="materialId != null">
- #{materialId,jdbcType=DECIMAL},
- </if>
- <if test="unloaderId != null">
- #{unloaderId,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
- update TMSTRUCK_UNLOAD_RESULT
- set RESULT_NUMBER = #{resultNumber,jdbcType=VARCHAR},
- RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
- RESULT_START_TIME = #{resultStartTime,jdbcType=TIMESTAMP},
- RESULT_END_TIME = #{resultEndTime,jdbcType=TIMESTAMP},
- RESULT_DURATION = #{resultDuration,jdbcType=DECIMAL},
- UNLOAD_STATUS = #{unloadStatus,jdbcType=VARCHAR},
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
- DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
- RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId,jdbcType=DECIMAL},
- SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
- MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
- UNLOADER_ID = #{unloaderId,jdbcType=DECIMAL}
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
- update TMSTRUCK_UNLOAD_RESULT
- <set>
- <if test="resultNumber != null">
- RESULT_NUMBER = #{resultNumber,jdbcType=VARCHAR},
- </if>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
- </if>
- <if test="resultStartTime != null">
- RESULT_START_TIME = #{resultStartTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultEndTime != null">
- RESULT_END_TIME = #{resultEndTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultDuration != null">
- RESULT_DURATION = #{resultDuration,jdbcType=DECIMAL},
- </if>
- <if test="unloadStatus != null">
- UNLOAD_STATUS = #{unloadStatus,jdbcType=VARCHAR},
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- <if test="deleteName != null">
- DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
- </if>
- <if test="deleteTime != null">
- DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultUnloadPlaceId != null">
- RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId,jdbcType=DECIMAL},
- </if>
- <if test="segmentSqe != null">
- SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
- </if>
- <if test="materialId != null">
- MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
- </if>
- <if test="unloaderId != null">
- UNLOADER_ID = #{unloaderId,jdbcType=DECIMAL},
- </if>
- </set>
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
- <include refid="select" />
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </select>
- <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select" />
- <include refid="where" />
- </select>
- <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select" />
- <include refid="whereLike" />
- </select>
- <insert id="batchInsert" parameterType="java.util.List">
- insert into TMSTRUCK_UNLOAD_RESULT
- (RESULT_ID,
- RESULT_NUMBER, RESULT_TOTAL_ID,
- RESULT_START_TIME, RESULT_END_TIME,
- RESULT_DURATION, UNLOAD_STATUS,
- INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME,
- INSERT_UPDATE_REMARK, DELETE_NAME,
- DELETE_TIME, RESULT_UNLOAD_PLACE_ID,
- SEGMENT_SQE, MATERIAL_ID, UNLOADER_ID
- )
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.resultId,jdbcType=DECIMAL},
- #{item.resultNumber,jdbcType=VARCHAR}, #{item.resultTotalId,jdbcType=DECIMAL},
- #{item.resultStartTime,jdbcType=TIMESTAMP}, #{item.resultEndTime,jdbcType=TIMESTAMP},
- #{item.resultDuration,jdbcType=DECIMAL}, #{item.unloadStatus,jdbcType=VARCHAR},
- #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
- #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
- #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR},
- #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.resultUnloadPlaceId,jdbcType=DECIMAL},
- #{item.segmentSqe,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL}, #{item.unloaderId,jdbcType=DECIMAL}
- from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update TMSTRUCK_UNLOAD_RESULT
- set
- RESULT_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_NUMBER=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultNumber,jdbcType=VARCHAR}
- </foreach>
- ,RESULT_TOTAL_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_START_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultStartTime,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_END_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEndTime,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_DURATION=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultDuration,jdbcType=DECIMAL}
- </foreach>
- ,UNLOAD_STATUS=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.unloadStatus,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- ,DELETE_NAME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
- </foreach>
- ,DELETE_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_UNLOAD_PLACE_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultUnloadPlaceId,jdbcType=DECIMAL}
- </foreach>
- ,SEGMENT_SQE=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.segmentSqe,jdbcType=DECIMAL}
- </foreach>
- ,MATERIAL_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
- </foreach>
- ,UNLOADER_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.unloaderId,jdbcType=DECIMAL}
- </foreach>
- where RESULT_ID in
- <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
- #{item.resultId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from TMSTRUCK_UNLOAD_RESULT
- where RESULT_ID in
- <foreach close=")" collection="list" item="id" open="(" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <!-- 排序 -->
- <sql id="orderBy">
- <if test="orderField != null and orderField != ''">
- order by "${orderField}"
- <if test="orderType != null and orderType != ''">
- ${orderType}
- </if>
- </if>
- <if test="orderField == null ">
- order by "resultEndTime" desc
- </if>
- </sql>
- <!-- 获取采购卸货实绩 -->
- <select id="getCGUnloadResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select *
- from (
- select
- TUR.RESULT_ID "resultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RM.MATERIAL_NAME "materialName",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- RW.WAREHOUSE_NAME "warehouseName",
- TUR.RESULT_END_TIME "resultEndTime",
- TUR.INSERT_TIME "insertTime"
- from TMSTRUCK_UNLOAD_RESULT TUR
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TUR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join TMSTRUCK_WEIGHT_RESULT TWR
- on TWR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on OO.ORDER_ID = TTR.ORDER_ID
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OOM.ORDER_ID = OO.ORDER_ID
- left join RMS_MATERIAL RM
- on OOM.MATERIAL_ID = RM.MATERIAL_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_WAREHOUSE RW
- on RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
- where RESULT_END_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialWeight != null">
- and
- <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
- "orderMaterialWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultStartTime != null">
- and
- <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
- "resultStartTime" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 通过总实绩Id查询卸货实绩Id -->
- <select id="getResultIdByTotalId" parameterType="DECIMAL" resultType="DECIMAL">
- SELECT RESULT_ID
- FROM TMSTRUCK_UNLOAD_RESULT
- WHERE RESULT_TOTAL_ID = #{resultTotalId}
- </select>
- <!-- 通过运输订单号 查询实绩Id、总实绩ID -->
- <select id="selectUnloadMesByOrderNo" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select
- TUR.RESULT_ID "resultId",
- TUR.SEGMENT_SQE "segmentSqe",
- TUR.RESULT_TOTAL_ID "resultTotalId"
- from TMSTRUCK_UNLOAD_RESULT TUR
- where TUR.RESULT_TOTAL_ID = #{resultTotalId}
- <if test="updateLoadResult != null">
- and TUR.RESULT_END_TIME is null
- </if>
- order by TUR.SEGMENT_SQE
- )
- where rownum = 1
- </select>
- <!-- 通过卸货地点查询 仓库ID-->
- <select id="getWarehouseIdByWName" parameterType="string" resultType="java.math.BigDecimal">
- select WAREHOUSE_ID
- from RMS_WAREHOUSE
- where WAREHOUSE_NAME = #{warehouseName}
- </select>
- <!-- 通过总实绩ID查询订单中卸货实绩 -->
- <select id="getUnloadPointId" resultType="java.math.BigDecimal" parameterType="java.util.Map">
- select OO.UNLOAD_POINT_ID from OMSTRUCK_ORDER OO
- left join TMSTRUCK_TOTAL_RESULT TTR
- on OO.ORDER_ID = TTR.ORDER_ID
- where TTR.RESULT_TOTAL_ID = #{resultTotalId}
- </select>
- <!-- 查询内转采购进口矿国产矿实绩 -->
- <select id="getImportedDomesticNzUnloadResult" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select TUR.RESULT_ID "resultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RM.MATERIAL_NAME "materialName",
- DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- RW.WAREHOUSE_NAME "warehouseName",
- TUR.RESULT_START_TIME "resultStartTime",
- TUR.INSERT_TIME "insertTime"
- from TMSTRUCK_UNLOAD_RESULT TUR
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TUR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join TMSTRUCK_WEIGHT_RESULT TWR
- on TWR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on OO.ORDER_ID = TTR.ORDER_ID
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
- left join DIL_BATCH DB
- on DB.BATCH_ID = APO.BATCH_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OOM.ORDER_ID = OO.ORDER_ID
- left join RMS_MATERIAL RM
- on OOM.MATERIAL_ID = RM.MATERIAL_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_WAREHOUSE RW
- on RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
- where RESULT_START_TIME is not null
- and OO.ORDER_TYPE = 9
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialNumber != null">
- and
- <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
- "orderMaterialNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialWeight != null">
- and
- <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
- "orderMaterialWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultStartTime != null">
- and
- <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
- "resultStartTime" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 查询内转采购进口矿国产矿实绩(老区-厂内) -->
- <select id="getImportedDomesticNzUnload2Result" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM ( SELECT TUR.RESULT_ID "resultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RM.MATERIAL_NAME "materialName",
- RW.WAREHOUSE_NAME "warehouseName",
- TUR.RESULT_END_TIME "resultEndTime"
- FROM TMSTRUCK_UNLOAD_RESULT TUR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
- ON OOM.ORDER_ID = OO.ORDER_ID
- left join amstruck_inward_plan aip
- on aip.plan_id = oo.order_plan_id
- left join amstruck_requirement_plan arp
- on arp.plan_id = aip.plan_id
- left join amstruck_inward_requirement air
- on air.requirement_id = arp.requirement_id
- LEFT JOIN AMS_PURCHASE_ORDER APO
- ON APO.PURCHASE_ORDER_ID = air.PURCHASE_ORDER_ID
- LEFT JOIN RMS_MATERIAL RM
- ON RM.MATERIAL_ID = OOM.MATERIAL_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
- WHERE TUR.RESULT_END_TIME IS NOT NULL
- AND OO.ORDER_TYPE in (10,20)
- <if test="userId !=null">
- AND AIR.INSERT_USERNAME = #{userId}
- </if>
- )
- <where>
- <if test="orderNumber != null">
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultEndTime != null">
- and
- <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
- "resultEndTime" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 查询内转厂内卸货实绩 -->
- <select id="getInFactoryUnloadResult" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT TUR.RESULT_ID "resultId",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RM.MATERIAL_NAME "materialName",
- OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
- TUR.RESULT_END_TIME "resultEndTime",
- RW.WAREHOUSE_NAME "warehouseName",
- TWR.RESULT_NET_WEIGHT "resultNetWeight"
- FROM TMSTRUCK_UNLOAD_RESULT TUR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
- ON OOM.ORDER_ID = OO.ORDER_ID
- LEFT JOIN RMS_MATERIAL RM
- ON RM.MATERIAL_ID = OOM.MATERIAL_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
- ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
- WHERE OO.ORDER_TYPE = #{orderTypee}
- ORDER BY TUR.RESULT_END_TIME desc
- )
- <where>
- <if test="orderNumber != null">
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialNumber != null">
- and
- <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
- "orderMaterialNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultEndTime != null">
- and
- <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
- to_char("resultEndTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 根据总实绩ID查询卸货地点-->
- <select id="getSporadicSuppliesUnloadResult" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT distinct
- TUR.RESULT_ID "resultId",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- TUR.RESULT_START_TIME "resultStartTime",
- TUR.RESULT_END_TIME "resultEndTime",
- TUR.RESULT_DURATION "resultDuration",
- RW.WAREHOUSE_NAME "warehouseName",
- RM.MATERIAL_NAME "materialName",
- OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
- OOM.ORDER_MATERIAL_NUMBER "materialNumber",
- TWR.RESULT_NET_WEIGHT "orderMaterialNetWeight"
- FROM TMSTRUCK_UNLOAD_RESULT TUR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
- ON TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
- ON OOM.ORDER_ID=OO.ORDER_ID
- LEFT JOIN RMS_MATERIAL RM
- ON RM.MATERIAL_ID=OOM.MATERIAL_ID
- LEFT JOIN AMSTRUCK_SPORADIC_ORDER ASO
- ON OO.ORDER_PLAN_ID = ASO.SPORADIC_ORDER_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
- WHERE TUR.RESULT_END_TIME IS NOT NULL
- <if test="orderTypee != 100">
- AND OO.ORDER_TYPE = #{orderTypee}
- </if>
- <if test="orderTypee == 100">
- AND OO.ORDER_TYPE in (12, 13 ,14,19)
- </if>
- <if test="userId != null">
- and ASO.INSERT_USERNAME=#{userId}
- </if>
- <if test="userIds!=null">
- and ASO.UPDATE_USERNAME=#{userIds}
- </if>
- )
- <where>
- <if test="orderNumber != null">
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultStartTime != null">
- and
- <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">
- "resultStartTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultEndTime != null">
- and
- <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
- "resultEndTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultDuration != null">
- and
- <foreach collection="resultDuration" item="item" open="(" separator="or" close=")">
- "resultDuration" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 根据优先级查询物资 -->
- <select id="selectMaterialForUnload" resultType="java.util.Map">
- select OOM.MATERIAL_ID "materialId",
- OO.ORDER_ID "orderId"
- from OMSTRUCK_ORDER_MATERIAL OOM
- JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID=OOM.ORDER_ID
- where OO.ORDER_NUMBER=#{orderNumber}
- ORDER BY OOM.MATERIAL_PRIORITY
- </select>
- <!-- 根据物资是否计量 -->
- <select id="selectUnloadMaterialId" resultType="java.lang.Integer" parameterType="java.util.Map">
- SELECT
- COUNT( * )
- FROM
- OMSTRUCK_ORDER_MATERIAL OOM
- JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = OOM.ORDER_ID
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- WHERE OOM.MATERIAL_ID=#{materialId} AND OO.ORDER_ID=#{orderId}
- </select>
- <select id="selectOrderId" resultType="java.util.Map" parameterType="java.util.Map">
- SELECT OO.ORDER_ID "orderId",
- oo.ORDER_NUMBER "orderNumber",
- TTR.RESULT_TOTAL_ID "totalId"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.ORDER_ID = OO.ORDER_ID
- WHERE OO.ORDER_NUMBER = #{orderNumber}
- </select>
- <select id="getNetWeightByTotalId" parameterType="java.math.BigDecimal" resultType="int">
- select COUNT(TWR.RESULT_NET_WEIGHT) from TMSTRUCK_WEIGHT_RESULT TWR where TWR.RESULT_TOTAL_ID = #{totalId}
- </select>
- <select id="checkMaterialIdUnload" resultType="java.lang.Integer">
- select TUR.RESULT_ID
- from TMSTRUCK_UNLOAD_RESULT TUR
- where TUR.RESULT_TOTAL_ID = #{resultTotalId}
- and TUR.MATERIAL_ID = #{materialId}
- </select>
- </mapper>
|