1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405 |
- <?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", --进厂的路段顺序号
- OO.ORDER_LINE_SEQUENCE "orderSegmentSqe",
- 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!=null">
- and ASO.INSERT_USERNAME=#{userId}
- </if>
- <if test="userIds!=null">
- and ASO.UPDATE_USERNAME=#{userIds}
- </if>
- <if test="con!=null">
- where "orderNumber" like #{con} or "capacityNumber" like #{con}
- or "gatepostName" like #{con} or "materialName" like #{con}
- </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",
- TER.RESULT_ENTRY_GATE_TIME "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",
- TLFR.RESULT_OUT_GATE_TIME "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 desc
- <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>
|