123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485 |
- <?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}
- <if test="oneDate != null">
- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
- </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="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
- <if test="oneDate != null">
- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
- </if>
- )
- <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",
- OO.ORDER_ID "orderId",
- OO.LINE_ID "lineId"
- 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",
- 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
- 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
- <if test="oneDate != null">
- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
- </if>
- 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
- <if test="oneDate != null">
- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
- </if>
- )
- <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
- <if test="oneDate != null">
- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
- </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="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
- <if test="oneDate != null">
- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
- </if>
- )
- <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 distinct 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 TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
- <if test="orderTypee != 100">
- AND OO.ORDER_TYPE = #{orderTypee}
- </if>
- <if test="orderTypee == 100">
- AND OO.ORDER_TYPE in (12, 13 ,14,19)
- </if>
- <if test="oneDate != null">
- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
- </if>
- <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 in (10,20)
- <if test="userId">
- and air.INSERT_USERNAME=#{userId}
- </if>
- <if test="oneDate != null">
- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
- </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 in (10,20)
- <if test="userId !=null">
- and AIR.INSERT_USERNAME = #{userId}
- </if>
- <if test="oneDate != null">
- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TLFR.RESULT_OUT_GATE_TIME
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TLFR.RESULT_OUT_GATE_TIME
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
- </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>
- <select id="selectAllEnFactoryNum" parameterType="java.math.BigDecimal" resultType="int">
- select count(TER.RESULT_TOTAL_ID)
- from TMSTRUCK_ENFACTORY_RESULT TER
- where TER.RESULT_TOTAL_ID = #{resultTotalId}
- </select>
- <select id="selectEnFactoryNumber" parameterType="java.math.BigDecimal" resultType="int">
- select count(TER.RESULT_TOTAL_ID)
- from TMSTRUCK_ENFACTORY_RESULT TER
- where TER.RESULT_TOTAL_ID = #{resultTotalId}
- and TER.RESULT_ENTRY_GATE_TIME is null
- </select>
- </mapper>
|