123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659 |
- <?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.WmspInboundResultMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.WmspInboundResult">
- <id column="INBOUND_ID" jdbcType="DECIMAL" property="inboundId" />
- <result column="INBOUND_TYPE" jdbcType="DECIMAL" property="inboundType" />
- <result column="INBOUND_NUMBER" jdbcType="VARCHAR" property="inboundNumber" />
- <result column="INBOUND_DISTRIBUTE_ID" jdbcType="DECIMAL" property="inboundDistributeId" />
- <result column="GRID_ID" jdbcType="DECIMAL" property="gridId" />
- <result column="INBOUND_GROUP_ID" jdbcType="DECIMAL" property="inboundGroupId" />
- <result column="PERSONNEL_WORKSHOPID" jdbcType="DECIMAL" property="personnelWorkshopid" />
- <result column="RESULT_NUMBER" jdbcType="DECIMAL" property="resultNumber" />
- <result column="RESULT_STATUS" jdbcType="DECIMAL" property="resultStatus" />
- <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
- <result column="INBOUND_ISCOMPLETE" jdbcType="DECIMAL" property="inboundIscomplete" />
- <result column="RESULT_DELETED" jdbcType="DECIMAL" property="resultDeleted" />
- <result column="INBOUND_TIME" jdbcType="TIMESTAMP" property="inboundTime" />
- <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="PERSONNEL_TEAM" jdbcType="VARCHAR" property="personnelTeam" />
- <result column="PERSONNEL_SHIFTS" jdbcType="VARCHAR" property="personnelShifts" />
- </resultMap>
- <sql id="columns">
- INBOUND_ID, INBOUND_TYPE, INBOUND_NUMBER,INBOUND_DISTRIBUTE_ID, GRID_ID,INBOUND_GROUP_ID,PERSONNEL_WORKSHOPID,RESULT_NUMBER, RESULT_STATUS, MATERIAL_ID, INBOUND_ISCOMPLETE,
- RESULT_DELETED, INBOUND_TIME, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
- INSERT_UPDATE_REMARK, PERSONNEL_TEAM,, PERSONNEL_SHIFTS
- </sql>
- <sql id="columns_alias">
- t.INBOUND_ID, t.INBOUND_TYPE, t.INBOUND_NUMBER,t.INBOUND_DISTRIBUTE_ID, t.GRID_ID,INBOUND_GROUP_ID,t.PERSONNEL_WORKSHOPID,t.RESULT_NUMBER, t.RESULT_STATUS, t.MATERIAL_ID,
- t.INBOUND_ISCOMPLETE, t.RESULT_DELETED, t.INBOUND_TIME, t.INSERT_USERNAME, t.INSERT_TIME,
- t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.PERSONNEL_TEAM, ,
- t.PERSONNEL_SHIFTS
- </sql>
- <sql id="select">
- SELECT <include refid="columns" /> FROM WMSP_INBOUND_RESULT
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias" /> FROM WMSP_INBOUND_RESULT t
- </sql>
- <sql id="where">
- <where>
- <if test="inboundId != null">
- and INBOUND_ID = #{inboundId}
- </if>
- <if test="inboundType != null">
- and INBOUND_TYPE = #{inboundType}
- </if>
- <if test="inboundNumber != null and inboundNumber != ''">
- and INBOUND_NUMBER = #{inboundNumber}
- </if>
-
- <if test="inboundDistributeId != null and inboundDistributeId != ''">
- and INBOUND_DISTRIBUTE_ID = #{inboundDistributeId}
- </if>
-
- <if test="gridId != null">
- and GRID_ID = #{gridId}
- </if>
-
- <if test="inboundGroupId != null">
- and INBOUND_GROUP_ID = #{inboundGroupId}
- </if>
-
- <if test="personnelWorkshopid != null">
- and PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
- </if>
- <if test="resultNumber != null">
- and RESULT_NUMBER = #{resultNumber}
- </if>
- <if test="resultStatus != null">
- and RESULT_STATUS = #{resultStatus}
- </if>
- <if test="materialId != null">
- and MATERIAL_ID = #{materialId}
- </if>
- <if test="inboundIscomplete != null">
- and INBOUND_ISCOMPLETE = #{inboundIscomplete}
- </if>
- <if test="resultDeleted != null">
- and RESULT_DELETED = #{resultDeleted}
- </if>
- <if test="inboundTime != null">
- and TO_CHAR(INBOUND_TIME,'yyyy-MM-dd') = #{inboundTime}
- </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="personnelTeam != null and personnelTeam != ''">
- and PERSONNEL_TEAM = #{personnelTeam}
- </if>
- <if test="personnelShifts != null and personnelShifts != ''">
- and PERSONNEL_SHIFTS = #{personnelShifts}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="inboundId != null">
- and INBOUND_ID = #{inboundId}
- </if>
- <if test="inboundType != null">
- and INBOUND_TYPE = #{inboundType}
- </if>
-
- <if test="inboundNumber != null and inboundNumber != ''">
- and INBOUND_NUMBER LIKE '%${inboundNumber}%'
- </if>
- <if test="inboundDistributeId != null and inboundDistributeId != ''">
- and INBOUND_DISTRIBUTE_ID LIKE '%${inboundDistributeId}%'
- </if>
- <if test="gridId != null">
- and GRID_ID = #{gridId}
- </if>
- <if test="inboundGroupId != null">
- and INBOUND_GROUP_ID = #{inboundGroupId}
- </if>
-
- <if test="personnelWorkshopid != null">
- and PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
- </if>
- <if test="resultNumber != null">
- and RESULT_NUMBER = #{resultNumber}
- </if>
- <if test="resultStatus != null">
- and RESULT_STATUS = #{resultStatus}
- </if>
- <if test="materialId != null">
- and MATERIAL_ID = #{materialId}
- </if>
- <if test="inboundIscomplete != null">
- and INBOUND_ISCOMPLETE = #{inboundIscomplete}
- </if>
- <if test="resultDeleted != null">
- and RESULT_DELETED = #{resultDeleted}
- </if>
- <if test="inboundTime != null">
- and TO_CHAR(INBOUND_TIME,'yyyy-MM-dd') = #{inboundTime}
- </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="personnelTeam != null and personnelTeam != ''">
- and PERSONNEL_TEAM LIKE '%${personnelTeam}%'
- </if>
- <if test="personnelShifts != null and personnelShifts != ''">
- and PERSONNEL_SHIFTS LIKE '%${personnelShifts}%'
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
- delete from WMSP_INBOUND_RESULT
- where INBOUND_ID = #{inboundId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from WMSP_INBOUND_RESULT
- where 1!=1
- <if test="inboundType != null">
- or INBOUND_TYPE = #{inboundType}
- </if>
-
- <if test="inboundNumber != null and inboundNumber != ''">
- or INBOUND_NUMBER = #{inboundNumber}
- </if>
- <if test="inboundDistributeId != null and inboundDistributeId != ''">
- or INBOUND_DISTRIBUTE_ID = #{inboundDistributeId}
- </if>
-
- <if test="gridId != null">
- or GRID_ID = #{gridId}
- </if>
-
- <if test="inboundGroupId != null">
- or INBOUND_GROUP_ID = #{inboundGroupId}
- </if>
-
- <if test="personnelWorkshopid != null">
- or PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
- </if>
- <if test="resultNumber != null">
- or RESULT_NUMBER = #{resultNumber}
- </if>
- <if test="resultStatus != null">
- or RESULT_STATUS = #{resultStatus}
- </if>
- <if test="materialId != null">
- or MATERIAL_ID = #{materialId}
- </if>
- <if test="inboundIscomplete != null">
- or INBOUND_ISCOMPLETE = #{inboundIscomplete}
- </if>
- <if test="resultDeleted != null">
- or RESULT_DELETED = #{resultDeleted}
- </if>
- <if test="inboundTime != null">
- or TO_CHAR(INBOUND_TIME,'yyyy-MM-dd') = '#{inboundTime}'
- </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="personnelTeam != null and personnelTeam != ''">
- or PERSONNEL_TEAM = #{personnelTeam}
- </if>
- <if test="personnelShifts != null and personnelShifts != ''">
- or PERSONNEL_SHIFTS = #{personnelShifts}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.WmspInboundResult">
- insert into WMSP_INBOUND_RESULT (INBOUND_ID, INBOUND_TYPE, INBOUND_NUMBER, INBOUND_DISTRIBUTE_ID,
- GRID_ID,INBOUND_GROUP_ID, PERSONNEL_WORKSHOPID,RESULT_NUMBER,RESULT_STATUS, MATERIAL_ID,
- INBOUND_ISCOMPLETE, RESULT_DELETED, INBOUND_TIME,
- INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK, PERSONNEL_TEAM,
- PERSONNEL_SHIFTS)
- values (#{inboundId,jdbcType=DECIMAL}, #{inboundType,jdbcType=DECIMAL}, #{inboundNumber,jdbcType=VARCHAR},#{inboundDistributeId,jdbcType=DECIMAL},
- #{gridId,jdbcType=DECIMAL},#{inboundGroupId,jdbcType=DECIMAL},#{personnelWorkshopid,jdbcType=DECIMAL},#{resultNumber,jdbcType=DECIMAL}, #{resultStatus,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL},
- #{inboundIscomplete,jdbcType=DECIMAL}, #{resultDeleted,jdbcType=DECIMAL}, #{inboundTime,jdbcType=TIMESTAMP},
- #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
- #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{personnelTeam,jdbcType=VARCHAR},
- #{personnelShifts,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.WmspInboundResult">
- insert into WMSP_INBOUND_RESULT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="inboundId != null">
- INBOUND_ID,
- </if>
- <if test="inboundType != null">
- INBOUND_TYPE,
- </if>
- <if test="inboundNumber != null">
- INBOUND_NUMBER,
- </if>
- <if test="inboundDistributeId != null">
- INBOUND_DISTRIBUTE_ID,
- </if>
-
- <if test="gridId != null">
- GRID_ID,
- </if>
-
- <if test="inboundGroupId != null">
- INBOUND_GROUP_ID,
- </if>
- <if test="personnelWorkshopid != null">
- PERSONNEL_WORKSHOPID,
- </if>
- <if test="resultNumber != null">
- RESULT_NUMBER,
- </if>
-
- <if test="resultStatus != null">
- RESULT_STATUS,
- </if>
- <if test="materialId != null">
- MATERIAL_ID,
- </if>
- <if test="inboundIscomplete != null">
- INBOUND_ISCOMPLETE,
- </if>
- <if test="resultDeleted != null">
- RESULT_DELETED,
- </if>
- <if test="inboundTime != null">
- INBOUND_TIME,
- </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="personnelTeam != null">
- PERSONNEL_TEAM,
- </if>
- <if test="personnelShifts != null">
- PERSONNEL_SHIFTS,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="inboundId != null">
- #{inboundId,jdbcType=DECIMAL},
- </if>
- <if test="inboundType != null">
- #{inboundType,jdbcType=DECIMAL},
- </if>
- <if test="inboundNumber != null">
- #{inboundNumber,jdbcType=VARCHAR},
- </if>
- <if test="inboundDistributeId != null">
- #{inboundDistributeId,jdbcType=VARCHAR},
- </if>
-
- <if test="gridId != null">
- #{gridId,jdbcType=DECIMAL},
- </if>
-
- <if test="inboundGroupId != null">
- #{inboundGroupId,jdbcType=DECIMAL},
- </if>
- <if test="personnelWorkshopid != null">
- #{personnelWorkshopid,jdbcType=DECIMAL},
- </if>
- <if test="resultNumber != null">
- #{resultNumber,jdbcType=DECIMAL},
- </if>
-
- <if test="resultStatus != null">
- #{resultStatus,jdbcType=DECIMAL},
- </if>
- <if test="materialId != null">
- #{materialId,jdbcType=DECIMAL},
- </if>
- <if test="inboundIscomplete != null">
- #{inboundIscomplete,jdbcType=DECIMAL},
- </if>
- <if test="resultDeleted != null">
- #{resultDeleted,jdbcType=DECIMAL},
- </if>
- <if test="inboundTime != null">
- #{inboundTime,jdbcType=TIMESTAMP},
- </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="personnelTeam != null">
- #{personnelTeam,jdbcType=VARCHAR},
- </if>
- <if test="personnelShifts != null">
- #{personnelShifts,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.WmspInboundResult">
- update WMSP_INBOUND_RESULT
- set INBOUND_TYPE = #{inboundType,jdbcType=DECIMAL},
- INBOUND_NUMBER = #{inboundNumber,jdbcType=VARCHAR},
- INBOUND_DISTRIBUTE_ID = #{inboundDistributeId,jdbcType=DECIMAL},
- GRID_ID = #{gridId,jdbcType=DECIMAL},
- PERSONNEL_WORKSHOPID = #{personnelWorkshopid,jdbcType=DECIMAL},
- RESULT_NUMBER = #{resultNumber,jdbcType=DECIMAL},
- INBOUND_GROUP_ID = #{inboundGroupId,jdbcType=DECIMAL},
- RESULT_STATUS = #{resultStatus,jdbcType=DECIMAL},
- MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
- INBOUND_ISCOMPLETE = #{inboundIscomplete,jdbcType=DECIMAL},
- RESULT_DELETED = #{resultDeleted,jdbcType=DECIMAL},
- INBOUND_TIME = #{inboundTime,jdbcType=TIMESTAMP},
- 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},
- PERSONNEL_TEAM = #{personnelTeam,jdbcType=VARCHAR},
-
- PERSONNEL_SHIFTS = #{personnelShifts,jdbcType=VARCHAR}
- where INBOUND_ID = #{inboundId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.WmspInboundResult">
- update WMSP_INBOUND_RESULT
- <set>
- <if test="inboundType != null">
- INBOUND_TYPE = #{inboundType,jdbcType=DECIMAL},
- </if>
- <if test="inboundNumber != null">
- INBOUND_NUMBER = #{inboundNumber,jdbcType=VARCHAR},
- </if>
- <if test="inboundDistributeId != null">
- INBOUND_DISTRIBUTE_ID = #{inboundDistributeId,jdbcType=DECIMAL},
- </if>
-
- <if test="gridId != null">
- GRID_ID = #{gridId,jdbcType=DECIMAL},
- </if>
-
- <if test="inboundGroupId != null">
- INBOUND_GROUP_ID = #{inboundGroupId,jdbcType=DECIMAL},
- </if>
- <if test="personnelWorkshopid != null">
- PERSONNEL_WORKSHOPID = #{personnelWorkshopid,jdbcType=DECIMAL},
- </if>
- <if test="resultNumber != null">
- RESULT_NUMBER = #{resultNumber,jdbcType=DECIMAL},
- </if>
- <if test="resultStatus != null">
- RESULT_STATUS = #{resultStatus,jdbcType=DECIMAL},
- </if>
- <if test="materialId != null">
- MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
- </if>
- <if test="inboundIscomplete != null">
- INBOUND_ISCOMPLETE = #{inboundIscomplete,jdbcType=DECIMAL},
- </if>
- <if test="resultDeleted != null">
- RESULT_DELETED = #{resultDeleted,jdbcType=DECIMAL},
- </if>
- <if test="inboundTime != null">
- INBOUND_TIME = #{inboundTime,jdbcType=TIMESTAMP},
- </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="personnelTeam != null">
- PERSONNEL_TEAM = #{personnelTeam,jdbcType=VARCHAR},
- </if>
-
- <if test="personnelShifts != null">
- PERSONNEL_SHIFTS = #{personnelShifts,jdbcType=VARCHAR},
- </if>
- </set>
- where INBOUND_ID = #{inboundId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
- <include refid="select" />
- where INBOUND_ID = #{inboundId,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 WMSP_INBOUND_RESULT
- (INBOUND_ID,
- INBOUND_TYPE, INBOUND_NUMBER, GRID_ID,INBOUND_GROUP_ID,PERSONNEL_WORKSHOPID,RESULT_NUMBER,INBOUND_DISTRIBUTE_ID,
- RESULT_STATUS, MATERIAL_ID, INBOUND_ISCOMPLETE,
- RESULT_DELETED, INBOUND_TIME,
- INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME,
- INSERT_UPDATE_REMARK, PERSONNEL_TEAM,
- PERSONNEL_SHIFTS
- )
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.inboundId,jdbcType=DECIMAL},
- #{item.inboundType,jdbcType=DECIMAL}, #{item.inboundNumber,jdbcType=VARCHAR}, #{item.inboundGroupId,jdbcType=DECIMAL}, #{item.gridId,jdbcType=DECIMAL}, #{item.personnelWorkshopid,jdbcType=DECIMAL}, #{item.resultNumber,jdbcType=DECIMAL}, #{item.inboundDistributeId,jdbcType=DECIMAL},
- #{item.resultStatus,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL}, #{item.inboundIscomplete,jdbcType=DECIMAL},
- #{item.resultDeleted,jdbcType=DECIMAL}, #{item.inboundTime,jdbcType=TIMESTAMP},
- #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
- #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
- #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.personnelTeam,jdbcType=VARCHAR},
- #{item.personnelShifts,jdbcType=VARCHAR}
- from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update WMSP_INBOUND_RESULT
- set
- INBOUND_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundId,jdbcType=DECIMAL}
- </foreach>
- ,INBOUND_TYPE=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundType,jdbcType=DECIMAL}
- </foreach>
- ,INBOUND_NUMBER=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundNumber,jdbcType=VARCHAR}
- </foreach>
- ,INBOUND_DISTRIBUTE_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundDistributeId,jdbcType=VARCHAR}
- </foreach>
- ,GRID_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.gridId,jdbcType=DECIMAL}
- </foreach>
-
- ,INBOUND_GROUP_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundGroupId,jdbcType=DECIMAL}
- </foreach>
- ,PERSONNEL_WORKSHOPID=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.personnelWorkshopid,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_NUMBER=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.resultNumber,jdbcType=DECIMAL}
- </foreach>
-
- ,RESULT_STATUS=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.resultStatus,jdbcType=DECIMAL}
- </foreach>
- ,MATERIAL_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
- </foreach>
- ,INBOUND_ISCOMPLETE=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundIscomplete,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_DELETED=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.resultDeleted,jdbcType=DECIMAL}
- </foreach>
- ,INBOUND_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.inboundTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- ,PERSONNEL_TEAM=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.personnelTeam,jdbcType=VARCHAR}
- </foreach>
- ,PERSONNEL_SHIFTS=
- <foreach close="end" collection="list" index="index" item="item" open="case INBOUND_ID" separator=" ">
- when #{item.inboundId,jdbcType=DECIMAL} then #{item.personnelShifts,jdbcType=VARCHAR}
- </foreach>
- where INBOUND_ID in
- <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
- #{item.inboundId,jdbcType=DECIMAL}
- </foreach>
- </update>
-
- <delete id="batchDelete" parameterType="java.util.List">
- delete from WMSP_INBOUND_RESULT
- where INBOUND_ID in
- <foreach close=")" collection="list" item="id" open="(" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <select id="selectWmsInboundResult" resultType="java.util.LinkedHashMap">
- select * from (
- SELECT
- wir.INBOUND_ID "inboundId",
- RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || '(' ||
- RM.MATERIAL_MODEL || ')' "materialName",
- wir.INBOUND_NUMBER "inboundNo",
- wir.INBOUND_TIME "inboundTime",
- wir.INBOUND_ISCOMPLETE "isComplete",
- RW.WAREHOUSE_NAME "warehouseName",
- RS.STACKING_NO "stackingNo",
- RPG.GRID_GRADATION_NUMBER "gridGradationNumber",
- -- 关联炉号
- rms.MATERIAL_FURNACE_NUMBER "furnaceNumber",
- -- 关联物资实际重量
- rms.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight"
- FROM wmsp_inbound_result wir
- LEFT JOIN WMSP_GRID_MATERIAL wgm
- ON wgm.MATERIAL_ID = wir.MATERIAL_ID
- LEFT JOIN RMS_MATERIAL_STEEL rms
- ON rms.MATERIAL_STEEL_ID = wir.MATERIAL_ID
- LEFT JOIN RMS_MATERIAL rm
- ON rm.MATERIAL_ID = rms.MATERIAL_ID
- LEFT JOIN RMS_PWAREHOUSE_GRID rpg
- ON RPG.GRID_ID = wir.GRID_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = rpg.WAREHOUSE_ID
- LEFT JOIN RMS_STACKING RS
- ON RS.STACKING_ID = RPG.STACKING_ID
- WHERE
- wir.inbound_type = 0
- AND wir.result_deleted = 0
- AND wir.INBOUND_ISCOMPLETE != 2
- AND rpg.WAREHOUSE_ID = #{warehouseId}
- AND wgm.UPDATE_TIME IS NULL
- <if test="oneDate != null">
- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= wir.inbound_time
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= wir.inbound_time
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= wir.inbound_time
- </if>
- ORDER BY wir.inbound_time DESC
- )
- <where>
- <if test="INBOUND_NUMBER != null">
- and "INBOUND_NUMBER" in
- <foreach collection="INBOUND_NUMBER" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="WAREHOUSE_NAME != null">
- and "WAREHOUSE_NAME" in
- <foreach collection="WAREHOUSE_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="STACKING_NO != null">
- and "STACKING_NO" in
- <foreach collection="STACKING_NO" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="GRID_GRADATION_NUMBER != null">
- and "GRID_GRADATION_NUMBER" in
- <foreach collection="GRID_GRADATION_NUMBER" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="FURNACE_NUMBER != null">
- and "FURNACE_NUMBER" in
- <foreach collection="FURNACE_NUMBER" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="MATERIAL_CODE != null">
- and "MATERIAL_CODE" in
- <foreach collection="MATERIAL_CODE" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="MATERIAL_NAME != null">
- and "MATERIAL_NAME" in
- <foreach collection="MATERIAL_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="THEORETICAL_WEIGHT != null">
- and "THEORETICAL_WEIGHT" in
- <foreach collection="THEORETICAL_WEIGHT" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="BUNDLE_WEIGHT != null">
- and "BUNDLE_WEIGHT" in
- <foreach collection="BUNDLE_WEIGHT" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="MEASURE_NAME != null">
- and "MEASURE_NAME" in
- <foreach collection="MEASURE_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="PRODUCTION_DATE != null">
- and "PRODUCTION_DATE" in
- <foreach collection="PRODUCTION_DATE" item="item" open="(" separator="," close=")">
- to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="APERSONNEL_NAME != null">
- and "APERSONNEL_NAME" in
- <foreach collection="APERSONNEL_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="BPERSONNEL_NAME != null">
- and "BPERSONNEL_NAME" in
- <foreach collection="BPERSONNEL_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="DPERSONNEL_NAME != null">
- and "DPERSONNEL_NAME" in
- <foreach collection="DPERSONNEL_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="SHIPPER_BRANCH_FACTORY != null">
- and "SHIPPER_BRANCH_FACTORY" in
- <foreach collection="SHIPPER_BRANCH_FACTORY" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="PERSONNEL_WORKSHOP != null">
- and "PERSONNEL_WORKSHOP" in
- <foreach collection="PERSONNEL_WORKSHOP" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="INBOUND_TIME != null">
- and "INBOUND_TIME" in
- <foreach collection="INBOUND_TIME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <select id="selectWmsInboundResults" resultType="java.util.LinkedHashMap">
- select * from(
- SELECT
- wir.INBOUND_ID "inboundId",
- RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || '(' ||
- RM.MATERIAL_MODEL || ')' "materialName",
- wir.INBOUND_NUMBER "inboundNo",
- wir.INBOUND_TIME "inboundTime",
- wir.INBOUND_ISCOMPLETE "isComplete",
- RW.WAREHOUSE_NAME "warehouseName",
- RS.STACKING_NO "stackingNo",
- RPG.GRID_GRADATION_NUMBER "gridGradationNumber",
- -- 关联炉号
- rms.MATERIAL_FURNACE_NUMBER "furnaceNumber",
- -- 关联物资实际重量
- rms.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight"
- FROM wmsp_inbound_result wir
- LEFT JOIN WMSP_GRID_MATERIAL wgm
- ON wgm.MATERIAL_ID = wir.MATERIAL_ID
- LEFT JOIN RMS_MATERIAL_STEEL rms
- ON rms.MATERIAL_STEEL_ID = wir.MATERIAL_ID
- LEFT JOIN RMS_MATERIAL rm
- ON rm.MATERIAL_ID = rms.MATERIAL_ID
- LEFT JOIN RMS_PWAREHOUSE_GRID rpg
- ON RPG.GRID_ID = wir.GRID_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = rpg.WAREHOUSE_ID
- LEFT JOIN RMS_STACKING RS
- ON RS.STACKING_ID = RPG.STACKING_ID
- WHERE
- wir.inbound_type = 0
- AND wir.result_deleted = 0
- AND wir.INBOUND_ISCOMPLETE != 2
- AND rpg.WAREHOUSE_ID = #{warehouseId}
- <if test="oneDate != null">
- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= wir.inbound_time
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= wir.inbound_time
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= wir.inbound_time
- </if>
- ORDER BY wir.inbound_time DESC
- )
- <where>
- <if test="INBOUND_NUMBER != null">
- and "INBOUND_NUMBER" in
- <foreach collection="INBOUND_NUMBER" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="WAREHOUSE_NAME != null">
- and "WAREHOUSE_NAME" in
- <foreach collection="WAREHOUSE_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="STACKING_NO != null">
- and "STACKING_NO" in
- <foreach collection="STACKING_NO" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="GRID_GRADATION_NUMBER != null">
- and "GRID_GRADATION_NUMBER" in
- <foreach collection="GRID_GRADATION_NUMBER" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="FURNACE_NUMBER != null">
- and "FURNACE_NUMBER" in
- <foreach collection="FURNACE_NUMBER" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="MATERIAL_CODE != null">
- and "MATERIAL_CODE" in
- <foreach collection="MATERIAL_CODE" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="MATERIAL_NAME != null">
- and "MATERIAL_NAME" in
- <foreach collection="MATERIAL_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="THEORETICAL_WEIGHT != null">
- and "THEORETICAL_WEIGHT" in
- <foreach collection="THEORETICAL_WEIGHT" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="BUNDLE_WEIGHT != null">
- and "BUNDLE_WEIGHT" in
- <foreach collection="BUNDLE_WEIGHT" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="MEASURE_NAME != null">
- and "MEASURE_NAME" in
- <foreach collection="MEASURE_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="PRODUCTION_DATE != null">
- and "PRODUCTION_DATE" in
- <foreach collection="PRODUCTION_DATE" item="item" open="(" separator="," close=")">
- to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="APERSONNEL_NAME != null">
- and "APERSONNEL_NAME" in
- <foreach collection="APERSONNEL_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="BPERSONNEL_NAME != null">
- and "BPERSONNEL_NAME" in
- <foreach collection="BPERSONNEL_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="DPERSONNEL_NAME != null">
- and "DPERSONNEL_NAME" in
- <foreach collection="DPERSONNEL_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="SHIPPER_BRANCH_FACTORY != null">
- and "SHIPPER_BRANCH_FACTORY" in
- <foreach collection="SHIPPER_BRANCH_FACTORY" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="PERSONNEL_WORKSHOP != null">
- and "PERSONNEL_WORKSHOP" in
- <foreach collection="PERSONNEL_WORKSHOP" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="INBOUND_TIME != null">
- and "INBOUND_TIME" in
- <foreach collection="INBOUND_TIME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <select id="selectWmsReservedResult" resultType="java.util.LinkedHashMap">
- select * from (
- select
- wir.INBOUND_ID "inboundId",
- RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || '(' ||
- RM.MATERIAL_MODEL || ')' "materialName",
- wir.inbound_number "inboundNo",
- wir.inbound_time "inboundTime",
- wir.inbound_iscomplete "isComplete",
- RW.WAREHOUSE_NAME "warehouseName",
- RS.STACKING_NO "stackingNo",
- RPG.GRID_GRADATION_NUMBER "gridGradationNumber",
- -- 关联炉号
- rms.MATERIAL_FURNACE_NUMBER "furnaceNumber",
- -- 关联物资实际重量
- rms.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight"
- from wmsp_inbound_result wir
- LEFT JOIN RMS_MATERIAL_STEEL rms
- ON rms.MATERIAL_STEEL_ID = wir.MATERIAL_ID
- -- 关联实时库存
- LEFT JOIN WMSP_GRID_MATERIAL wgm
- ON wgm.MATERIAL_ID = wir.MATERIAL_ID
- LEFT JOIN RMS_MATERIAL rm
- ON rm.MATERIAL_ID = rms.MATERIAL_ID
- LEFT JOIN RMS_PWAREHOUSE_GRID rpg
- ON RPG.GRID_ID = wir.GRID_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = rpg.WAREHOUSE_ID
- LEFT JOIN RMS_STACKING RS
- ON RS.STACKING_ID = RPG.STACKING_ID
- where wir.inbound_type = 0
- and wir.result_deleted = 0
- and wir.INBOUND_ISCOMPLETE = 2
- and wgm.UPDATE_TIME is null
- and rpg.WAREHOUSE_ID = #{warehouseId}
- order by wir.inbound_time desc
- )
- <where>
- <if test="INBOUND_NUMBER != null">
- and "INBOUND_NUMBER" in
- <foreach collection="INBOUND_NUMBER" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="WAREHOUSE_NAME != null">
- and "WAREHOUSE_NAME" in
- <foreach collection="WAREHOUSE_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="STACKING_NO != null">
- and "STACKING_NO" in
- <foreach collection="STACKING_NO" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="GRID_GRADATION_NUMBER != null">
- and "GRID_GRADATION_NUMBER" in
- <foreach collection="GRID_GRADATION_NUMBER" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="FURNACE_NUMBER != null">
- and "FURNACE_NUMBER" in
- <foreach collection="FURNACE_NUMBER" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="MATERIAL_CODE != null">
- and "MATERIAL_CODE" in
- <foreach collection="MATERIAL_CODE" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="MATERIAL_NAME != null">
- and "MATERIAL_NAME" in
- <foreach collection="MATERIAL_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="THEORETICAL_WEIGHT != null">
- and "THEORETICAL_WEIGHT" in
- <foreach collection="THEORETICAL_WEIGHT" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="BUNDLE_WEIGHT != null">
- and "BUNDLE_WEIGHT" in
- <foreach collection="BUNDLE_WEIGHT" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="MEASURE_NAME != null">
- and "MEASURE_NAME" in
- <foreach collection="MEASURE_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="PRODUCTION_DATE != null">
- and "PRODUCTION_DATE" in
- <foreach collection="PRODUCTION_DATE" item="item" open="(" separator="," close=")">
- to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="APERSONNEL_NAME != null">
- and "APERSONNEL_NAME" in
- <foreach collection="APERSONNEL_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="BPERSONNEL_NAME != null">
- and "BPERSONNEL_NAME" in
- <foreach collection="BPERSONNEL_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="DPERSONNEL_NAME != null">
- and "DPERSONNEL_NAME" in
- <foreach collection="DPERSONNEL_NAME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="SHIPPER_BRANCH_FACTORY != null">
- and "SHIPPER_BRANCH_FACTORY" in
- <foreach collection="SHIPPER_BRANCH_FACTORY" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="PERSONNEL_WORKSHOP != null">
- and "PERSONNEL_WORKSHOP" in
- <foreach collection="PERSONNEL_WORKSHOP" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="INBOUND_TIME != null">
- and "INBOUND_TIME" in
- <foreach collection="INBOUND_TIME" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <sql id="orderBy">
- <if test="orderField != null and orderField != ''">
- order by "${orderField}"
- <if test="orderType != null and orderType != ''">
- ${orderType}
- </if>
- </if>
- </sql>
- <!-- <select id="getCount" resultType="java.math.BigDecimal">-->
- <!-- select MAX(INBOUND_ID) from wmsp_inbound_result-->
- <!-- </select>-->
- <select id="selectWmsReboundResult" resultType="java.util.LinkedHashMap">
- select * from (
- select wimr.result_no "result_no",
- rw.warehouse_name "warehouse_name",
- rs.stacking_no "stacking_no",
- rpg.grid_gradation_number "gradation_number",
- rms.material_furnace_number "furnace_number",
- rm.material_name "material_name",
- rm.material_specification || '(' || rm.material_model || ')' "specification",
- rms.material_theoretical_weight "theoretical_weight",
- wmsp.inbound_material_number "MATERIAL_NUMBER",
- rms.material_production_date "production_date",
- rp1.personnel_name "LOADA",
- rp2.personnel_name "LOADD",
- wir.inbound_time "inbound_time"
- from wmsp_inbound_scan_result wmsp
- join rms_material_steel rms
- on rms.material_steel_id = wmsp.material_id
- join wmsp_ivbound_make_material wimm
- on wmsp.material_id = wimm.material_steel_id
- join wmsp_ivbound_make_result wimr
- on wimr.result_id = wimm.result_id
- join rms_material rm
- on rm.material_id = rms.material_id
- join rms_unit_of_measure ruom
- on ruom.unit_of_measure_id = rm.unit_of_measure_id
- join rms_personnel rp1
- on rp1.personnel_id = wmsp.load_id
- join wmsp_inbound_result wir
- on wir.inbound_id = wmsp.inbound_result_id
- join wmsp_inbound_driving_result widr
- on widr.inbound_result_id = wir.inbound_id
- join rms_personnel rp2
- on rp2.personnel_id = widr.driver_id
- join rms_pwarehouse_grid rpg
- on rpg.grid_id = wir.grid_id
- join rms_warehouse rw
- on rw.warehouse_id = rpg.warehouse_id
- join wmsp_inbound_stack_result wisr
- on wisr.inbound_result_id = wir.inbound_id
- join rms_stacking rs
- on rs.stacking_id = wisr.stacking_id
- where rp1.personnel_id = 6
- and wmsp.result_status_ = 1
- and wir.inbound_type = 2
- )
- <where>
- <if test="result_no != null">
- and "result_no" in
- <foreach collection="result_no" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="warehouse_name != null">
- and "warehouse_name" in
- <foreach collection="warehouse_name" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="stacking_no != null">
- and "stacking_no" in
- <foreach collection="stacking_no" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="gradation_number != null">
- and "gradation_number" in
- <foreach collection="gradation_number" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="furnace_number != null">
- and "furnace_number" in
- <foreach collection="furnace_number" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="material_name != null">
- and "material_name" in
- <foreach collection="material_name" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="specification != null">
- and "specification" in
- <foreach collection="specification" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="theoretical_weight != null">
- and "theoretical_weight" in
- <foreach collection="theoretical_weight" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="MATERIAL_NUMBER != null">
- and "MATERIAL_NUMBER" in
- <foreach collection="MATERIAL_NUMBER" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="production_date != null">
- and "production_date" in
- <foreach collection="production_date" item="item" open="(" separator="," close=")">
- to_date('${item}','yyyy-mm-dd')
- </foreach>
- </if>
- <if test="LOADA != null">
- and "LOADA" in
- <foreach collection="LOADA" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="LOADD != null">
- and "LOADD" in
- <foreach collection="LOADD" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="inbound_time != null">
- and "inbound_time" in
- <foreach collection="inbound_time" item="item" open="(" separator="," close=")">
- to_date('${item}','yyyy-mm-dd')
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <select id="selectWmsIvboundResult" resultType="java.util.Map">
- select * from(
- select wimr.result_id "resultId",
- wimr.result_no "result_no",
- rw1.warehouse_name "before_warehouse",
- rw2.warehouse_name "after_warehouse",
- wimr.insert_time "insert_time",
- (select count(*)
- from wmsp_ivbound_make_result wimr
- join rms_warehouse rw1
- on rw1.warehouse_id = wimr.result_before_warehouse_id
- join rms_warehouse rw2
- on rw2.warehouse_id = wimr.result_after_warehouse_id
- join wmsp_ivbound_make_material wimm
- on wimm.result_id = wimr.result_id) "material_number"
- from wmsp_ivbound_make_result wimr
- join rms_warehouse rw1
- on rw1.warehouse_id = wimr.result_before_warehouse_id
- join rms_warehouse rw2
- on rw2.warehouse_id = wimr.result_after_warehouse_id
- join wmsp_ivbound_make_material wimm
- on wimm.result_id = wimr.result_id
- order by wimr.insert_time desc
- )
- <where>
- <if test="result_no != null">
- and "result_no" in
- <foreach collection="result_no" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="before_warehouse != null">
- and "before_warehouse" in
- <foreach collection="before_warehouse" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="after_warehouse != null">
- and "after_warehouse" in
- <foreach collection="after_warehouse" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="insert_time != null">
- and "insert_time" in
- <foreach collection="insert_time" item="item" open="(" separator="," close=")">
- to_date('${item}','yyyy-mm-dd')
- </foreach>
- </if>
- <if test="material_number != null">
- and "material_number" in
- <foreach collection="material_number" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <select id="selectWmsIvboundMaterialResult" resultType="java.util.LinkedHashMap">
- select * from(
- select
- wimr.result_no "result_no",
- rw1.warehouse_name "before_warehouse",
- rw2.warehouse_name "after_warehouse",
- rs1.stacking_no "before_stack",
- wimm.before_gradution_number "before_gradution_number",
- rm.material_code "material_code",
- rm.material_name "material_name",
- rm.material_specification || '(' || rm.material_model || ')' "specification",
- rms.material_furnace_number "furnace_number",
- rms.material_theoretical_weight "theoretical_weight",
- (select count(*) from wmsp_ivbound_make_material wimm
- join
- wmsp_ivbound_make_result wimr
- on
- wimr.result_id=wimm.result_id
- join
- rms_warehouse rw1
- on
- rw1.warehouse_id=wimr.result_before_warehouse_id
- join
- rms_warehouse rw2
- on
- rw2.warehouse_id=wimr.result_after_warehouse_id
- join rms_stacking rs1
- on
- rs1.stacking_id=wimm.before_stacking_id
- join
- rms_material_steel rms
- on
- rms.material_steel_id=wimm.material_steel_id
- join
- rms_material rm
- on
- rm.material_id=rms.material_id
- join
- wmsp_inbound_scan_result wisr
- on
- wisr.material_id=wimm.material_steel_id
- join
- rms_personnel rp2
- on
- rp2.personnel_id=wisr.load_id
- join
- wmsp_inbound_result wir
- on
- wir.inbound_id=wisr.inbound_result_id
- join
- wmsp_inbound_driving_result widr
- on
- widr.inbound_result_id=wir.inbound_id
- join
- rms_personnel rp3
- on
- rp3.personnel_id=widr.driver_id
- join
- rms_pwarehouse_grid rpg
- on
- rpg.grid_id=wir.inbound_id
- where wimm.result_id = #{resultId}) "material_number",
- rms.material_production_date "production_date",
- rp2.personnel_name "LOADA",
- rp3.personnel_name "LOADD",
- wir.inbound_time "inbound_time"
- from wmsp_ivbound_make_material wimm
- join
- wmsp_ivbound_make_result wimr
- on
- wimr.result_id=wimm.result_id
- join
- rms_warehouse rw1
- on
- rw1.warehouse_id=wimr.result_before_warehouse_id
- join
- rms_warehouse rw2
- on
- rw2.warehouse_id=wimr.result_after_warehouse_id
- join rms_stacking rs1
- on
- rs1.stacking_id=wimm.before_stacking_id
- join
- rms_material_steel rms
- on
- rms.material_steel_id=wimm.material_steel_id
- join
- rms_material rm
- on
- rm.material_id=rms.material_id
- join
- wmsp_inbound_scan_result wisr
- on
- wisr.material_id=wimm.material_steel_id
- join
- rms_personnel rp2
- on
- rp2.personnel_id=wisr.load_id
- join
- wmsp_inbound_result wir
- on
- wir.inbound_id=wisr.inbound_result_id
- join
- wmsp_inbound_driving_result widr
- on
- widr.inbound_result_id=wir.inbound_id
- join
- rms_personnel rp3
- on
- rp3.personnel_id=widr.driver_id
- join
- rms_pwarehouse_grid rpg
- on
- rpg.grid_id=wir.inbound_id
- where wimm.result_id = #{resultId}
- order by
- wir.inbound_time desc
- )
- <where>
- <if test="result_no != null">
- and "result_no" in
- <foreach collection="result_no" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="before_warehouse != null">
- and "before_warehouse" in
- <foreach collection="before_warehouse" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="after_warehouse != null">
- and "after_warehouse" in
- <foreach collection="after_warehouse" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="before_stack != null">
- and "before_stack" in
- <foreach collection="before_stack" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="before_gradution_number != null">
- and "before_gradution_number" in
- <foreach collection="before_gradution_number" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="material_code != null">
- and "material_code" in
- <foreach collection="material_code" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="material_name != null">
- and "material_name" in
- <foreach collection="material_name" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="furnace_number != null">
- and "furnace_number" in
- <foreach collection="furnace_number" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="theoretical_weight != null">
- and "theoretical_weight" in
- <foreach collection="theoretical_weight" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="material_number != null">
- and "material_number" in
- <foreach collection="material_number" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="production_date != null">
- and "production_date" in
- <foreach collection="production_date" item="item" open="(" separator="," close=")">
- to_date('${item}','yyyy-mm-dd')
- </foreach>
- </if>
- <if test="LOADA != null">
- and "LOADA" in
- <foreach collection="LOADA" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="LOADD != null">
- and "LOADD" in
- <foreach collection="LOADD" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="inbound_time != null">
- and "inbound_time" in
- <foreach collection="inbound_time" item="item" open="(" separator="," close=")">
- to_date('${item}','yyyy-mm-dd')
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <select id="selectScanResultByIboundResultId" resultType="java.util.LinkedHashMap"
- parameterType="java.util.Map">
- SELECT DISTINCT RP.PERSONNEL_NAME "load",
- WISR.MATERIAL_ID "materialId",
- WISR.RESULT_LOAD_TIME "loadTime",
- RM.material_code "material_code",
- RM.material_name "material_name",
- RM.material_specification || '(' || rm.material_model || ')' "specification",
- RMS.material_furnace_number "furnace_number",
- RMS.material_theoretical_weight "theoretical_weight"
- FROM WMSP_INBOUND_RESULT WIR
- LEFT JOIN WMSP_INBOUND_SCAN_RESULT WISR ON WISR.INBOUND_RESULT_ID = WIR.INBOUND_ID
- LEFT JOIN RMS_MATERIAL_STEEL RMS ON RMS.MATERIAL_STEEL_ID = WISR.MATERIAL_ID
- LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = RMS.MATERIAL_ID
- LEFT JOIN RMS_PERSONNEL RP ON RP.PERSONNEL_ID = WISR.LOAD_ID
- WHERE WIR.INBOUND_ID = #{inboundId,jdbcType=INTEGER}
- AND WIR.RESULT_DELETED = 0
- </select>
- <select id="selectWarehouseName" resultType="java.lang.String">
- select rw.warehouse_name
- from rms_warehouse rw
- where rw.warehouse_id =#{houseId}
- </select>
- <select id="selectInboundResultByGroupId" resultType="Map">
- SELECT * FROM
- (SELECT wid.DISTRIBUTE_ID "distributeId", wid.batch "batch",wir.INSERT_USERNAME "userName", wir.RESULT_STATUS "resultStatus" FROM WMSP_INBOUND_RESULT wir
- LEFT JOIN WMSP_INBOUND_DISTRIBUTE wid
- ON wir.inbound_distribute_id=wid.distribute_id
- WHERE wir.inbound_Group_Id=#{groupId} ORDER BY INBOUND_TIME DESC)
- where rownum=1
- </select>
- <select id="getGrid" resultType="java.math.BigDecimal">
- select "gridId",rownum rm from (select t.grid_Id "gridId" from WMSP_INBOUND_RESULT t where t.inbound_distribute_id=#{distributeId} and t.RESULT_NUMBER=#{resultNumber} ORDER BY inbound_time DESC )
- </select>
- <!-- 根据resultId查询出对应的物资Id-->
- <select id="getResultMaterialByResultId" resultType="java.util.LinkedHashMap">
- SELECT wosr.RESULT_MATERIAL "resultMaterial"
- FROM WMSP_OUTBOUND_SCAN_RESULT wosr
- WHERE wosr.RESULT_CHECK = 0
- AND wosr.OUTBOUND_RESULT_ID = #{resultId}
- </select>
- <select id="getInboundResult" resultType="java.util.LinkedHashMap"
- parameterType="java.util.Map">
- SELECT
- wir.INBOUND_ID "inboundId",
- wgm.GM_ID "gmId"
- FROM WMSP_INBOUND_RESULT wir
- JOIN WMSP_INBOUND_SCAN_RESULT wisr
- ON wisr.INBOUND_RESULT_ID = wir.INBOUND_ID
- JOIN WMSP_GRID_MATERIAL wgm
- ON wgm.GRID_ID = wir.GRID_ID
- WHERE wisr.RESULT_MATERIAL = #{resultMaterial}
- </select>
- <update id="updateInboundStatus">
- update WMSP_INBOUND_RESULT set RESULT_STATUS= 2 where INBOUND_DISTRIBUTE_ID = #{distributeId}
- </update>
- <update id="updateStatusByMaterilaId">
- update WMSP_INBOUND_RESULT set INBOUND_ISCOMPLETE = 1 where MATERIAL_ID=#{materialId}
- </update>
- <!-- and wir.insert_time between sysdate and trunc(sysdate + 1, 'dd')-->
- <update id="updateStatusByMaterialId">
- update wmsp_inbound_result set INBOUND_ISCOMPLETE=2 where inbound_id in
- (
- select * from(
- select inbound_id from WMSP_INBOUND_RESULT wir
- left join rms_material_steel rms
- on wir.material_id = rms.material_steel_id
- left join WMSP_GRID_MATERIAL wgm
- on wgm.MATERIAL_ID = rms.material_steel_id
- where rms.material_id=(
- select distinct rms2.material_id from rms_material_steel rms2
- where material_steel_id =#{materialId}
- ) and INBOUND_ISCOMPLETE='1' and wgm.deleted ='0' and to_char(wir.insert_time,'YYYY-MM-DD')=TO_CHAR(SYSDATE,'YYYY-MM-DD')
- order by wir.insert_time desc
- ) where Rownum='1'
- )
-
- </update>
-
- <select id="getInbountNumber" resultType="java.math.BigDecimal">
- select count(*) from WMSP_INBOUND_RESULT wir
- </select>
- <select id="getTypeMaterilaId" resultType="java.lang.Integer">
- select count(*) from WMSP_INBOUND_RESULT
- where MATERIAL_ID=#{materialId} and INBOUND_ISCOMPLETE='2'
- </select>
- <select id="getWmsInboundResultStatistics" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT DISTINCT
- -- 炉号生产总数量
- table1.count "count",
- -- 炉号生产总重量
- table2.weight "weight",
- -- 炉号生产的第一件钢材时间
- table3.onetime "onetime",
- -- 生产物资型号
- RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || '(' ||
- RM.MATERIAL_MODEL || ')' "materialName",
- -- 炉号
- MATERIAL_FURNACE_NUMBER "furnaceNumber1"
- FROM
- WMSP_INBOUND_RESULT WIR
- LEFT JOIN RMS_MATERIAL_STEEL RMS
- ON RMS.MATERIAL_STEEL_ID = WIR.MATERIAL_ID
- LEFT JOIN RMS_MATERIAL RM
- ON RM.MATERIAL_ID = RMS.MATERIAL_ID
- LEFT JOIN WMSP_GRID_MATERIAL WGM
- ON WGM.MATERIAL_ID = WIR.MATERIAL_ID
- LEFT JOIN RMS_PWAREHOUSE_GRID RPG
- ON RPG.GRID_ID = WGM.GRID_ID
- LEFT JOIN (
- SELECT
- count(MATERIAL_FURNACE_NUMBER) count,
- MATERIAL_FURNACE_NUMBER "furnaceNumber1"
- FROM
- WMSP_INBOUND_RESULT WIR2
- LEFT JOIN RMS_MATERIAL_STEEL RMS2
- ON RMS2.MATERIAL_STEEL_ID = WIR2.MATERIAL_ID
- WHERE RMS2.DELETED IS NULL OR RMS2.DELETED = 0
- <if test="oneDate != null">
- AND to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= WIR2.INBOUND_TIME
- </if>
- <if test="startDate != null">
- AND to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= WIR2.INBOUND_TIME
- AND to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= WIR2.INBOUND_TIME
- </if>
- GROUP BY
- MATERIAL_FURNACE_NUMBER
- ) table1
- ON RMS.MATERIAL_FURNACE_NUMBER = table1."furnaceNumber1"
- LEFT JOIN (
- SELECT
- sum(MATERIAL_THEORETICAL_WEIGHT) weight,
- MATERIAL_FURNACE_NUMBER "furnaceNumber2"
- FROM
- WMSP_INBOUND_RESULT WIR3
- LEFT JOIN RMS_MATERIAL_STEEL RMS3
- ON RMS3.MATERIAL_STEEL_ID = WIR3.MATERIAL_ID
- WHERE RMS3.DELETED IS NULL OR RMS3.DELETED = 0
- <if test="oneDate != null">
- AND to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= WIR3.INBOUND_TIME
- </if>
- <if test="startDate != null">
- AND to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= WIR3.INBOUND_TIME
- AND to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= WIR3.INBOUND_TIME
- </if>
- GROUP BY
- MATERIAL_FURNACE_NUMBER
- ) table2
- ON table1."furnaceNumber1" = table2."furnaceNumber2"
- LEFT JOIN(
- SELECT
- MIN(WIR4.INSERT_TIME) onetime,
- MATERIAL_FURNACE_NUMBER "furnaceNumber3"
- FROM
- WMSP_INBOUND_RESULT WIR4
- LEFT JOIN RMS_MATERIAL_STEEL RMS4
- ON RMS4.MATERIAL_STEEL_ID = WIR4.MATERIAL_ID
- WHERE RMS4.DELETED IS NULL OR RMS4.DELETED = 0
- <if test="oneDate != null">
- AND to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= WIR4.INBOUND_TIME
- </if>
- <if test="startDate != null">
- AND to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= WIR4.INBOUND_TIME
- AND to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= WIR4.INBOUND_TIME
- </if>
- GROUP BY
- MATERIAL_FURNACE_NUMBER
- )table3
- ON table3."furnaceNumber3" = table2."furnaceNumber2"
- WHERE RPG.WAREHOUSE_ID = #{warehouseId}
- <if test="oneDate != null">
- AND to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= WIR.INBOUND_TIME
- </if>
- <if test="startDate != null">
- AND to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= WIR.INBOUND_TIME
- AND to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= WIR.INBOUND_TIME
- </if>
- AND WIR.RESULT_DELETED = 0 ORDER BY table3.onetime ASC
- <include refid="orderBy"></include>
- </select>
- </mapper>
|