123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656 |
- <?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.BmsshipDetailsOrderMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.BmsshipDetailsOrder">
- <id column="DETAILS_ID" jdbcType="DECIMAL" property="detailsId" />
- <result column="PURCHASE_ORDER_ID" jdbcType="DECIMAL" property="purchaseOrderId" />
- <result column="DETAILS_NO" jdbcType="VARCHAR" property="detailsNo" />
- <result column="DETAILS_TIME" jdbcType="TIMESTAMP" property="detailsTime" />
- <result column="DETAILS_FEE_TYPE" jdbcType="VARCHAR" property="detailsFeeType" />
- <result column="DETAILS_AMOUNT" jdbcType="DECIMAL" property="detailsAmount" />
- <result column="WETHER_TO_STATEMENT" jdbcType="DECIMAL" property="wetherToStatement" />
- <result column="TRUCK_RESULT_TOTAL_ID" jdbcType="DECIMAL" property="truckResultTotalId" />
- <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" />
- </resultMap>
- <sql id="columns">
- DETAILS_ID, PURCHASE_ORDER_ID, DETAILS_NO, DETAILS_TIME, DETAILS_FEE_TYPE, DETAILS_AMOUNT,
- WETHER_TO_STATEMENT, TRUCK_RESULT_TOTAL_ID, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK
- </sql>
- <sql id="columns_alias">
- t.DETAILS_ID, t.PURCHASE_ORDER_ID, t.DETAILS_NO, t.DETAILS_TIME, t.DETAILS_FEE_TYPE,
- t.DETAILS_AMOUNT, t.WETHER_TO_STATEMENT, t.TRUCK_RESULT_TOTAL_ID, t.INSERT_USERNAME,
- t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
- </sql>
- <sql id="select">
- SELECT <include refid="columns"/> FROM BMSSHIP_DETAILS_ORDER
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias"/> FROM BMSSHIP_DETAILS_ORDER t
- </sql>
- <sql id="where">
- <where>
- <if test="detailsId != null">
- and DETAILS_ID = #{detailsId}
- </if>
- <if test="purchaseOrderId != null">
- and PURCHASE_ORDER_ID = #{purchaseOrderId}
- </if>
- <if test="detailsNo != null and detailsNo != ''">
- and DETAILS_NO = #{detailsNo}
- </if>
- <if test="detailsTime != null">
- and TO_CHAR(DETAILS_TIME,'yyyy-MM-dd') = #{detailsTime}
- </if>
- <if test="detailsFeeType != null and detailsFeeType != ''">
- and DETAILS_FEE_TYPE = #{detailsFeeType}
- </if>
- <if test="detailsAmount != null">
- and DETAILS_AMOUNT = #{detailsAmount}
- </if>
- <if test="wetherToStatement != null">
- and WETHER_TO_STATEMENT = #{wetherToStatement}
- </if>
- <if test="truckResultTotalId != null">
- and TRUCK_RESULT_TOTAL_ID = #{truckResultTotalId}
- </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>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="detailsId != null">
- and DETAILS_ID = #{detailsId}
- </if>
- <if test="purchaseOrderId != null">
- and PURCHASE_ORDER_ID = #{purchaseOrderId}
- </if>
- <if test="detailsNo != null and detailsNo != ''">
- and DETAILS_NO LIKE '%${detailsNo}%'
- </if>
- <if test="detailsTime != null">
- and TO_CHAR(DETAILS_TIME,'yyyy-MM-dd') = #{detailsTime}
- </if>
- <if test="detailsFeeType != null and detailsFeeType != ''">
- and DETAILS_FEE_TYPE LIKE '%${detailsFeeType}%'
- </if>
- <if test="detailsAmount != null">
- and DETAILS_AMOUNT = #{detailsAmount}
- </if>
- <if test="wetherToStatement != null">
- and WETHER_TO_STATEMENT = #{wetherToStatement}
- </if>
- <if test="truckResultTotalId != null">
- and TRUCK_RESULT_TOTAL_ID = #{truckResultTotalId}
- </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>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
- delete from BMSSHIP_DETAILS_ORDER
- where DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from BMSSHIP_DETAILS_ORDER
- where 1!=1
- <if test="purchaseOrderId != null">
- or PURCHASE_ORDER_ID = #{purchaseOrderId}
- </if>
- <if test="detailsNo != null and detailsNo != ''">
- or DETAILS_NO = #{detailsNo}
- </if>
- <if test="detailsTime != null">
- or TO_CHAR(DETAILS_TIME,'yyyy-MM-dd') = '#{detailsTime}'
- </if>
- <if test="detailsFeeType != null and detailsFeeType != ''">
- or DETAILS_FEE_TYPE = #{detailsFeeType}
- </if>
- <if test="detailsAmount != null">
- or DETAILS_AMOUNT = #{detailsAmount}
- </if>
- <if test="wetherToStatement != null">
- or WETHER_TO_STATEMENT = #{wetherToStatement}
- </if>
- <if test="truckResultTotalId != null">
- or TRUCK_RESULT_TOTAL_ID = #{truckResultTotalId}
- </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>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.BmsshipDetailsOrder">
- insert into BMSSHIP_DETAILS_ORDER (DETAILS_ID, PURCHASE_ORDER_ID, DETAILS_NO,
- DETAILS_TIME, DETAILS_FEE_TYPE, DETAILS_AMOUNT,
- WETHER_TO_STATEMENT, TRUCK_RESULT_TOTAL_ID,
- INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK)
- values (#{detailsId,jdbcType=DECIMAL}, #{purchaseOrderId,jdbcType=DECIMAL}, #{detailsNo,jdbcType=VARCHAR},
- #{detailsTime,jdbcType=TIMESTAMP}, #{detailsFeeType,jdbcType=VARCHAR}, #{detailsAmount,jdbcType=DECIMAL},
- #{wetherToStatement,jdbcType=DECIMAL}, #{truckResultTotalId,jdbcType=DECIMAL},
- #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
- #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.BmsshipDetailsOrder">
- insert into BMSSHIP_DETAILS_ORDER
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="detailsId != null">
- DETAILS_ID,
- </if>
- <if test="purchaseOrderId != null">
- PURCHASE_ORDER_ID,
- </if>
- <if test="detailsNo != null">
- DETAILS_NO,
- </if>
- <if test="detailsTime != null">
- DETAILS_TIME,
- </if>
- <if test="detailsFeeType != null">
- DETAILS_FEE_TYPE,
- </if>
- <if test="detailsAmount != null">
- DETAILS_AMOUNT,
- </if>
- <if test="wetherToStatement != null">
- WETHER_TO_STATEMENT,
- </if>
- <if test="truckResultTotalId != null">
- TRUCK_RESULT_TOTAL_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="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="detailsId != null">
- #{detailsId,jdbcType=DECIMAL},
- </if>
- <if test="purchaseOrderId != null">
- #{purchaseOrderId,jdbcType=DECIMAL},
- </if>
- <if test="detailsNo != null">
- #{detailsNo,jdbcType=VARCHAR},
- </if>
- <if test="detailsTime != null">
- #{detailsTime,jdbcType=TIMESTAMP},
- </if>
- <if test="detailsFeeType != null">
- #{detailsFeeType,jdbcType=VARCHAR},
- </if>
- <if test="detailsAmount != null">
- #{detailsAmount,jdbcType=DECIMAL},
- </if>
- <if test="wetherToStatement != null">
- #{wetherToStatement,jdbcType=DECIMAL},
- </if>
- <if test="truckResultTotalId != null">
- #{truckResultTotalId,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="insertUpdateRemark != null">
- #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.BmsshipDetailsOrder">
- update BMSSHIP_DETAILS_ORDER
- set PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
- DETAILS_NO = #{detailsNo,jdbcType=VARCHAR},
- DETAILS_TIME = #{detailsTime,jdbcType=TIMESTAMP},
- DETAILS_FEE_TYPE = #{detailsFeeType,jdbcType=VARCHAR},
- DETAILS_AMOUNT = #{detailsAmount,jdbcType=DECIMAL},
- WETHER_TO_STATEMENT = #{wetherToStatement,jdbcType=DECIMAL},
- TRUCK_RESULT_TOTAL_ID = #{truckResultTotalId,jdbcType=DECIMAL},
- 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}
- where DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.BmsshipDetailsOrder">
- update BMSSHIP_DETAILS_ORDER
- <set>
- <if test="purchaseOrderId != null">
- PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
- </if>
- <if test="detailsNo != null">
- DETAILS_NO = #{detailsNo,jdbcType=VARCHAR},
- </if>
- <if test="detailsTime != null">
- DETAILS_TIME = #{detailsTime,jdbcType=TIMESTAMP},
- </if>
- <if test="detailsFeeType != null">
- DETAILS_FEE_TYPE = #{detailsFeeType,jdbcType=VARCHAR},
- </if>
- <if test="detailsAmount != null">
- DETAILS_AMOUNT = #{detailsAmount,jdbcType=DECIMAL},
- </if>
- <if test="wetherToStatement != null">
- WETHER_TO_STATEMENT = #{wetherToStatement,jdbcType=DECIMAL},
- </if>
- <if test="truckResultTotalId != null">
- TRUCK_RESULT_TOTAL_ID = #{truckResultTotalId,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>
- </set>
- where DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
- <include refid="select"/>
- where DETAILS_ID = #{detailsId,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 BMSSHIP_DETAILS_ORDER
- (DETAILS_ID,
- PURCHASE_ORDER_ID, DETAILS_NO, DETAILS_TIME,
- DETAILS_FEE_TYPE, DETAILS_AMOUNT,
- WETHER_TO_STATEMENT, TRUCK_RESULT_TOTAL_ID,
- INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME,
- INSERT_UPDATE_REMARK)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.detailsId,jdbcType=DECIMAL},
- #{item.purchaseOrderId,jdbcType=DECIMAL}, #{item.detailsNo,jdbcType=VARCHAR}, #{item.detailsTime,jdbcType=TIMESTAMP},
- #{item.detailsFeeType,jdbcType=VARCHAR}, #{item.detailsAmount,jdbcType=DECIMAL},
- #{item.wetherToStatement,jdbcType=DECIMAL}, #{item.truckResultTotalId,jdbcType=DECIMAL},
- #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
- #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
- #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update BMSSHIP_DETAILS_ORDER
- set
- DETAILS_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.detailsId,jdbcType=DECIMAL}
- </foreach>
- ,PURCHASE_ORDER_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.purchaseOrderId,jdbcType=DECIMAL}
- </foreach>
- ,DETAILS_NO=
- <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.detailsNo,jdbcType=VARCHAR}
- </foreach>
- ,DETAILS_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.detailsTime,jdbcType=TIMESTAMP}
- </foreach>
- ,DETAILS_FEE_TYPE=
- <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.detailsFeeType,jdbcType=VARCHAR}
- </foreach>
- ,DETAILS_AMOUNT=
- <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.detailsAmount,jdbcType=DECIMAL}
- </foreach>
- ,WETHER_TO_STATEMENT=
- <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.wetherToStatement,jdbcType=DECIMAL}
- </foreach>
- ,TRUCK_RESULT_TOTAL_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.truckResultTotalId,jdbcType=DECIMAL}
- </foreach>
- ,INSERT_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- where DETAILS_ID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.detailsId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from BMSSHIP_DETAILS_ORDER
- where DETAILS_ID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <!-- 得到最大id -->
- <select id="selectMaxId" resultType="DECIMAL">
- SELECT MAX(DETAILS_ID)+1 FROM BMSSHIP_DETAILS_ORDER
- </select>
- <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="getUncomplateDetailsOrderList" resultType="java.util.Map" parameterType="java.util.Map">
- SELECT * FROM(
- SELECT DISTINCT
- bdo.INSERT_TIME as "insertTime",
- bdo.DETAILS_ID as "detailsId",
- apo.RECEIVE_UNIT_ID as "statementShipperId",
- db.BATCH_ID as "batchId",
- apo.PURCHASE_ORDER_NO as "purchaseOrderNo",
- rm.MATERIAL_NAME as "materialName",
- db.RESULT_FOREIGN_SHIP_NAME as "resultForeignShipName",
- bdo.DETAILS_NO as "detailsNo",
- bdo.DETAILS_TIME as "detailsTime",
- bdo.DETAILS_FEE_TYPE as "detailsFeeType",
- srp.PORT_NAME as "startPort",
- erp.PORT_NAME as "endPort",
- twr.RESULT_NET_WEIGHT as "resultNetWeight",
- bdo.DETAILS_AMOUNT as "detailsAmount"
- FROM BMSSHIP_DETAILS_ORDER bdo
- LEFT JOIN AMS_PURCHASE_ORDER apo
- ON apo.PURCHASE_ORDER_ID = bdo.PURCHASE_ORDER_ID
- LEFT JOIN RMS_SHIPPER rs
- ON rs.SHIPPER_ID = apo.RECEIVE_UNIT_ID
- LEFT JOIN DIL_BATCH db
- ON db.BATCH_ID = apo.BATCH_ID
- LEFT JOIN RMS_MATERIAL rm
- ON rm.MATERIAL_ID = db.MATERIAL_ID
- LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS osi
- ON osi.BATCH_ID = db.BATCH_ID
- LEFT JOIN OMSSHIP_INSTRUCTIONS_CAPACITY oci
- ON osi.SHIPMENT_INSTRUCTIONS_ID = oci.INSTRUCTIONS_ID
- LEFT JOIN TMSSHIP_TOTAL_RESULT shiptr
- ON oci.INSTRUCTIONS_CAPACITY_ID = shiptr.ORDER_ID
- LEFT JOIN TMSSHIP_LOAD_SHIP_RESULT tlsr
- ON shiptr.RESULT_ID = tlsr.TOTAL_RESULT_ID
- LEFT JOIN RMS_PORT srp
- ON tlsr.LOCATION_START_PORT_ID = srp.PORT_ID
- LEFT JOIN RMS_PORT erp
- ON tlsr.ARRIVAL_PORT_ID = erp.PORT_ID
- LEFT JOIN AMSTRUCK_PURPLAN ap
- ON ap.BATCH_ID = db.BATCH_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr
- ON twr.RESULT_TOTAL_ID = bdo.TRUCK_RESULT_TOTAL_ID
- WHERE bdo.WETHER_TO_STATEMENT = 0
- )
- <where>
- <if test="purchaseOrderNo!= null">
- and
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="," close=")">
- "purchaseOrderNo" in #{item}
- </foreach>
- </if>
- <if test="materialName!= null">
- and
- <foreach collection="materialName" item="item" open="(" separator="," close=")">
- "materialName" in #{item}
- </foreach>
- </if>
- <if test="resultForeignShipName!= null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="," close=")">
- "resultForeignShipName" in #{item}
- </foreach>
- </if>
- <if test="detailsNo!= null">
- and
- <foreach collection="detailsNo" item="item" open="(" separator="," close=")">
- "detailsNo" in #{item}
- </foreach>
- </if>
- <if test="detailsTime!= null">
- and
- <foreach collection="detailsTime" item="item" open="(" separator="," close=")">
- "detailsTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="detailsFeeType!= null">
- and
- <foreach collection="detailsFeeType" item="item" open="(" separator="," close=")">
- "detailsFeeType" in #{item}
- </foreach>
- </if>
- <if test="startPort!= null">
- and
- <foreach collection="startPort" item="item" open="(" separator="," close=")">
- "startPort" in #{item}
- </foreach>
- </if>
- <if test="endPort!= null">
- and
- <foreach collection="endPort" item="item" open="(" separator="," close=")">
- "endPort" in #{item}
- </foreach>
- </if>
- <if test="resultNetWeight!= null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="," close=")">
- "resultNetWeight" in #{item}
- </foreach>
- </if>
- <if test="detailsAmount!= null">
- and
- <foreach collection="detailsAmount" item="item" open="(" separator="," close=")">
- "detailsAmount" in #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <select id="getDetailsOrderList" resultType="java.util.Map" parameterType="java.util.Map">
- SELECT * FROM(
- SELECT DISTINCT
- bdo.INSERT_TIME as "insertTime",
- bdo.DETAILS_ID as "detailsId",
- apo.RECEIVE_UNIT_ID as "statementShipperId",
- db.BATCH_ID as "batchId",
- apo.PURCHASE_ORDER_NO as "purchaseOrderNo",
- rm.MATERIAL_NAME as "materialName",
- db.RESULT_FOREIGN_SHIP_NAME as "resultForeignShipName",
- bdo.DETAILS_NO as "detailsNo",
- bdo.DETAILS_TIME as "detailsTime",
- bdo.DETAILS_FEE_TYPE as "detailsFeeType",
- srp.PORT_NAME as "startPort",
- erp.PORT_NAME as "endPort",
- twr.RESULT_NET_WEIGHT as "resultNetWeight",
- bdo.DETAILS_AMOUNT as "detailsAmount"
- FROM BMSSHIP_DETAILS_ORDER bdo
- LEFT JOIN AMS_PURCHASE_ORDER apo
- ON apo.PURCHASE_ORDER_ID = bdo.PURCHASE_ORDER_ID
- LEFT JOIN RMS_SHIPPER rs
- ON rs.SHIPPER_ID = apo.RECEIVE_UNIT_ID
- LEFT JOIN DIL_BATCH db
- ON db.BATCH_ID = apo.BATCH_ID
- left join DIL_BATCH_INFACOTRY dbi
- on dbi.BATCH_ID = db.BATCH_ID
- left join AMSSHIP_DELIVERY_NOTICE adn
- on adn.BATCH_ID = dbi.BATCH_INFACOTRY_ID
- LEFT JOIN RMS_MATERIAL rm
- ON rm.MATERIAL_ID = db.MATERIAL_ID
- LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS osi
- ON osi.BATCH_ID = db.BATCH_ID
- LEFT JOIN OMSSHIP_INSTRUCTIONS_CAPACITY oci
- ON osi.SHIPMENT_INSTRUCTIONS_ID = oci.INSTRUCTIONS_ID
- LEFT JOIN TMSSHIP_TOTAL_RESULT shiptr
- ON oci.INSTRUCTIONS_CAPACITY_ID = shiptr.ORDER_ID
- LEFT JOIN TMSSHIP_LOAD_SHIP_RESULT tlsr
- ON shiptr.RESULT_ID = tlsr.TOTAL_RESULT_ID
- LEFT JOIN RMS_PORT srp
- ON tlsr.LOCATION_START_PORT_ID = srp.PORT_ID
- LEFT JOIN RMS_PORT erp
- ON tlsr.ARRIVAL_PORT_ID = erp.PORT_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr
- ON twr.RESULT_TOTAL_ID = bdo.TRUCK_RESULT_TOTAL_ID
- )
- <where>
- <if test="purchaseOrderNo!= null">
- and
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="," close=")">
- "purchaseOrderNo" in #{item}
- </foreach>
- </if>
- <if test="materialName!= null">
- and
- <foreach collection="materialName" item="item" open="(" separator="," close=")">
- "materialName" in #{item}
- </foreach>
- </if>
- <if test="resultForeignShipName!= null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="," close=")">
- "resultForeignShipName" in #{item}
- </foreach>
- </if>
- <if test="detailsNo!= null">
- and
- <foreach collection="detailsNo" item="item" open="(" separator="," close=")">
- "detailsNo" in #{item}
- </foreach>
- </if>
- <if test="detailsTime!= null">
- and
- <foreach collection="detailsTime" item="item" open="(" separator="," close=")">
- "detailsTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="detailsFeeType!= null">
- and
- <foreach collection="detailsFeeType" item="item" open="(" separator="," close=")">
- "detailsFeeType" in #{item}
- </foreach>
- </if>
- <if test="startPort!= null">
- and
- <foreach collection="startPort" item="item" open="(" separator="," close=")">
- "startPort" in #{item}
- </foreach>
- </if>
- <if test="endPort!= null">
- and
- <foreach collection="endPort" item="item" open="(" separator="," close=")">
- "endPort" in #{item}
- </foreach>
- </if>
- <if test="resultNetWeight!= null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="," close=")">
- "resultNetWeight" in #{item}
- </foreach>
- </if>
- <if test="detailsAmount!= null">
- and
- <foreach collection="detailsAmount" item="item" open="(" separator="," close=")">
- "detailsAmount" in #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- </mapper>
|