12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400 |
- <?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.TmstruckEnfactoryResultMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckEnfactoryResult">
- <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
- <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
- <result column="GATEPOST_ID" jdbcType="DECIMAL" property="gatepostId" />
- <result column="RESULT_ENTRY_MODE" jdbcType="VARCHAR" property="resultEntryMode" />
- <result column="RESULT_ENTRY_GATE_TIME" jdbcType="TIMESTAMP" property="resultEntryGateTime" />
- <result column="RESULT_MEMO" jdbcType="VARCHAR" property="resultMemo" />
- <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_USERNAME" jdbcType="VARCHAR" property="deleteUsername" />
- <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
- <result column="SEGMEN_SQE" jdbcType="DECIMAL" property="segmenSqe" />
- </resultMap>
- <sql id="columns">
- RESULT_ID, RESULT_TOTAL_ID, GATEPOST_ID, RESULT_ENTRY_MODE, RESULT_ENTRY_GATE_TIME,
- RESULT_MEMO, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
- DELETE_USERNAME, DELETE_TIME, SEGMEN_SQE
- </sql>
- <sql id="columns_alias">
- t.RESULT_ID, t.RESULT_TOTAL_ID, t.GATEPOST_ID, t.RESULT_ENTRY_MODE, t.RESULT_ENTRY_GATE_TIME,
- t.RESULT_MEMO, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
- t.INSERT_UPDATE_REMARK, t.DELETE_USERNAME, t.DELETE_TIME, t.SEGMEN_SQE
- </sql>
- <sql id="select">
- SELECT <include refid="columns"/> FROM TMSTRUCK_ENFACTORY_RESULT
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias"/> FROM TMSTRUCK_ENFACTORY_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="gatepostId != null">
- and GATEPOST_ID = #{gatepostId}
- </if>
- <if test="resultEntryMode != null and resultEntryMode != ''">
- and RESULT_ENTRY_MODE = #{resultEntryMode}
- </if>
- <if test="resultEntryGateTime != null">
- and TO_CHAR(RESULT_ENTRY_GATE_TIME,'yyyy-MM-dd') = #{resultEntryGateTime}
- </if>
- <if test="resultMemo != null and resultMemo != ''">
- and RESULT_MEMO = #{resultMemo}
- </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="deleteUsername != null and deleteUsername != ''">
- and DELETE_USERNAME = #{deleteUsername}
- </if>
- <if test="deleteTime != null">
- and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
- </if>
- <if test="segmenSqe != null">
- and SEGMEN_SQE = #{segmenSqe}
- </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="gatepostId != null">
- and GATEPOST_ID = #{gatepostId}
- </if>
- <if test="resultEntryMode != null and resultEntryMode != ''">
- and RESULT_ENTRY_MODE LIKE '%${resultEntryMode}%'
- </if>
- <if test="resultEntryGateTime != null">
- and TO_CHAR(RESULT_ENTRY_GATE_TIME,'yyyy-MM-dd') = #{resultEntryGateTime}
- </if>
- <if test="resultMemo != null and resultMemo != ''">
- and RESULT_MEMO LIKE '%${resultMemo}%'
- </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="deleteUsername != null and deleteUsername != ''">
- and DELETE_USERNAME LIKE '%${deleteUsername}%'
- </if>
- <if test="deleteTime != null">
- and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
- </if>
- <if test="segmenSqe != null">
- and SEGMEN_SQE = #{segmenSqe}
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
- delete from TMSTRUCK_ENFACTORY_RESULT
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from TMSTRUCK_ENFACTORY_RESULT
- where 1!=1
- <if test="resultTotalId != null">
- or RESULT_TOTAL_ID = #{resultTotalId}
- </if>
- <if test="gatepostId != null">
- or GATEPOST_ID = #{gatepostId}
- </if>
- <if test="resultEntryMode != null and resultEntryMode != ''">
- or RESULT_ENTRY_MODE = #{resultEntryMode}
- </if>
- <if test="resultEntryGateTime != null">
- or TO_CHAR(RESULT_ENTRY_GATE_TIME,'yyyy-MM-dd') = '#{resultEntryGateTime}'
- </if>
- <if test="resultMemo != null and resultMemo != ''">
- or RESULT_MEMO = #{resultMemo}
- </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="deleteUsername != null and deleteUsername != ''">
- or DELETE_USERNAME = #{deleteUsername}
- </if>
- <if test="deleteTime != null">
- or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
- </if>
- <if test="segmenSqe != null">
- or SEGMEN_SQE = #{segmenSqe}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
- insert into TMSTRUCK_ENFACTORY_RESULT (RESULT_ID, RESULT_TOTAL_ID, GATEPOST_ID,
- RESULT_ENTRY_MODE, RESULT_ENTRY_GATE_TIME,
- RESULT_MEMO, INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
- DELETE_USERNAME, DELETE_TIME, SEGMEN_SQE
- )
- values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{gatepostId,jdbcType=DECIMAL},
- #{resultEntryMode,jdbcType=VARCHAR}, #{resultEntryGateTime,jdbcType=TIMESTAMP},
- #{resultMemo,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
- #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
- #{deleteUsername,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{segmenSqe,jdbcType=DECIMAL}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
- insert into TMSTRUCK_ENFACTORY_RESULT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="resultId != null">
- RESULT_ID,
- </if>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID,
- </if>
- <if test="gatepostId != null">
- GATEPOST_ID,
- </if>
- <if test="resultEntryMode != null">
- RESULT_ENTRY_MODE,
- </if>
- <if test="resultEntryGateTime != null">
- RESULT_ENTRY_GATE_TIME,
- </if>
- <if test="resultMemo != null">
- RESULT_MEMO,
- </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="deleteUsername != null">
- DELETE_USERNAME,
- </if>
- <if test="deleteTime != null">
- DELETE_TIME,
- </if>
- <if test="segmenSqe != null">
- SEGMEN_SQE,
- </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="gatepostId != null">
- #{gatepostId,jdbcType=DECIMAL},
- </if>
- <if test="resultEntryMode != null">
- #{resultEntryMode,jdbcType=VARCHAR},
- </if>
- <if test="resultEntryGateTime != null">
- #{resultEntryGateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultMemo != null">
- #{resultMemo,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="deleteUsername != null">
- #{deleteUsername,jdbcType=VARCHAR},
- </if>
- <if test="deleteTime != null">
- #{deleteTime,jdbcType=TIMESTAMP},
- </if>
- <if test="segmenSqe != null">
- #{segmenSqe,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
- update TMSTRUCK_ENFACTORY_RESULT
- set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
- GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL},
- RESULT_ENTRY_MODE = #{resultEntryMode,jdbcType=VARCHAR},
- RESULT_ENTRY_GATE_TIME = #{resultEntryGateTime,jdbcType=TIMESTAMP},
- RESULT_MEMO = #{resultMemo,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_USERNAME = #{deleteUsername,jdbcType=VARCHAR},
- DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
- SEGMEN_SQE = #{segmenSqe,jdbcType=DECIMAL}
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
- update TMSTRUCK_ENFACTORY_RESULT
- <set>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
- </if>
- <if test="gatepostId != null">
- GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL},
- </if>
- <if test="resultEntryMode != null">
- RESULT_ENTRY_MODE = #{resultEntryMode,jdbcType=VARCHAR},
- </if>
- <if test="resultEntryGateTime != null">
- RESULT_ENTRY_GATE_TIME = #{resultEntryGateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultMemo != null">
- RESULT_MEMO = #{resultMemo,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="deleteUsername != null">
- DELETE_USERNAME = #{deleteUsername,jdbcType=VARCHAR},
- </if>
- <if test="deleteTime != null">
- DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
- </if>
- <if test="segmenSqe != null">
- SEGMEN_SQE = #{segmenSqe,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_ENFACTORY_RESULT
- (RESULT_ID,
- RESULT_TOTAL_ID, GATEPOST_ID, RESULT_ENTRY_MODE,
- RESULT_ENTRY_GATE_TIME, RESULT_MEMO,
- INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME,
- INSERT_UPDATE_REMARK, DELETE_USERNAME,
- DELETE_TIME, SEGMEN_SQE)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.resultId,jdbcType=DECIMAL},
- #{item.resultTotalId,jdbcType=DECIMAL}, #{item.gatepostId,jdbcType=DECIMAL}, #{item.resultEntryMode,jdbcType=VARCHAR},
- #{item.resultEntryGateTime,jdbcType=TIMESTAMP}, #{item.resultMemo,jdbcType=VARCHAR},
- #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
- #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
- #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleteUsername,jdbcType=VARCHAR},
- #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.segmenSqe,jdbcType=DECIMAL} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update TMSTRUCK_ENFACTORY_RESULT
- set
- RESULT_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_TOTAL_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
- </foreach>
- ,GATEPOST_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.gatepostId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_ENTRY_MODE=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEntryMode,jdbcType=VARCHAR}
- </foreach>
- ,RESULT_ENTRY_GATE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEntryGateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_MEMO=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultMemo,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- ,DELETE_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteUsername,jdbcType=VARCHAR}
- </foreach>
- ,DELETE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
- </foreach>
- ,SEGMEN_SQE=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.segmenSqe,jdbcType=DECIMAL}
- </foreach>
- where RESULT_ID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.resultId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from TMSTRUCK_ENFACTORY_RESULT
- where RESULT_ID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <!-- 按照进厂时间进行排序 -->
- <sql id="orderByEnterTime">
- <if test="orderField != null and orderField != ''">
- order by "${orderField}"
- <if test="orderType != null and orderType != ''">
- ${orderType}
- </if>
- </if>
- <if test="orderField == null ">
- order by "resultEntryGateTime" desc
- </if>
- </sql>
- <!-- 查询所有的采购进厂作业实绩 -->
- <select id="getCGJKEnFactoryResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select *
- from (
- select
- TER.RESULT_ID "resultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RG.GATEPOST_NAME "gatepostName",
- TER.RESULT_ENTRY_MODE "resultEntryMode",
- TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
- RS.SUPPLIER_NAME "supplierName",
- OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
- TER.INSERT_TIME "insertTime",
- RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
- from TMSTRUCK_ENFACTORY_RESULT TER
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on TTR.ORDER_ID = OO.ORDER_ID
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
- left join DIL_BATCH DB
- on DB.BATCH_ID = APO.BATCH_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_SUPPLIER RS
- on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
- left join RMS_CONSIGNEE RCON
- on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_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_GATEPOST RG
- on RG.GATEPOST_ID = TER.GATEPOST_ID
- where TER.RESULT_ENTRY_GATE_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
- )
- <where>
- <if test="purchaseOrderId != null">
- <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
- "purchaseOrderId" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" 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="resultEntryMode != null">
- and
- <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
- "resultEntryMode" like '%${item}%'
- </foreach>
- </if>
- <if test="supplierName != null">
- and
- <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
- "supplierName" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialWeight != null">
- and
- <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
- "orderMaterialWeight" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderByEnterTime"></include>
- </select>
- <!-- 查询内转进厂作业实绩 -->
- <select id="getAllInwardTurnEnFactoryResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select *
- from (
- select
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RG.GATEPOST_NAME "gatepostName",
- TER.RESULT_ENTRY_MODE "resultEntryMode",
- TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
- (
- CASE
- WHEN OOM.ORDER_MATERIAL_WEIGHT is null
- THEN OOM.ORDER_MATERIAL_NUMBER
- ELSE OOM.ORDER_MATERIAL_WEIGHT
- END
- ) "orderMaterialNo"
- from TMSTRUCK_ENFACTORY_RESULT TER
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on TTR.ORDER_ID = OO.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_GATEPOST RG
- on RG.GATEPOST_ID = TER.GATEPOST_ID
- where TER.RESULT_ENTRY_GATE_TIME is not null and OO.ORDER_TYPE = 4
- )
- <where>
- <if test="materialName != null">
- <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="resultEntryMode != null">
- and
- <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
- "resultEntryMode" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialNo != null">
- and
- <foreach collection="orderMaterialNo" item="item" open="(" separator="or" close=")">
- "orderMaterialNo" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderByEnterTime"></include>
- </select>
- <!-- 通过车牌号并且状态不为2 或 运输订单 或运输订单ID 查询关联的实绩总表ID -->
- <select id="selectTotalResultIdByCpAndOn" parameterType="java.util.Map" resultType="java.util.Map">
- select TTR.RESULT_TOTAL_ID "resultTotalId",
- RC.CAPACITY_NUMBER "capacityNumber",
- OO.ORDER_TYPE "orderType"
- from OMSTRUCK_ORDER OO
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TTR.ORDER_ID = OO.ORDER_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- <where>
- <if test="orderId != null">
- OO.ORDER_ID = #{orderId}
- </if>
- <if test="orderNumber != null and orderId == null">
- and OO.ORDER_NUMBER = #{orderNumber}
- </if>
- </where>
- </select>
- <!-- 通过门岗名称查询门岗Id-->
- <select id="selectGatepostIdByGatepostName" parameterType="java.lang.String" resultType="int">
- select GATEPOST_ID "gatepostId"
- from RMS_GATEPOST
- where GATEPOST_NAME = #{gatepostName}
- </select>
- <!-- 通过运输订单号查找实绩Id -->
- <select id="selectEnFactoryResultId" parameterType="string" resultType="java.util.Map">
- select * from (select TER.RESULT_ID "resultId",
- OO.ORDER_ID "orderId",
- OO.ORDER_TYPE "orderTypee", --避免与筛选条件重名
- OO.ORDER_TYPE "orderType",
- TER.RESULT_TOTAL_ID "resultTotalId",
- RC.CAPACITY_NUMBER "capacityNumber",
- TER.SEGMEN_SQE "segmentSqe", --进厂的路段顺序号
- ter.result_entry_gate_time
- from OMSTRUCK_ORDER OO
- left join TMSTRUCK_TOTAL_RESULT TTR
- on OO.ORDER_ID = TTR.ORDER_ID
- left join TMSTRUCK_ENFACTORY_RESULT TER
- on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- where OO.ORDER_NUMBER = #{orderNumber}
- and ter.result_entry_gate_time is null
- order by TER.SEGMEN_SQE)
- where rownum=1
- </select>
- <!-- 查找排队序号 -->
- <select id="selectNodeNumber" resultType="int" parameterType="string">
- select (
- <![CDATA[
- select count(*)
- from QMS_QUEUE_LIST QQL2
- join QMS_QUEUE_GRID QQG2
- on QQG2.GRID_ID = QQL2.GRID_ID
- where QQL2.LIST_NODE_ORDER <= QQL.LIST_NODE_ORDER
- and QQL2.GRID_ID = QQL.GRID_ID
- and QQL2.DELETED = 0
- ]]>
- ) "listNodeOrder"
- from OMSTRUCK_ORDER OO
- left join QMS_QUEUE_LIST QQL
- on OO.CAPACITY_ID = QQL.CAPACITY_ID
- where OO.ORDER_NUMBER = #{orderNumber}
- and QQL.DELETED = 1
- </select>
- <!--查询销售进厂实绩 -->
- <select id="getXSEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select
- TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
- TER.RESULT_ENTRY_MODE "resultEntryMode",
- RG.GATEPOST_NAME "gatepostName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- OO.ORDER_ID "orderId",
- ASO.SALE_NUMBER "saleNum",
- RS.SUPPLIER_NAME "shipperName",
- RCON.CONSIGNEE_COMPANY_NAME "supplierName"
- FROM TMSTRUCK_ENFACTORY_RESULT TER
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.RESULT_TOTAL_ID = TER.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
- ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
- LEFT JOIN AMS_SALE_ORDER ASO
- ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
- LEFT JOIN RMS_GATEPOST RG
- ON RG.GATEPOST_ID = TER.GATEPOST_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- LEFT JOIN RMS_SUPPLIER RS
- ON RS.SUPPLIER_ID = ASO.SHIPPER_ID
- LEFT JOIN RMS_CONSIGNEE RCON
- ON RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
- WHERE TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
- AND OO.ORDER_TYPE IN (1, 2, 3)
- )
- <where>
- <if test="saleNum != null">
- <foreach collection="saleNum" item="item" open="(" separator="or" close=")">
- "saleNum" like '%${item}%'
- </foreach>
- </if>
- <if test="gatepostName != null">
- and
- <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
- "gatepostName" 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="shipperName != null">
- and
- <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
- "shipperName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultEntryMode != null">
- and
- <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
- "resultEntryMode" like '%${item}%'
- </foreach>
- </if>
- <if test="resultEntryGateTime != null">
- and
- <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
- "resultEntryGateTime" like '%${item}%'
- </foreach>
- </if>
- <if test="supplierName != null">
- and
- <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
- "supplierName" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderByEnterTime"></include>
- </select>
- <select id="ads">
- </select>
- <select id="getMaterial" parameterType="int" resultType="java.util.Map">
- SELECT RM.MATERIAL_NAME "materialName",
- CONCAT(CONCAT(RM.MATERIAL_SPECIFICATION, '('), CONCAT(RM.MATERIAL_MODEL, ')')) "specificationModel",
- OM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
- OM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OM
- ON OO.ORDER_ID = OM.ORDER_ID
- LEFT JOIN RMS_MATERIAL RM
- ON OM.MATERIAL_ID = RM.MATERIAL_ID
- WHERE OO.ORDER_ID = #{orderId}
- </select>
- <!-- APP查询进厂实绩 -->
- <select id="getEnfactoryResultList" resultType="java.util.Map">
- SELECT OO.ORDER_NUMBER AS "orderNumber",
- TER.RESULT_ENTRY_GATE_TIME AS "resultEntryGateTime",
- RC.CAPACITY_NUMBER AS "capacityNumber"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.ORDER_ID = OO.ORDER_ID
- LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER
- ON TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- -- WHERE TER
- </select>
- <!-- APP通过运输订单id查询进厂实绩 -->
- <select id="getEnfactoryMessageByOrderId" parameterType="java.lang.String" resultType="java.util.Map">
- SELECT OO.ORDER_NUMBER AS "orderNumber",
- RCA.CAPACITY_NUMBER AS "capacityNumber"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN RMS_CAPACITY RCA
- ON RCA.CAPACITY_ID = OO.CAPACITY_ID
- WHERE OO.ORDER_NUMBER = #{orderNumber}
- </select>
- <!-- 查询内转钢材到异地库进厂实绩 -->
- <select id="getSteelNZEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT
- OO.ORDER_ID "orderId",
- AROD.DAYPLAN_NO "dayplanNo",
- OO.ORDER_NUMBER "orderNumber",
- RG.GATEPOST_NAME "gatepostName",
- TER.RESULT_ENTRY_MODE "resultEntryMode",
- RC.CAPACITY_NUMBER "capacityNumber",
- TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
- RS.SHIPPER_NAME "shipperName",
- RW.WAREHOUSE_NAME "warehouseName"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.ORDER_ID = OO.ORDER_ID
- LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
- ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
- LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER
- ON TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- LEFT JOIN RMS_GATEPOST RG
- ON RG.GATEPOST_ID = TER.GATEPOST_ID
- LEFT JOIN RMS_SHIPPER RS
- ON RS.SHIPPER_ID = AROD.SHIPPER_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = AROD.RECEIVING_UNIT_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- WHERE OO.ORDER_TYPE = 4
- AND TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
- )
- <where>
- <if test="dayplanNo != null">
- <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
- "dayplanNo" 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="gatepostName != null">
- and
- <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
- "gatepostName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultEntryMode != null">
- and
- <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
- "resultEntryMode" 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="resultEntryGateTime != null">
- and
- <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
- "resultEntryGateTime" 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="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderByEnterTime"></include>
- </select>
- <!-- 查询内转国产矿进口矿 进厂实绩 -->
- <select id="getImportedDomesticNzLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select TER.RESULT_ID "resultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RG.GATEPOST_NAME "gatepostName",
- TER.RESULT_ENTRY_MODE "resultEntryMode",
- TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
- RS.SUPPLIER_NAME "supplierName",
- OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
- TER.INSERT_TIME "insertTime",
- RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
- from TMSTRUCK_ENFACTORY_RESULT TER
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on TTR.ORDER_ID = OO.ORDER_ID
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
- left join DIL_BATCH DB
- on DB.BATCH_ID = APO.BATCH_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_SUPPLIER RS
- on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
- left join RMS_CONSIGNEE RCON
- on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_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_GATEPOST RG
- on RG.GATEPOST_ID = TER.GATEPOST_ID
- where TER.RESULT_ENTRY_GATE_TIME is not null
- and OO.ORDER_TYPE = 9
- )
- <where>
- <if test="purchaseOrderId != null">
- <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
- "purchaseOrderId" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" 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="resultEntryMode != null">
- and
- <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
- "resultEntryMode" like '%${item}%'
- </foreach>
- </if>
- <if test="supplierName != null">
- and
- <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
- "supplierName" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialWeight != null">
- and
- <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
- "orderMaterialWeight" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderByEnterTime"></include>
- </select>
- <!-- 查询内转厂内物资进厂实绩 -->
- <select id="getInFactoryMaterialEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select TER.RESULT_ID "resultId",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RG.GATEPOST_NAME "gatepostName",
- TER.RESULT_ENTRY_MODE "resultEntryMode",
- TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
- OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
- RW1.WAREHOUSE_NAME "loadingName",
- RW2.WAREHOUSE_NAME "unloadingName"
- from TMSTRUCK_ENFACTORY_RESULT TER
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- LEFT JOIN TMSTRUCK_LOAD_RESULT TLR
- ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- LEFT JOIN TMSTRUCK_UNLOAD_RESULT TUR
- ON TUR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- LEFT JOIN RMS_WAREHOUSE RW1
- ON RW1.WAREHOUSE_ID = TLR.LOADING_ID
- LEFT JOIN RMS_WAREHOUSE RW2
- ON RW2.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
- left join OMSTRUCK_ORDER OO
- on TTR.ORDER_ID = OO.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_GATEPOST RG
- on RG.GATEPOST_ID = TER.GATEPOST_ID
- where TER.RESULT_ENTRY_GATE_TIME is not null
- and OO.ORDER_TYPE = 11
- )
- <where>
- <if test="materialName != null">
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="loadingName != null">
- and
- <foreach collection="loadingName" item="item" open="(" separator="or" close=")">
- "loadingName" 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="unloadingName != null">
- and
- <foreach collection="unloadingName" item="item" open="(" separator="or" close=")">
- "unloadingName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultEntryMode != null">
- and
- <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
- "resultEntryMode" 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="loadingName != null">
- and
- <foreach collection="loadingName" item="item" open="(" separator="or" close=")">
- "loadingName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultEntryGateTime != null">
- and
- <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
- "resultEntryGateTime" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderByEnterTime"></include>
- </select>
- <select id="getBillOrder" parameterType="java.lang.String" resultType="java.util.Map">
- select
- oo.order_number "orderNumber",
- rc.capacity_number "capacityNumber",
- rce.consignee_company_name "consigeeName",
- rcr.carrier_name "carrierName",
- TO_CHAR(SYSDATE,'YYYY-MM-DD') "billDate"
- from omstruck_order oo
- left join
- rms_capacity rc
- on
- rc.capacity_id = oo.capacity_id
- left join
- ams_sale_order_material asom
- on
- asom.sale_order_material_id = oo.order_plan_id
- left join
- ams_sale_order aso
- on
- aso.sale_order_id = asom.sale_order_id
- left join
- rms_consignee rce
- on
- rce.consignee_id = aso.receive_id
- left join
- ams_dispatch_sale_order adso
- on
- adso.sale_order_material_id = asom.sale_order_material_id
- left join
- rms_carrier rcr
- on
- rcr.carrier_id = adso.carrier_id
- where oo.order_number = #{orderNumber}
- </select>
- <select id="getBillOrderMaterial" parameterType="java.lang.String" resultType="java.util.Map" >
- select
- rm.material_name "materialName",
- rm.material_specification "materialSpe",
- rm.material_model "materialModel",
- oom.order_material_number "materialNumber",
- oom.order_material_weight "materialWeight"
- from omstruck_order oo
- left join
- omstruck_order_material oom
- on
- oom.order_id = oo.order_id
- left join
- rms_material rm
- on
- rm.material_id = oom.order_material_id
- where oo.order_number = #{orderNumber}
- </select>
- <!-- 通过id获取零星物资id-->
- <select id="getSporadicSuppliesEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select TER.RESULT_ID "resultId",
- OO.ORDER_ID "orderId",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RG.GATEPOST_NAME "gatepostName",
- TER.RESULT_ENTRY_MODE "resultEntryMode",
- TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
- RM.MATERIAL_NAME "materialName",
- OOM.ORDER_MATERIAL_NUMBER "materialNumber",
- OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
- TWR.RESULT_NET_WEIGHT "netWeight"
- from TMSTRUCK_ENFACTORY_RESULT TER
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join TMSTRUCK_WEIGHT_RESULT TWR
- on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on TTR.ORDER_ID = OO.ORDER_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM
- ON OOM.ORDER_ID=OO.ORDER_ID
- left join RMS_MATERIAL RM
- ON RM.MATERIAL_ID=OOM.MATERIAL_ID
- left join AMSTRUCK_SPORADIC_ORDER ASO
- on OO.ORDER_PLAN_ID = ASO.SPORADIC_ORDER_ID
- left join AMSTRUCK_SPORADIC_MATERIAL ASM
- on ASM.SPORADIC_ORDER_ID=ASO.SPORADIC_ORDER_ID
- left join RMS_GATEPOST RG
- on RG.GATEPOST_ID = TER.GATEPOST_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- WHERE OO.ORDER_TYPE = #{orderTypee} and TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
- `<if test="userId">
- and ASO.INSERT_USERNAME=#{userId}
- </if>`
- <if test="userIds">
- and ASO.UPDATE_USERNAME=#{userIds}
- </if>
- )
- <where>
- <if test="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="gatepostName != null">
- and
- <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="gatepostName != null">
- and
- <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
- "resultEntryMode" like '%${item}%'
- </foreach>
- </if>
- <if test="resultEntryGateTime != null">
- and
- <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
- "resultEntryGateTime" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderByEnterTime"></include>
- </select>
- <select id="getCGNZEnFactory" resultType="java.util.Map" parameterType="map">
- select
- *
- from(
- select TER.RESULT_ID "resultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RG.GATEPOST_NAME "gatepostName",
- TER.RESULT_ENTRY_MODE "resultEntryMode",
- to_char(TER.RESULT_ENTRY_GATE_TIME, 'yyyy-mm-dd hh:mm:ss') "resultEntryGateTime",
- RS.SUPPLIER_NAME "supplierName",
- TER.INSERT_TIME "insertTime",
- RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
- from TMSTRUCK_ENFACTORY_RESULT TER
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on TTR.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 DIL_BATCH DB
- on DB.BATCH_ID = APO.BATCH_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_SUPPLIER RS
- on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
- left join RMS_CONSIGNEE RCON
- on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
- 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_GATEPOST RG
- on RG.GATEPOST_ID = TER.GATEPOST_ID
- where TER.RESULT_ENTRY_GATE_TIME is not null
- and OO.ORDER_TYPE = 10
- <if test="userId">
- and air.INSERT_USERNAME=#{userId}
- </if>
- )
- <where>
- <if test="purchaseOrderId != null">
- <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
- "purchaseOrderId" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" 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="resultEntryMode != null">
- and
- <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
- "resultEntryMode" like '%${item}%'
- </foreach>
- </if>
- <if test="supplierName != null">
- and
- <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
- "supplierName" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialWeight != null">
- and
- <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
- "orderMaterialWeight" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderByEnterTime"></include>
- </select>
- <select id="getCgNzOutFactory" resultType="java.util.Map">
- select TLFR.RESULT_ID "resultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RG.GATEPOST_NAME "gatepostName",
- TLFR.RESULT_OUT_MODE "resultOutMode",
- to_char(TLFR.RESULT_OUT_GATE_TIME, 'yyyy-mm-dd hh:mm:ss') "resultOutGateTime",
- TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
- from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on OO.ORDER_ID = TTR.ORDER_ID
- left join amstruck_inward_plan aip
- on aip.plan_id = oo.order_plan_id
- left join amstruck_requirement_plan arp
- on arp.plan_id = aip.plan_id
- left join amstruck_inward_requirement air
- on air.requirement_id = arp.requirement_id
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = air.PURCHASE_ORDER_ID
- left join DIL_BATCH DB
- on DB.BATCH_ID = APO.BATCH_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OOM.ORDER_ID = OO.ORDER_ID
- left join RMS_MATERIAL RM
- on RM.MATERIAL_ID = OOM.MATERIAL_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_GATEPOST RG
- on RG.GATEPOST_ID = TLFR.GATEPOST_ID
- where RESULT_OUT_GATE_TIME is not null
- and OO.ORDER_TYPE = 10
- <if test="userId !=null">
- and AIR.INSERT_USERNAME = #{userId}
- </if>
- order by tlfr.result_out_gate_time
- <where>
- <if test="capacityNumber != null">
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="gatepostName != null">
- <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
- "gatepostName" like '%${item}%'
- </foreach>
- </if>
- </where>
- </select>
- </mapper>
|