123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963 |
- <?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.OyeRealtimeInventoryMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.OyeRealtimeInventory">
- <id column="INVENTORY_ID" jdbcType="DECIMAL" property="inventoryId" />
- <result column="CONSIGNEE_ID" jdbcType="DECIMAL" property="consigneeId" />
- <result column="SALE_AREA" jdbcType="VARCHAR" property="saleArea" />
- <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
- <result column="METER" jdbcType="DECIMAL" property="meter" />
- <result column="MATERIAL_NUMBER" jdbcType="DECIMAL" property="materialNumber" />
- <result column="THEORY_WEIGHT" jdbcType="DECIMAL" property="theoryWeight" />
- <result column="SINGLE_WEIGHT" jdbcType="DECIMAL" property="singleWeight" />
- <result column="NET_WEIGHT" jdbcType="DECIMAL" property="netWeight" />
- <result column="INBOUND_WAREHOUSE" jdbcType="VARCHAR" property="inboundWarehouse" />
- <result column="INBOUND_AREA" jdbcType="VARCHAR" property="inboundArea" />
- <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
- <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
- <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
- <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
- <result column="DELETED" jdbcType="VARCHAR" property="deleted" />
- <result column="ALTERNATE_FIELDS2" jdbcType="VARCHAR" property="alternateFields2" />
- <result column="ALTERNATE_FIELDS3" jdbcType="VARCHAR" property="alternateFields3" />
- <result column="ALTERNATE_FIELDS4" jdbcType="VARCHAR" property="alternateFields4" />
- <result column="ALTERNATE_FIELDS5" jdbcType="VARCHAR" property="alternateFields5" />
- <result column="ALTERNATE_FIELDS6" jdbcType="VARCHAR" property="alternateFields6" />
- <result column="ALTERNATE_FIELDS7" jdbcType="VARCHAR" property="alternateFields7" />
- <result column="ALTERNATE_FIELDS8" jdbcType="VARCHAR" property="alternateFields8" />
- </resultMap>
- <sql id="columns">
- INVENTORY_ID, CONSIGNEE_ID, SALE_AREA, MATERIAL_ID, METER, MATERIAL_NUMBER, THEORY_WEIGHT,
- SINGLE_WEIGHT, NET_WEIGHT, INBOUND_WAREHOUSE, INBOUND_AREA, INSERT_TIME, INSERT_USERNAME,
- UPDATE_TIME, UPDATE_USERNAME, DELETED, ALTERNATE_FIELDS2, ALTERNATE_FIELDS3, ALTERNATE_FIELDS4,
- ALTERNATE_FIELDS5, ALTERNATE_FIELDS6, ALTERNATE_FIELDS7, ALTERNATE_FIELDS8
- </sql>
- <sql id="columns_alias">
- t.INVENTORY_ID, t.CONSIGNEE_ID, t.SALE_AREA, t.MATERIAL_ID, t.METER, t.MATERIAL_NUMBER,
- t.THEORY_WEIGHT, t.SINGLE_WEIGHT, t.NET_WEIGHT, t.INBOUND_WAREHOUSE, t.INBOUND_AREA,
- t.INSERT_TIME, t.INSERT_USERNAME, t.UPDATE_TIME, t.UPDATE_USERNAME, t.DELETED, t.ALTERNATE_FIELDS2,
- t.ALTERNATE_FIELDS3, t.ALTERNATE_FIELDS4, t.ALTERNATE_FIELDS5, t.ALTERNATE_FIELDS6,
- t.ALTERNATE_FIELDS7, t.ALTERNATE_FIELDS8
- </sql>
- <sql id="select">
- SELECT <include refid="columns"/> FROM OYE_REALTIME_INVENTORY
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias"/> FROM OYE_REALTIME_INVENTORY t
- </sql>
- <sql id="where">
- <where>
- <if test="inventoryId != null">
- and INVENTORY_ID = #{inventoryId}
- </if>
- <if test="consigneeId != null">
- and CONSIGNEE_ID = #{consigneeId}
- </if>
- <if test="saleArea != null and saleArea != ''">
- and SALE_AREA = #{saleArea}
- </if>
- <if test="materialId != null">
- and MATERIAL_ID = #{materialId}
- </if>
- <if test="meter != null">
- and METER = #{meter}
- </if>
- <if test="materialNumber != null">
- and MATERIAL_NUMBER = #{materialNumber}
- </if>
- <if test="theoryWeight != null">
- and THEORY_WEIGHT = #{theoryWeight}
- </if>
- <if test="singleWeight != null">
- and SINGLE_WEIGHT = #{singleWeight}
- </if>
- <if test="netWeight != null">
- and NET_WEIGHT = #{netWeight}
- </if>
- <if test="inboundWarehouse != null and inboundWarehouse != ''">
- and INBOUND_WAREHOUSE = #{inboundWarehouse}
- </if>
- <if test="inboundArea != null and inboundArea != ''">
- and INBOUND_AREA = #{inboundArea}
- </if>
- <if test="insertTime != null">
- and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- and INSERT_USERNAME = #{insertUsername}
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- and UPDATE_USERNAME = #{updateUsername}
- </if>
- <if test="deleted != null and deleted != ''">
- and DELETED = #{deleted}
- </if>
- <if test="alternateFields2 != null and alternateFields2 != ''">
- and ALTERNATE_FIELDS2 = #{alternateFields2}
- </if>
- <if test="alternateFields3 != null and alternateFields3 != ''">
- and ALTERNATE_FIELDS3 = #{alternateFields3}
- </if>
- <if test="alternateFields4 != null and alternateFields4 != ''">
- and ALTERNATE_FIELDS4 = #{alternateFields4}
- </if>
- <if test="alternateFields5 != null and alternateFields5 != ''">
- and ALTERNATE_FIELDS5 = #{alternateFields5}
- </if>
- <if test="alternateFields6 != null and alternateFields6 != ''">
- and ALTERNATE_FIELDS6 = #{alternateFields6}
- </if>
- <if test="alternateFields7 != null and alternateFields7 != ''">
- and ALTERNATE_FIELDS7 = #{alternateFields7}
- </if>
- <if test="alternateFields8 != null and alternateFields8 != ''">
- and ALTERNATE_FIELDS8 = #{alternateFields8}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="inventoryId != null">
- and INVENTORY_ID = #{inventoryId}
- </if>
- <if test="consigneeId != null">
- and CONSIGNEE_ID = #{consigneeId}
- </if>
- <if test="saleArea != null and saleArea != ''">
- and SALE_AREA LIKE '%${saleArea}%'
- </if>
- <if test="materialId != null">
- and MATERIAL_ID = #{materialId}
- </if>
- <if test="meter != null">
- and METER = #{meter}
- </if>
- <if test="materialNumber != null">
- and MATERIAL_NUMBER = #{materialNumber}
- </if>
- <if test="theoryWeight != null">
- and THEORY_WEIGHT = #{theoryWeight}
- </if>
- <if test="singleWeight != null">
- and SINGLE_WEIGHT = #{singleWeight}
- </if>
- <if test="netWeight != null">
- and NET_WEIGHT = #{netWeight}
- </if>
- <if test="inboundWarehouse != null and inboundWarehouse != ''">
- and INBOUND_WAREHOUSE LIKE '%${inboundWarehouse}%'
- </if>
- <if test="inboundArea != null and inboundArea != ''">
- and INBOUND_AREA LIKE '%${inboundArea}%'
- </if>
- <if test="insertTime != null">
- and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- and INSERT_USERNAME LIKE '%${insertUsername}%'
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- and UPDATE_USERNAME LIKE '%${updateUsername}%'
- </if>
- <if test="deleted != null and deleted != ''">
- and DELETED LIKE '%${deleted}%'
- </if>
- <if test="alternateFields2 != null and alternateFields2 != ''">
- and ALTERNATE_FIELDS2 LIKE '%${alternateFields2}%'
- </if>
- <if test="alternateFields3 != null and alternateFields3 != ''">
- and ALTERNATE_FIELDS3 LIKE '%${alternateFields3}%'
- </if>
- <if test="alternateFields4 != null and alternateFields4 != ''">
- and ALTERNATE_FIELDS4 LIKE '%${alternateFields4}%'
- </if>
- <if test="alternateFields5 != null and alternateFields5 != ''">
- and ALTERNATE_FIELDS5 LIKE '%${alternateFields5}%'
- </if>
- <if test="alternateFields6 != null and alternateFields6 != ''">
- and ALTERNATE_FIELDS6 LIKE '%${alternateFields6}%'
- </if>
- <if test="alternateFields7 != null and alternateFields7 != ''">
- and ALTERNATE_FIELDS7 LIKE '%${alternateFields7}%'
- </if>
- <if test="alternateFields8 != null and alternateFields8 != ''">
- and ALTERNATE_FIELDS8 LIKE '%${alternateFields8}%'
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
- delete from OYE_REALTIME_INVENTORY
- where INVENTORY_ID = #{inventoryId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from OYE_REALTIME_INVENTORY
- where 1!=1
- <if test="consigneeId != null">
- or CONSIGNEE_ID = #{consigneeId}
- </if>
- <if test="saleArea != null and saleArea != ''">
- or SALE_AREA = #{saleArea}
- </if>
- <if test="materialId != null">
- or MATERIAL_ID = #{materialId}
- </if>
- <if test="meter != null">
- or METER = #{meter}
- </if>
- <if test="materialNumber != null">
- or MATERIAL_NUMBER = #{materialNumber}
- </if>
- <if test="theoryWeight != null">
- or THEORY_WEIGHT = #{theoryWeight}
- </if>
- <if test="singleWeight != null">
- or SINGLE_WEIGHT = #{singleWeight}
- </if>
- <if test="netWeight != null">
- or NET_WEIGHT = #{netWeight}
- </if>
- <if test="inboundWarehouse != null and inboundWarehouse != ''">
- or INBOUND_WAREHOUSE = #{inboundWarehouse}
- </if>
- <if test="inboundArea != null and inboundArea != ''">
- or INBOUND_AREA = #{inboundArea}
- </if>
- <if test="insertTime != null">
- or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- or INSERT_USERNAME = #{insertUsername}
- </if>
- <if test="updateTime != null">
- or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- or UPDATE_USERNAME = #{updateUsername}
- </if>
- <if test="deleted != null and deleted != ''">
- or DELETED = #{deleted}
- </if>
- <if test="alternateFields2 != null and alternateFields2 != ''">
- or ALTERNATE_FIELDS2 = #{alternateFields2}
- </if>
- <if test="alternateFields3 != null and alternateFields3 != ''">
- or ALTERNATE_FIELDS3 = #{alternateFields3}
- </if>
- <if test="alternateFields4 != null and alternateFields4 != ''">
- or ALTERNATE_FIELDS4 = #{alternateFields4}
- </if>
- <if test="alternateFields5 != null and alternateFields5 != ''">
- or ALTERNATE_FIELDS5 = #{alternateFields5}
- </if>
- <if test="alternateFields6 != null and alternateFields6 != ''">
- or ALTERNATE_FIELDS6 = #{alternateFields6}
- </if>
- <if test="alternateFields7 != null and alternateFields7 != ''">
- or ALTERNATE_FIELDS7 = #{alternateFields7}
- </if>
- <if test="alternateFields8 != null and alternateFields8 != ''">
- or ALTERNATE_FIELDS8 = #{alternateFields8}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.OyeRealtimeInventory">
- insert into OYE_REALTIME_INVENTORY (INVENTORY_ID, CONSIGNEE_ID, SALE_AREA,
- MATERIAL_ID, METER, MATERIAL_NUMBER,
- THEORY_WEIGHT, SINGLE_WEIGHT, NET_WEIGHT,
- INBOUND_WAREHOUSE, INBOUND_AREA, INSERT_TIME,
- INSERT_USERNAME, UPDATE_TIME, UPDATE_USERNAME,
- DELETED, ALTERNATE_FIELDS2, ALTERNATE_FIELDS3,
- ALTERNATE_FIELDS4, ALTERNATE_FIELDS5, ALTERNATE_FIELDS6,
- ALTERNATE_FIELDS7, ALTERNATE_FIELDS8)
- values (#{inventoryId,jdbcType=DECIMAL}, #{consigneeId,jdbcType=DECIMAL}, #{saleArea,jdbcType=VARCHAR},
- #{materialId,jdbcType=DECIMAL}, #{meter,jdbcType=DECIMAL}, #{materialNumber,jdbcType=DECIMAL},
- #{theoryWeight,jdbcType=DECIMAL}, #{singleWeight,jdbcType=DECIMAL}, #{netWeight,jdbcType=DECIMAL},
- #{inboundWarehouse,jdbcType=VARCHAR}, #{inboundArea,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
- #{insertUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
- #{deleted,jdbcType=VARCHAR}, #{alternateFields2,jdbcType=VARCHAR}, #{alternateFields3,jdbcType=VARCHAR},
- #{alternateFields4,jdbcType=VARCHAR}, #{alternateFields5,jdbcType=VARCHAR}, #{alternateFields6,jdbcType=VARCHAR},
- #{alternateFields7,jdbcType=VARCHAR}, #{alternateFields8,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.OyeRealtimeInventory">
- insert into OYE_REALTIME_INVENTORY
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="inventoryId != null">
- INVENTORY_ID,
- </if>
- <if test="consigneeId != null">
- CONSIGNEE_ID,
- </if>
- <if test="saleArea != null">
- SALE_AREA,
- </if>
- <if test="materialId != null">
- MATERIAL_ID,
- </if>
- <if test="meter != null">
- METER,
- </if>
- <if test="materialNumber != null">
- MATERIAL_NUMBER,
- </if>
- <if test="theoryWeight != null">
- THEORY_WEIGHT,
- </if>
- <if test="singleWeight != null">
- SINGLE_WEIGHT,
- </if>
- <if test="netWeight != null">
- NET_WEIGHT,
- </if>
- <if test="inboundWarehouse != null">
- INBOUND_WAREHOUSE,
- </if>
- <if test="inboundArea != null">
- INBOUND_AREA,
- </if>
- <if test="insertTime != null">
- INSERT_TIME,
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME,
- </if>
- <if test="updateTime != null">
- UPDATE_TIME,
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME,
- </if>
- <if test="deleted != null">
- DELETED,
- </if>
- <if test="alternateFields2 != null">
- ALTERNATE_FIELDS2,
- </if>
- <if test="alternateFields3 != null">
- ALTERNATE_FIELDS3,
- </if>
- <if test="alternateFields4 != null">
- ALTERNATE_FIELDS4,
- </if>
- <if test="alternateFields5 != null">
- ALTERNATE_FIELDS5,
- </if>
- <if test="alternateFields6 != null">
- ALTERNATE_FIELDS6,
- </if>
- <if test="alternateFields7 != null">
- ALTERNATE_FIELDS7,
- </if>
- <if test="alternateFields8 != null">
- ALTERNATE_FIELDS8,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="inventoryId != null">
- #{inventoryId,jdbcType=DECIMAL},
- </if>
- <if test="consigneeId != null">
- #{consigneeId,jdbcType=DECIMAL},
- </if>
- <if test="saleArea != null">
- #{saleArea,jdbcType=VARCHAR},
- </if>
- <if test="materialId != null">
- #{materialId,jdbcType=DECIMAL},
- </if>
- <if test="meter != null">
- #{meter,jdbcType=DECIMAL},
- </if>
- <if test="materialNumber != null">
- #{materialNumber,jdbcType=DECIMAL},
- </if>
- <if test="theoryWeight != null">
- #{theoryWeight,jdbcType=DECIMAL},
- </if>
- <if test="singleWeight != null">
- #{singleWeight,jdbcType=DECIMAL},
- </if>
- <if test="netWeight != null">
- #{netWeight,jdbcType=DECIMAL},
- </if>
- <if test="inboundWarehouse != null">
- #{inboundWarehouse,jdbcType=VARCHAR},
- </if>
- <if test="inboundArea != null">
- #{inboundArea,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUsername != null">
- #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="deleted != null">
- #{deleted,jdbcType=VARCHAR},
- </if>
- <if test="alternateFields2 != null">
- #{alternateFields2,jdbcType=VARCHAR},
- </if>
- <if test="alternateFields3 != null">
- #{alternateFields3,jdbcType=VARCHAR},
- </if>
- <if test="alternateFields4 != null">
- #{alternateFields4,jdbcType=VARCHAR},
- </if>
- <if test="alternateFields5 != null">
- #{alternateFields5,jdbcType=VARCHAR},
- </if>
- <if test="alternateFields6 != null">
- #{alternateFields6,jdbcType=VARCHAR},
- </if>
- <if test="alternateFields7 != null">
- #{alternateFields7,jdbcType=VARCHAR},
- </if>
- <if test="alternateFields8 != null">
- #{alternateFields8,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.OyeRealtimeInventory">
- update OYE_REALTIME_INVENTORY
- set CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL},
- SALE_AREA = #{saleArea,jdbcType=VARCHAR},
- MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
- METER = #{meter,jdbcType=DECIMAL},
- MATERIAL_NUMBER = #{materialNumber,jdbcType=DECIMAL},
- THEORY_WEIGHT = #{theoryWeight,jdbcType=DECIMAL},
- SINGLE_WEIGHT = #{singleWeight,jdbcType=DECIMAL},
- NET_WEIGHT = #{netWeight,jdbcType=DECIMAL},
- INBOUND_WAREHOUSE = #{inboundWarehouse,jdbcType=VARCHAR},
- INBOUND_AREA = #{inboundArea,jdbcType=VARCHAR},
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- DELETED = #{deleted,jdbcType=VARCHAR},
- ALTERNATE_FIELDS2 = #{alternateFields2,jdbcType=VARCHAR},
- ALTERNATE_FIELDS3 = #{alternateFields3,jdbcType=VARCHAR},
- ALTERNATE_FIELDS4 = #{alternateFields4,jdbcType=VARCHAR},
- ALTERNATE_FIELDS5 = #{alternateFields5,jdbcType=VARCHAR},
- ALTERNATE_FIELDS6 = #{alternateFields6,jdbcType=VARCHAR},
- ALTERNATE_FIELDS7 = #{alternateFields7,jdbcType=VARCHAR},
- ALTERNATE_FIELDS8 = #{alternateFields8,jdbcType=VARCHAR}
- where INVENTORY_ID = #{inventoryId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.OyeRealtimeInventory">
- update OYE_REALTIME_INVENTORY
- <set>
- <if test="consigneeId != null">
- CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL},
- </if>
- <if test="saleArea != null">
- SALE_AREA = #{saleArea,jdbcType=VARCHAR},
- </if>
- <if test="materialId != null">
- MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
- </if>
- <if test="meter != null">
- METER = #{meter,jdbcType=DECIMAL},
- </if>
- <if test="materialNumber != null">
- MATERIAL_NUMBER = #{materialNumber,jdbcType=DECIMAL},
- </if>
- <if test="theoryWeight != null">
- THEORY_WEIGHT = #{theoryWeight,jdbcType=DECIMAL},
- </if>
- <if test="singleWeight != null">
- SINGLE_WEIGHT = #{singleWeight,jdbcType=DECIMAL},
- </if>
- <if test="netWeight != null">
- NET_WEIGHT = #{netWeight,jdbcType=DECIMAL},
- </if>
- <if test="inboundWarehouse != null">
- INBOUND_WAREHOUSE = #{inboundWarehouse,jdbcType=VARCHAR},
- </if>
- <if test="inboundArea != null">
- INBOUND_AREA = #{inboundArea,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="deleted != null">
- DELETED = #{deleted,jdbcType=VARCHAR},
- </if>
- <if test="alternateFields2 != null">
- ALTERNATE_FIELDS2 = #{alternateFields2,jdbcType=VARCHAR},
- </if>
- <if test="alternateFields3 != null">
- ALTERNATE_FIELDS3 = #{alternateFields3,jdbcType=VARCHAR},
- </if>
- <if test="alternateFields4 != null">
- ALTERNATE_FIELDS4 = #{alternateFields4,jdbcType=VARCHAR},
- </if>
- <if test="alternateFields5 != null">
- ALTERNATE_FIELDS5 = #{alternateFields5,jdbcType=VARCHAR},
- </if>
- <if test="alternateFields6 != null">
- ALTERNATE_FIELDS6 = #{alternateFields6,jdbcType=VARCHAR},
- </if>
- <if test="alternateFields7 != null">
- ALTERNATE_FIELDS7 = #{alternateFields7,jdbcType=VARCHAR},
- </if>
- <if test="alternateFields8 != null">
- ALTERNATE_FIELDS8 = #{alternateFields8,jdbcType=VARCHAR},
- </if>
- </set>
- where INVENTORY_ID = #{inventoryId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
- <include refid="select"/>
- where INVENTORY_ID = #{inventoryId,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 OYE_REALTIME_INVENTORY
- (INVENTORY_ID,
- CONSIGNEE_ID, SALE_AREA, MATERIAL_ID,
- METER, MATERIAL_NUMBER, THEORY_WEIGHT,
- SINGLE_WEIGHT, NET_WEIGHT, INBOUND_WAREHOUSE,
- INBOUND_AREA, INSERT_TIME, INSERT_USERNAME,
- UPDATE_TIME, UPDATE_USERNAME,
- DELETED, ALTERNATE_FIELDS2, ALTERNATE_FIELDS3,
- ALTERNATE_FIELDS4, ALTERNATE_FIELDS5,
- ALTERNATE_FIELDS6, ALTERNATE_FIELDS7,
- ALTERNATE_FIELDS8)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.inventoryId,jdbcType=DECIMAL},
- #{item.consigneeId,jdbcType=DECIMAL}, #{item.saleArea,jdbcType=VARCHAR}, #{item.materialId,jdbcType=DECIMAL},
- #{item.meter,jdbcType=DECIMAL}, #{item.materialNumber,jdbcType=DECIMAL}, #{item.theoryWeight,jdbcType=DECIMAL},
- #{item.singleWeight,jdbcType=DECIMAL}, #{item.netWeight,jdbcType=DECIMAL}, #{item.inboundWarehouse,jdbcType=VARCHAR},
- #{item.inboundArea,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, #{item.insertUsername,jdbcType=VARCHAR},
- #{item.updateTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
- #{item.deleted,jdbcType=VARCHAR}, #{item.alternateFields2,jdbcType=VARCHAR}, #{item.alternateFields3,jdbcType=VARCHAR},
- #{item.alternateFields4,jdbcType=VARCHAR}, #{item.alternateFields5,jdbcType=VARCHAR},
- #{item.alternateFields6,jdbcType=VARCHAR}, #{item.alternateFields7,jdbcType=VARCHAR},
- #{item.alternateFields8,jdbcType=VARCHAR} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update OYE_REALTIME_INVENTORY
- set
- INVENTORY_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.inventoryId,jdbcType=DECIMAL}
- </foreach>
- ,CONSIGNEE_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.consigneeId,jdbcType=DECIMAL}
- </foreach>
- ,SALE_AREA=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.saleArea,jdbcType=VARCHAR}
- </foreach>
- ,MATERIAL_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
- </foreach>
- ,METER=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.meter,jdbcType=DECIMAL}
- </foreach>
- ,MATERIAL_NUMBER=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.materialNumber,jdbcType=DECIMAL}
- </foreach>
- ,THEORY_WEIGHT=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.theoryWeight,jdbcType=DECIMAL}
- </foreach>
- ,SINGLE_WEIGHT=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.singleWeight,jdbcType=DECIMAL}
- </foreach>
- ,NET_WEIGHT=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.netWeight,jdbcType=DECIMAL}
- </foreach>
- ,INBOUND_WAREHOUSE=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.inboundWarehouse,jdbcType=VARCHAR}
- </foreach>
- ,INBOUND_AREA=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.inboundArea,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,DELETED=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=VARCHAR}
- </foreach>
- ,ALTERNATE_FIELDS2=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.alternateFields2,jdbcType=VARCHAR}
- </foreach>
- ,ALTERNATE_FIELDS3=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.alternateFields3,jdbcType=VARCHAR}
- </foreach>
- ,ALTERNATE_FIELDS4=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.alternateFields4,jdbcType=VARCHAR}
- </foreach>
- ,ALTERNATE_FIELDS5=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.alternateFields5,jdbcType=VARCHAR}
- </foreach>
- ,ALTERNATE_FIELDS6=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.alternateFields6,jdbcType=VARCHAR}
- </foreach>
- ,ALTERNATE_FIELDS7=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.alternateFields7,jdbcType=VARCHAR}
- </foreach>
- ,ALTERNATE_FIELDS8=
- <foreach collection="list" item="item" index="index" separator=" " open="case INVENTORY_ID" close="end">
- when #{item.inventoryId,jdbcType=DECIMAL} then #{item.alternateFields8,jdbcType=VARCHAR}
- </foreach>
- where INVENTORY_ID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.inventoryId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from OYE_REALTIME_INVENTORY
- where INVENTORY_ID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <select id="getOyeRealTimeResult" resultType="java.util.Map">
- SELECT
- TT."materialId" "materialId",
- TT."meter" "meter",
- TT."singleWeight" "singleWeight",
- TT."consigneeName" "consigneeName",
- TT."materialModel" "materialModel",
- TT."materialSpe" "materialSpe",
- TT."materialName" "materialName",
- TT."consigneeId" "consigneeId",
- TT."inboundArea" "inboundArea",
- TT."inboundWarehouse" "inboundWarehouse",
- TT."saleArea" "saleArea",
- SUM(TT."materialNumber") "materialNumber",
- SUM(TT."theoryWeight") "theoryWeight",
- SUM(TT."netWeight") "netWeight"
- FROM (
- SELECT ORI.SINGLE_WEIGHT "singleWeight",
- ORI.METER "meter",
- ORI.MATERIAL_ID "materialId",
- ORI.MATERIAL_NUMBER "materialNumber",
- ORI.THEORY_WEIGHT "theoryWeight",
- ORI.NET_WEIGHT "netWeight",
- ORI.SALE_AREA "saleArea",
- ORI.INVENTORY_ID "inventoryId",
- ORI.INBOUND_WAREHOUSE "inboundWarehouse",
- ORI.INBOUND_AREA "inboundArea",
- ORI.INSERT_TIME "insertTime",
- ORI.UPDATE_TIME "updateTime",
- RC.CONSIGNEE_ID "consigneeId",
- RC.CONSIGNEE_COMPANY_NAME "consigneeName",
- RM.MATERIAL_NAME "materialName",
- RM.MATERIAL_SPECIFICATION "materialSpe",
- RM.MATERIAL_MODEL "materialModel"
- FROM OYE_REALTIME_INVENTORY ORI
- LEFT JOIN RMS_MATERIAL RM on ORI.MATERIAL_ID = RM.MATERIAL_ID
- LEFT JOIN RMS_CONSIGNEE RC on ORI.CONSIGNEE_ID = RC.CONSIGNEE_ID
- <where>
- <if test="1 == 1">
- and NVL(ORI.MATERIAL_NUMBER,0) > 0
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= ORI.INSERT_TIME
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= ORI.INSERT_TIME
- </if>
- <if test="filterFlag != null">
- and ORI.MATERIAL_NUMBER > 0
- </if>
- <if test="consigneeName != null and consigneeName != ''">
- AND RC.CONSIGNEE_COMPANY_NAME LIKE '%${consigneeName}%'
- </if>
- <if test="saleArea != null and saleArea != ''">
- AND ORI.SALE_AREA LIKE '%${saleArea}%'
- </if>
- <if test="inboundWarehouse != null and inboundWarehouse != ''">
- AND ORI.INBOUND_WAREHOUSE LIKE '%${inboundWarehouse}%'
- </if>
- <if test="inboundArea != null and inboundArea != ''">
- AND ORI.inbound_Area LIKE '%${inboundArea}%'
- </if>
- <if test="materialName != null and materialName != ''">
- AND RM.material_Name LIKE '%${materialName}%'
- </if>
- <if test="materialNameText != null and materialNameText != ''">
- AND RM.material_Name || RM.MATERIAL_MODEL LIKE '%${materialNameText}%'
- </if>
- <if test="materialSpe != null and materialSpe != ''">
- AND RM.MATERIAL_SPECIFICATION LIKE '%${materialSpe}%'
- </if>
- <if test="saleRemark != null and saleRemark != ''">
- AND ORI.SALE_AREA LIKE '%${saleRemark}%'
- </if>
- <if test="receiveCompanyId != null and receiveCompanyId != ''">
- AND RC.CONSIGNEE_ID LIKE '%${receiveCompanyId}%'
- </if>
- <if test="saleAreaRemark != null">
- and
- <foreach collection="saleAreaRemark" item="item" open="(" separator="or" close=")">
- ORI.SALE_AREA like '%${item}%'
- </foreach>
- </if>
- </where>
- ORDER BY ORI.INSERT_TIME DESC) TT
- GROUP BY TT."materialId",
- TT."meter",
- TT."singleWeight",
- TT."consigneeName",
- TT."materialModel",
- TT."materialSpe",
- TT."materialName",
- TT."consigneeId",
- TT."inboundArea",
- TT."inboundWarehouse",
- TT."saleArea"
- </select>
- <select id="getInventoryId" resultType="java.math.BigDecimal" parameterType="java.util.Map">
- SELECT ORI.INVENTORY_ID FROM OYE_REALTIME_INVENTORY ORI
- WHERE ORI.CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL}
- AND ORI.SINGLE_WEIGHT = #{singleWeight,jdbcType=DECIMAL}
- AND ORI.SALE_AREA = #{saleArea,jdbcType=VARCHAR}
- AND ORI.material_Id = #{materialId,jdbcType=DECIMAL}
- AND ORI.INBOUND_WAREHOUSE = #{inboundWarehouse,jdbcType=VARCHAR}
- AND ORI.meter = #{meter,jdbcType=DECIMAL}
- AND ORI.INBOUND_AREA = #{inboundArea,jdbcType=VARCHAR}
- </select>
- <select id="seleOtmsParams" resultType="java.util.Map">
- SELECT *
- from (
- SELECT
- -- 出厂时间
- to_char(OOR.INSERT_TIME, 'yyyy-mm-dd hh24:mi:ss') "resultOutGateTime",
- --出厂抓拍图片
- '无' "resultTruckSnapshotPicture",
- --出厂方式
- '厂外库房出库' "resultOutMode",
- --门岗名称
- '厂外库房' "gatepostName",
- -- 运输订单号
- OO.ORDER_NUMBER "orderNumber",
- -- 车牌号
- RC.CAPACITY_NUMBER "capacityNumber",
- -- 运输订单id
- OO.ORDER_ID "orderId",
- -- 订单类型
- OO.ORDER_TYPE "orderType",
- -- 销售订单号
- ASO.SALE_NUMBER "saleNum",
- -- 收货地址
- CONCAT(CONCAT(RRA.ADDRESS_PROVINCE, RRA.ADDRESS_DISTRICT), RRA.Address_Town) "receiveAddress",
- -- 收货单位
- RS.SUPPLIER_NAME "supplierName",
- -- 发货单位
- RS2.SHIPPER_NAME "shipperName"
- FROM
- -- 出厂实绩
- OYE_OUTBOUND_RESULT OOR
- -- 运输订单
- LEFT JOIN OMSTRUCK_ORDER OO ON OOR.ORDER_ID = OO.ORDER_ID
- -- 销售订单信息
- LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
- -- 托运人
- LEFT JOIN RMS_SUPPLIER RS ON ASO.SHIPPER_ID = RS.SUPPLIER_ID
- -- 运力信息
- LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
- -- 销售订单中间表
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
- --收货地址
- left join RMS_RECEIVE_PLACE RRP on ASOM.SALE_SHIPPING_ADDRESS_ID = RRP.PLACE_ID
- left join RMS_RECEIVE_ADDRESS RRA on RRP.ADDRESS_ID = RRA.ADDRESS_ID
- -- 收货单位
- LEFT JOIN RMS_SHIPPER RS2 ON ASO.SHIPPER_ID = RS2.SHIPPER_ID
- WHERE
- OO.ORDER_TYPE = 1
- AND OO.ORDER_ID = #{orderId}
- FETCH NEXT 1 ROWS ONLY
- )
- </select>
- <select id="receiveSendReport" resultType="java.util.Map">
- SELECT
- NVL(T1."inboundMaterialNumber",0) "inboundMaterialNumber",
- NVL(T1."inboundMaterialWeight",0) "inboundMaterialWeight",
- NVL(T2."outboundMaterialNumber",0) "outboundMaterialNumber",
- NVL(T2."outboundMaterialWeight",0) "outboundMaterialWeight",
- ORI.INVENTORY_ID,
- ORI.SALE_AREA "saleArea",
- RC.CONSIGNEE_COMPANY_NAME "companyName",
- RM.MATERIAL_NAME "materialName",
- RM.MATERIAL_SPECIFICATION "materialSpe",
- RM.MATERIAL_MODEL "materialModel",
- ORI.INBOUND_WAREHOUSE "inboundWarehouse",
- NVL(T3."currentInboundMaterialNumber",0) "currentInboundMaterialNumber",
- NVL(T3."currentInboundTheoryWeight",0) "currentInboundTheoryWeight",
- NVL(T4."currentOutboundMaterialNumber",0) "currentOutboundMaterialNumber",
- NVL(T4."currentOutboundTheoryWeight",0) "currentOutboundTheoryWeight",
- NVL(ORI.MATERIAL_NUMBER,0) "materialNumber",
- NVL(ORI.THEORY_WEIGHT,0) "materialWeight"
- FROM
- OYE_REALTIME_INVENTORY ORI
- LEFT JOIN
- (
- SELECT
- oir.INVENTORY_ID "INVENTORY_ID",
- NVL( SUM( OIR.MATERIAL_NUMBER ), 0 ) "inboundMaterialNumber",
- NVL( SUM( OIR.THEORY_WEIGHT ), 0 ) "inboundMaterialWeight"
- FROM
- OYE_REALTIME_INVENTORY ORI
- LEFT JOIN OYE_INBOUND_RESULT OIR ON OIR.INVENTORY_ID = ORI.INVENTORY_ID
- WHERE OIR.SALE_MATERIAL_ID IS NOT NULL
- GROUP BY
- oir.INVENTORY_ID
- ) T1 ON T1.INVENTORY_ID = ORI.INVENTORY_ID
- LEFT JOIN (
- SELECT
- oor.INVENTORY_ID "INVENTORY_ID",
- NVL( SUM( OOR.MATERIAL_NUMBER ), 0 ) "outboundMaterialNumber",
- NVL( SUM( OOR.THEORY_WEIGHT ), 0 ) "outboundMaterialWeight"
- FROM
- OYE_REALTIME_INVENTORY ORI
- LEFT JOIN OYE_OutBOUND_RESULT OOR ON OOR.INVENTORY_ID = ORI.INVENTORY_ID
- WHERE OOR.SALE_MATERIAL_ID IS NOT NULL
- GROUP BY
- oor.INVENTORY_ID
- ) T2 ON T2.INVENTORY_ID = ORI.INVENTORY_ID
- LEFT JOIN (
- SELECT
- OIR.INVENTORY_ID "INVENTORY_ID",
- NVL( sum( OIR.MATERIAL_NUMBER ), 0 ) "currentInboundMaterialNumber",
- NVL( SUM( OIR.THEORY_WEIGHT ), 0 ) "currentInboundTheoryWeight"
- FROM
- OYE_INBOUND_RESULT OIR
- WHERE
- OIR.SALE_MATERIAL_ID IS NOT NULL
- <if test="oneDate != null">
- AND to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = OIR.INSERT_TIME
- </if>
- <if test="startDate != null">
- AND to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= OIR.INSERT_TIME
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= OIR.INSERT_TIME
- </if>
- GROUP BY
- OIR.INVENTORY_ID
- ) T3 ON T3."INVENTORY_ID" = ORI."INVENTORY_ID"
- LEFT JOIN (
- SELECT
- OOR.INVENTORY_ID "INVENTORY_ID",
- NVL( SUM( OOR.MATERIAL_NUMBER ), 0 ) "currentOutboundMaterialNumber",
- NVL( SUM( OOR.THEORY_WEIGHT ), 0 ) "currentOutboundTheoryWeight"
- FROM
- OYE_OUTBOUND_RESULT OOR
- WHERE
- OOR.SALE_MATERIAL_ID IS NOT NULL
- <if test="oneDate != null">
- AND to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = OOR.INSERT_TIME
- </if>
- <if test="startDate != null">
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= OOR.INSERT_TIME
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= OOR.INSERT_TIME
- </if>
- GROUP BY
- OOR.INVENTORY_ID
- ) T4 ON T4."INVENTORY_ID" = ORI."INVENTORY_ID"
- LEFT JOIN RMS_CONSIGNEE RC ON RC.CONSIGNEE_ID = ORI.CONSIGNEE_ID
- LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = ORI.MATERIAL_ID
- <where>
- <if test="companyName != null and companyName != ''">
- AND RC.CONSIGNEE_COMPANY_NAME LIKE '%${companyName}%'
- </if>
- <if test="saleArea != null and saleArea != ''">
- AND ORI.SALE_AREA LIKE '%${saleArea}%'
- </if>
- <if test="inboundWarehouse != null and inboundWarehouse != ''">
- AND ORI.INBOUND_WAREHOUSE LIKE '%${inboundWarehouse}%'
- </if>
- <if test="materialName != null and materialName != ''">
- AND RM.MATERIAL_NAME LIKE '%${materialName}%'
- </if>
- <if test="materialSpe != null and materialSpe != ''">
- AND RM.MATERIAL_SPECIFICATION LIKE '%${materialSpe}%'
- </if>
- <if test="materialModel != null and materialModel != ''">
- AND RM.MATERIAL_MODEL LIKE '%${materialModel}%'
- </if>
- <if test="saleAreaRemark != null">
- and
- <foreach collection="saleAreaRemark" item="item" open="(" separator="or" close=")">
- ORI.SALE_AREA like '%${item}%'
- </foreach>
- </if>
- </where>
- </select>
- <select id="getSaleAreaRemark" resultType="java.lang.String">
- SELECT RSR.SALE_REMARK FROM RMS_SALER_REMAR RSR
- WHERE RSR.SALER_NAME = #{saler}
- </select>
- <select id="getTheoryWeight" resultType="java.math.BigDecimal" parameterType="java.math.BigDecimal">
- SELECT ASM.MATERIAL_WEIGHT FROM AMS_SALE_MATERIAL ASM
- WHERE ASM.SALE_MATERIAL_ID = #{saleMaterialId}
- </select>
- <select id="getSingleWeight" resultType="java.math.BigDecimal">
- SELECT ORI.SINGLE_WEIGHT FROM OYE_REALTIME_INVENTORY ORI
- WHERE ORI.INVENTORY_ID = #{inventoryId}
- </select>
- <select id="selectCompareValue" resultType="java.lang.String">
- SELECT VERSION_VALUE FROM DIL_VERSION
- WHERE VERSION_ID = 16
- </select>
- </mapper>
|