123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923 |
- <?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.TmstruckReceiptResultMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckReceiptResult">
- <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
-
- <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
- <result column="RESULT_EMPTY_CONTAINER_PHOTO" jdbcType="VARCHAR" property="resultEmptyContainerPhoto" />
- <result column="RESULT_SIGNED_NOTE_PHOTO" jdbcType="VARCHAR" property="resultSignedNotePhoto" />
- <result column="RESULT_RECEIVE_NOTE_PHOTO" jdbcType="VARCHAR" property="resultReceiveNotePhoto" />
- <result column="WAREHOUSE_ID" jdbcType="DECIMAL" property="warehouseId" />
- <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="STATUS" jdbcType="DECIMAL" property="status" />
- <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
- <result column="RESULT_ARRIVAL_ADDRESS" jdbcType="VARCHAR" property="resultArrivalAddress" />
- </resultMap>
- <sql id="columns">
- RESULT_ID, RESULT_TOTAL_ID, RESULT_EMPTY_CONTAINER_PHOTO, RESULT_SIGNED_NOTE_PHOTO,
- RESULT_RECEIVE_NOTE_PHOTO, WAREHOUSE_ID, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME,STATUS, INSERT_UPDATE_REMARK, RESULT_ARRIVAL_ADDRESS
- </sql>
- <sql id="columns_alias">
- t.RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_EMPTY_CONTAINER_PHOTO, t.RESULT_SIGNED_NOTE_PHOTO,
- t.RESULT_RECEIVE_NOTE_PHOTO, t.WAREHOUSE_ID, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
- t.UPDATE_TIME,STATUS, t.INSERT_UPDATE_REMARK, t.RESULT_ARRIVAL_ADDRESS
- </sql>
- <sql id="select">
- SELECT <include refid="columns" /> FROM TMSTRUCK_RECEIPT_RESULT
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias" /> FROM TMSTRUCK_RECEIPT_RESULT t
- </sql>
- <sql id="where">
- <where>
- <if test="resultId != null">
- and RESULT_ID = #{resultId}
- </if>
- <if test="resultTotalId != null">
- and RESULT_TOTAL_ID = #{resultTotalId}
- </if>
- <if test="resultEmptyContainerPhoto != null and resultEmptyContainerPhoto != ''">
- and RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
- </if>
- <if test="resultSignedNotePhoto != null and resultSignedNotePhoto != ''">
- and RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
- </if>
- <if test="resultReceiveNotePhoto != null and resultReceiveNotePhoto != ''">
- and RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
- </if>
- <if test="warehouseId != null">
- and WAREHOUSE_ID = #{warehouseId}
- </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="status != null">
- and STATUS = #{status}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
- and RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="resultId != null">
- and RESULT_ID = #{resultId}
- </if>
- <if test="resultTotalId != null">
- and RESULT_TOTAL_ID = #{resultTotalId}
- </if>
- <if test="resultEmptyContainerPhoto != null and resultEmptyContainerPhoto != ''">
- and RESULT_EMPTY_CONTAINER_PHOTO LIKE '%${resultEmptyContainerPhoto}%'
- </if>
- <if test="resultSignedNotePhoto != null and resultSignedNotePhoto != ''">
- and RESULT_SIGNED_NOTE_PHOTO LIKE '%${resultSignedNotePhoto}%'
- </if>
- <if test="resultReceiveNotePhoto != null and resultReceiveNotePhoto != ''">
- and RESULT_RECEIVE_NOTE_PHOTO LIKE '%${resultReceiveNotePhoto}%'
- </if>
- <if test="warehouseId != null">
- and WAREHOUSE_ID = #{warehouseId}
- </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="status != null">
- and STATUS = #{status}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
- </if>
- <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
- and RESULT_ARRIVAL_ADDRESS LIKE '%${resultArrivalAddress}%'
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
- delete from TMSTRUCK_RECEIPT_RESULT
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from TMSTRUCK_RECEIPT_RESULT
- where 1!=1
- <if test="resultTotalId != null">
- or RESULT_TOTAL_ID = #{resultTotalId}
- </if>
- <if test="resultEmptyContainerPhoto != null and resultEmptyContainerPhoto != ''">
- or RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
- </if>
- <if test="resultSignedNotePhoto != null and resultSignedNotePhoto != ''">
- or RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
- </if>
- <if test="resultReceiveNotePhoto != null and resultReceiveNotePhoto != ''">
- or RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
- </if>
- <if test="warehouseId != null">
- or WAREHOUSE_ID = #{warehouseId}
- </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="status != null">
- or STATUS = '#{status}'
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
- or RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
- insert into TMSTRUCK_RECEIPT_RESULT (RESULT_ID, RESULT_TOTAL_ID, RESULT_EMPTY_CONTAINER_PHOTO,
- RESULT_SIGNED_NOTE_PHOTO, RESULT_RECEIVE_NOTE_PHOTO,
- WAREHOUSE_ID, INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME,STATUS, INSERT_UPDATE_REMARK,
- RESULT_ARRIVAL_ADDRESS)
- values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
- #{resultSignedNotePhoto,jdbcType=VARCHAR}, #{resultReceiveNotePhoto,jdbcType=VARCHAR},
- #{warehouseId,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
- #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},#{status,jdbcType=DECIMAL}, #{insertUpdateRemark,jdbcType=VARCHAR},
- #{resultArrivalAddress,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
- insert into TMSTRUCK_RECEIPT_RESULT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="resultId != null">
- RESULT_ID,
- </if>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID,
- </if>
- <if test="resultEmptyContainerPhoto != null">
- RESULT_EMPTY_CONTAINER_PHOTO,
- </if>
- <if test="resultSignedNotePhoto != null">
- RESULT_SIGNED_NOTE_PHOTO,
- </if>
- <if test="resultReceiveNotePhoto != null">
- RESULT_RECEIVE_NOTE_PHOTO,
- </if>
- <if test="warehouseId != null">
- WAREHOUSE_ID,
- </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="status != null">
- STATUS,
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK,
- </if>
- <if test="resultArrivalAddress != null">
- RESULT_ARRIVAL_ADDRESS,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="resultId != null">
- #{resultId,jdbcType=DECIMAL},
- </if>
- <if test="resultTotalId != null">
- #{resultTotalId,jdbcType=DECIMAL},
- </if>
- <if test="resultEmptyContainerPhoto != null">
- #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
- </if>
- <if test="resultSignedNotePhoto != null">
- #{resultSignedNotePhoto,jdbcType=VARCHAR},
- </if>
- <if test="resultReceiveNotePhoto != null">
- #{resultReceiveNotePhoto,jdbcType=VARCHAR},
- </if>
- <if test="warehouseId != null">
- #{warehouseId,jdbcType=DECIMAL},
- </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="status != null">
- #{status,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUpdateRemark != null">
- #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- <if test="resultArrivalAddress != null">
- #{resultArrivalAddress,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
- update TMSTRUCK_RECEIPT_RESULT
- set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
- RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
- RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=VARCHAR},
- RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=VARCHAR},
- WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- STATUS = #{status,jdbcType=DECIMAL},
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress,jdbcType=VARCHAR}
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
- update TMSTRUCK_RECEIPT_RESULT
- <set>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
- </if>
- <if test="resultEmptyContainerPhoto != null">
- RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
- </if>
- <if test="resultSignedNotePhoto != null">
- RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=VARCHAR},
- </if>
- <if test="resultReceiveNotePhoto != null">
- RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=VARCHAR},
- </if>
- <if test="warehouseId != null">
- WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
- </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="status != null">
- STATUS = #{status,jdbcType=DECIMAL},
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- <if test="resultArrivalAddress != null">
- RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress,jdbcType=VARCHAR},
- </if>
- </set>
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
- <include refid="select" />
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </select>
- <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select" />
- <include refid="where" />
- </select>
- <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select" />
- <include refid="whereLike" />
- </select>
- <insert id="batchInsert" parameterType="java.util.List">
- insert into TMSTRUCK_RECEIPT_RESULT
- (RESULT_ID,
- RESULT_TOTAL_ID, RESULT_EMPTY_CONTAINER_PHOTO,
- RESULT_SIGNED_NOTE_PHOTO, RESULT_RECEIVE_NOTE_PHOTO,
- WAREHOUSE_ID, INSERT_USERNAME,
- INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, STATUS,INSERT_UPDATE_REMARK,
- RESULT_ARRIVAL_ADDRESS)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.resultId,jdbcType=DECIMAL},
- #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultEmptyContainerPhoto,jdbcType=VARCHAR},
- #{item.resultSignedNotePhoto,jdbcType=VARCHAR}, #{item.resultReceiveNotePhoto,jdbcType=VARCHAR},
- #{item.warehouseId,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
- #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
- #{item.updateTime,jdbcType=TIMESTAMP},#{item.status,jdbcType=DECIMAL}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
- #{item.resultArrivalAddress,jdbcType=VARCHAR} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update TMSTRUCK_RECEIPT_RESULT
- set
- RESULT_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_TOTAL_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_EMPTY_CONTAINER_PHOTO=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEmptyContainerPhoto,jdbcType=VARCHAR}
- </foreach>
- ,RESULT_SIGNED_NOTE_PHOTO=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultSignedNotePhoto,jdbcType=VARCHAR}
- </foreach>
- ,RESULT_RECEIVE_NOTE_PHOTO=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultReceiveNotePhoto,jdbcType=VARCHAR}
- </foreach>
- ,WAREHOUSE_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.warehouseId,jdbcType=DECIMAL}
- </foreach>
- ,INSERT_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,STATUS=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- ,RESULT_ARRIVAL_ADDRESS=
- <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultArrivalAddress,jdbcType=VARCHAR}
- </foreach>
- where RESULT_ID in
- <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
- #{item.resultId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from TMSTRUCK_RECEIPT_RESULT
- where RESULT_ID in
- <foreach close=")" collection="list" item="id" open="(" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-
-
- <!-- 获取最大ID值 -->
- <!-- 通过总实绩ID 查询签收实绩ID -->
- <select id="getIdByTotalResultId" parameterType="int" resultType="int">
- select TRR.RESULT_ID from TMSTRUCK_RECEIPT_RESULT TRR where TRR.RESULT_TOTAL_ID = #{totalResultId}
- </select>
- <!--通过总实绩Id 更新 状态码 为 1 已签收-->
- <update id="updateByTotalResultId" parameterType="java.util.Map">
- update TMSTRUCK_RECEIPT_RESULT
- <set>
- <if test="warehouseId != null">
- WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
- </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="status != null">
- STATUS = #{status,jdbcType=DECIMAL},
- </if>
- <if test="resultEmptyContainerPhoto != null">
- RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=BLOB},
- </if>
- <if test="resultSignedNotePhoto != null">
- RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=BLOB},
- </if>
- <if test="resultReceiveNotePhoto != null">
- RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=BLOB},
- </if>
- </set>
- where RESULT_TOTAL_ID = #{resultTotalId}
- </update>
- <!-- 通过签收时间排序 -->
- <sql id="orderBy">
- <if test="orderField != null and orderField != ''">
- order by "${orderField}"
- <if test="orderType != null and orderType != ''">
- ${orderType}
- </if>
- </if>
- <if test="orderField == null ">
- order by "insertTime" desc
- </if>
- </sql>
- <!-- 查询所有签收实绩 -->
- <select id="getCGReceiptResult" parameterType="java.util.Map" resultType="java.util.Map">
- select
- *
- from (
- select
- OO.ORDER_ID "orderId",
- TRR.RESULT_ID "resultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
- TUR.UNLOAD_STATUS "unloadStatus",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- RW.WAREHOUSE_NAME "warehouseName",
- TRR.INSERT_USERNAME "insertUsername",
- TRR.INSERT_TIME "insertTime"
- from TMSTRUCK_RECEIPT_RESULT TRR
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on OO.ORDER_ID = TTR.ORDER_ID
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
- left join DIL_BATCH DB
- on DB.BATCH_ID = APO.BATCH_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join TMSTRUCK_WEIGHT_RESULT TWR
- on TWR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
- left join TMSTRUCK_UNLOAD_RESULT TUR
- on TUR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OOM.ORDER_ID = OO.ORDER_ID
- left join RMS_MATERIAL RM
- on OOM.MATERIAL_ID = RM.MATERIAL_ID
- left join RMS_WAREHOUSE RW
- on RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
- where TRR.STATUS = 1 and OO.ORDER_TYPE = #{orderTypee}
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" like '%${item}%'
- </foreach>
- </if>
- <if test="unloadStatus != null">
- and
- <foreach collection="unloadStatus" item="item" open="(" separator="or" close=")">
- "unloadStatus" like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" like '%${item}%'
- </foreach>
- </if>
- <if test="insertUsername != null">
- and
- <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
- "insertUsername" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 查询内转钢材到异地库收货实绩-->
- <select id="getSteelNzReceiptResult" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT TRR.RESULT_ID "resultId",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RW.WAREHOUSE_NAME "warehouseName",
- TRR.INSERT_TIME "insertTime",
- TRR.INSERT_USERNAME "insertUsername"
- FROM TMSTRUCK_RECEIPT_RESULT TRR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = TRR.WAREHOUSE_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- WHERE OO.ORDER_TYPE = 4 AND TRR.STATUS = 1
- )
- <where>
- <if test="orderNumber != null">
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" like '%${item}%'
- </foreach>
- </if>
- <if test="insertTime != null">
- and
- <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
- "insertTime" like '%${item}%'
- </foreach>
- </if>
- <if test="insertUsername != null">
- and
- <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
- "insertUsername" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <select id="getInwardReceipt" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select TRR.RESULT_ID "resultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
- TUR.UNLOAD_STATUS "unloadStatus",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- tqr.result_issampling "issampling",
- TRR.INSERT_USERNAME "insertUsername",
- TRR.INSERT_TIME "insertTime",
- RW.WAREHOUSE_NAME "warehouseName"
- from TMSTRUCK_RECEIPT_RESULT TRR
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on OO.ORDER_ID = TTR.ORDER_ID
- left join AMSTRUCK_INWARD_PLAN AIP
- on AIP.PLAN_ID = OO.ORDER_PLAN_ID
- left join AMSTRUCK_REQUIREMENT_PLAN ARP
- on ARP.PLAN_ID = AIP.PLAN_ID
- left join AMSTRUCK_INWARD_REQUIREMENT AIR
- on AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
- left join DIL_BATCH DB
- on DB.BATCH_ID = APO.BATCH_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join TMSTRUCK_WEIGHT_RESULT TWR
- on TWR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
- left join TMSTRUCK_UNLOAD_RESULT TUR
- on TUR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OOM.ORDER_ID = OO.ORDER_ID
- left join RMS_MATERIAL RM
- on OOM.MATERIAL_ID = RM.MATERIAL_ID
- left join tmstruck_quality_result tqr
- on tqr.total_result_id = ttr.result_total_id
- left join RMS_WAREHOUSE RW
- on TUR.RESULT_UNLOAD_PLACE_ID = RW.WAREHOUSE_ID
- where TRR.STATUS = 1
- and OO.ORDER_TYPE = #{orderTypee}
- )
- <where>
- <if test="materialName != null">
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="purchaseOrderNo != null">
- and
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" like '%${item}%'
- </foreach>
- </if>
- <if test="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" like '%${item}%'
- </foreach>
- </if>
- <if test="unloadStatus != null">
- and
- <foreach collection="unloadStatus" item="item" open="(" separator="or" close=")">
- "unloadStatus" like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="issampling != null">
- and
- <foreach collection="issampling" item="item" open="(" separator="or" close=")">
- "issampling" like '%${item}%'
- </foreach>
- </if>
- <if test="insertUsername != null">
- and
- <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
- "insertUsername" like '%${item}%'
- </foreach>
- </if>
- <if test="insertTime != null">
- and
- <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
- "insertTime" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 查询是否已收过货 -->
- <select id="getReceiptResult" parameterType="java.math.BigDecimal" resultType="java.lang.Integer">
- select TRR.RESULT_ID
- from TMSTRUCK_RECEIPT_RESULT TRR
- where TRR.RESULT_TOTAL_ID = #{resultTotalId}
- </select>
- <!-- <select id="selectMaxId" resultType="java.math.BigDecimal">-->
- <!-- select max(RESULT_ID) from TMSTRUCK_RECEIPT_RESULT-->
- <!-- </select>-->
-
- <select id="getReceiptResultInfo" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select * from(
- select distinct a_s_order.SALE_NUMBER "saleNumber",
- o_torder.ORDER_NUMBER "orderNumber",
- r_material.MATERIAL_NAME "materialName",
- r_material.MATERIAL_MODEL "materialModel",
- r_capacity.CAPACITY_NUMBER "capacityNumber",
- r_shipper.SHIPPER_NAME "shipperName",
- r_consignee.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
- t_receipt.RESULT_ARRIVAL_ADDRESS "resultReceiptAddress",
- receive_address.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
- t_receipt.RESULT_EMPTY_CONTAINER_PHOTO "resultEmptyContainerPhoto",
- t_arrival.RESULT_FULL_CONTAINER_PHOTO "resultFullContainerPhoto",
- t_receipt.RESULT_SIGNED_NOTE_PHOTO "resultSignedNotePhoto",
- t_receipt.RESULT_RECEIVE_NOTE_PHOTO "resultReceiveNotePhoto",
- t_receiptchild.OTHER_PHOTO1 "otherPhoto1",
- t_receiptchild.OTHER_PHOTO2 "otherPhoto2",
- t_receiptchild.OTHER_PHOTO3 "otherPhoto3",
- t_receipt.INSERT_TIME "receiptTime",
- r_carrier.CARRIER_NAME "carrierName",
- r_gatepost.GATEPOST_NAME "gatepostName"
- from TMSTRUCK_RECEIPT_RESULT t_receipt
- left join TMSTRUCK_TOTAL_RESULT t_total
- on t_receipt.RESULT_TOTAL_ID=t_total.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER o_torder
- on t_total.ORDER_ID=o_torder.ORDER_ID
- left join RMS_CAPACITY r_capacity
- on o_torder.CAPACITY_ID=r_capacity.CAPACITY_ID
- left join RMS_DRIVER_CAPACITY r_d_capacity
- on r_capacity.CAPACITY_ID=r_d_capacity.CAPACITY_ID
- left join RMS_CARRIER r_carrier
- on o_torder.CARRIER_ID=r_carrier.CARRIER_ID
- left join RMS_CAR_DRIVER r_driver
- on r_d_capacity.DRIVER_ID=r_driver.DRIVER_ID
- left join AMS_SALE_ORDER_MATERIAL sale_material
- on o_torder.ORDER_PLAN_ID=sale_material.SALE_ORDER_MATERIAL_ID
- left join RMS_RECEIVE_ADDRESS receive_address
- on sale_material.SALE_SHIPPING_ADDRESS_ID=receive_address.ADDRESS_ID
- left join RMS_MATERIAL r_material
- on sale_material.MATERIAL_ID=r_material.MATERIAL_ID
- left join AMS_SALE_ORDER a_s_order
- on sale_material.SALE_ORDER_ID=a_s_order.SALE_ORDER_ID
- left join RMS_SHIPPER r_shipper
- on a_s_order.SHIPPER_ID=r_shipper.SHIPPER_ID
- left join RMS_CONSIGNEE r_consignee
- on a_s_order.CONSIGNEE_ID=r_consignee.CONSIGNEE_ID
- left join TMSTRUCK_RECEIPT_RESULT_CHILD t_receiptchild
- on t_receipt.RESULT_ID=t_receiptchild.RECEIPT_RESULT_ID
- left join TMSTRUCK_LEAVE_FACTORY_RESULT t_leave
- on t_total.RESULT_TOTAL_ID=t_leave.RESULT_TOTAL_ID
- LEFT JOIN RMS_GATEPOST r_gatepost
- ON t_leave.GATEPOST_ID = r_gatepost.GATEPOST_ID
- left join TMSTRUCK_ARRIVAL_RESULT t_arrival
- on t_total.RESULT_TOTAL_ID=t_arrival.RESULT_TOTAL_ID
- order by t_receipt.INSERT_TIME desc)
- <where>
- <if test="productClassification != null and productClassification != '其他' and productClassification != '螺纹钢'">
- and "materialName" like '%${productClassification}%'
- </if>
- <if test="productClassification != null and '螺纹钢' == productClassification">
- and ("materialName" like '%螺纹钢%' or "materialName" like '%盘螺%'
- or "materialName" like '%盘圆%' or "materialName" like '%非定尺材%')
- </if>
- <if test="productClassification != null and '其他' == productClassification">
- and "materialName" not like '%带钢%' and "materialName" not like '%微粉%'
- and "materialName" not like '%螺纹钢%' and "materialName" not like '%非定尺材%' and "materialName" not like '%钢坯%'
- and "materialName" not like '%盘螺%' and "materialName" not like '%盘圆%'
- </if>
- <if test="carrierName1 != null">
- and "carrierName" like '%${carrierName1}%'
- </if>
- <if test="gatepostName1 !=null">
- and "gatepostName" like '%${gatepostName1}%'
- </if>
- <if test="capacityNumber1 != null">
- and "capacityNumber" like '%${capacityNumber1}%'
- </if>
- <if test="consigneeCompanyName1 != null">
- and "consigneeCompanyName" like '%${consigneeCompanyName1}%'
- </if>
- <if test="startTime != null">
- and "receiptTime" >= to_date('${startTime}','yyyy-mm-dd')
- </if>
- <if test="endTime != null">
- and "receiptTime" <= to_date('${endTime}','yyyy-mm-dd')
- </if>
-
- <if test="saleNumber != null">
- and
- <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
- "saleNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="materialModel != null">
- and
- <foreach collection="materialModel" item="item" open="(" separator="or" close=")">
- "materialModel" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="shipperName != null">
- and
- <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
- "shipperName" like '%${item}%'
- </foreach>
- </if>
- <if test="consigneeCompanyName != null">
- and
- <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
- "consigneeCompanyName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultReceiptAddress != null">
- and
- <foreach collection="resultReceiptAddress" item="item" open="(" separator="or" close=")">
- "resultReceiptAddress" like '%${item}%'
- </foreach>
- </if>
- <if test="addressDeliveryAddress != null">
- and
- <foreach collection="addressDeliveryAddress" item="item" open="(" separator="or" close=")">
- "addressDeliveryAddress" like '%${item}%'
- </foreach>
- </if>
- <if test="receiptTime != null">
- and
- <foreach collection="receiptTime" item="item" open="(" separator="or" close=")">
- "receiptTime" like '%${item}%'
- </foreach>
- </if>
- <if test="carrierName != null">
- and
- <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
- "carrierName" like '%${item}%'
- </foreach>
- </if>
- <if test="gatepostName != null">
- and
- <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
- "gatepostName" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- </mapper>
|