123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582 |
- <?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.TmsshipTotalResultMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmsshipTotalResult">
- <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
- <result column="ORDER_ID" jdbcType="DECIMAL" property="orderId" />
- <result column="RESULT_DURATION" jdbcType="DECIMAL" property="resultDuration" />
- <result column="STANDARD_DATA_ID" jdbcType="DECIMAL" property="standardDataId" />
- <result column="RESULT_OUTLIER" jdbcType="DECIMAL" property="resultOutlier" />
- <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
- <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
- <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
- <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
- <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
- <result column="SHIP_STATUS" jdbcType="DECIMAL" property="shipStatus" />
- </resultMap>
- <sql id="columns">
- RESULT_ID, ORDER_ID, RESULT_DURATION, STANDARD_DATA_ID, RESULT_OUTLIER, INSERT_USERNAME,
- INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, SHIP_STATUS
- </sql>
- <sql id="columns_alias">
- t.RESULT_ID, t.ORDER_ID, t.RESULT_DURATION, t.STANDARD_DATA_ID, t.RESULT_OUTLIER,
- t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
- t.SHIP_STATUS
- </sql>
- <sql id="select">
- SELECT <include refid="columns"/> FROM TMSSHIP_TOTAL_RESULT
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias"/> FROM TMSSHIP_TOTAL_RESULT t
- </sql>
- <sql id="where">
- <where>
- <if test="resultId != null">
- and RESULT_ID = #{resultId}
- </if>
- <if test="orderId != null">
- and ORDER_ID = #{orderId}
- </if>
- <if test="resultDuration != null">
- and RESULT_DURATION = #{resultDuration}
- </if>
- <if test="standardDataId != null">
- and STANDARD_DATA_ID = #{standardDataId}
- </if>
- <if test="resultOutlier != null">
- and RESULT_OUTLIER = #{resultOutlier}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- and INSERT_USERNAME = #{insertUsername}
- </if>
- <if test="insertTime != null">
- and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- and UPDATE_USERNAME = #{updateUsername}
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- <if test="shipStatus != null">
- and SHIP_STATUS = #{shipStatus}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="resultId != null">
- and RESULT_ID = #{resultId}
- </if>
- <if test="orderId != null">
- and ORDER_ID = #{orderId}
- </if>
- <if test="resultDuration != null">
- and RESULT_DURATION = #{resultDuration}
- </if>
- <if test="standardDataId != null">
- and STANDARD_DATA_ID = #{standardDataId}
- </if>
- <if test="resultOutlier != null">
- and RESULT_OUTLIER = #{resultOutlier}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- and INSERT_USERNAME LIKE '%${insertUsername}%'
- </if>
- <if test="insertTime != null">
- and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- and UPDATE_USERNAME LIKE '%${updateUsername}%'
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
- </if>
- <if test="shipStatus != null">
- and SHIP_STATUS = #{shipStatus}
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
- delete from TMSSHIP_TOTAL_RESULT
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from TMSSHIP_TOTAL_RESULT
- where 1!=1
- <if test="orderId != null">
- or ORDER_ID = #{orderId}
- </if>
- <if test="resultDuration != null">
- or RESULT_DURATION = #{resultDuration}
- </if>
- <if test="standardDataId != null">
- or STANDARD_DATA_ID = #{standardDataId}
- </if>
- <if test="resultOutlier != null">
- or RESULT_OUTLIER = #{resultOutlier}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- or INSERT_USERNAME = #{insertUsername}
- </if>
- <if test="insertTime != null">
- or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- or UPDATE_USERNAME = #{updateUsername}
- </if>
- <if test="updateTime != null">
- or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- <if test="shipStatus != null">
- or SHIP_STATUS = #{shipStatus}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.TmsshipTotalResult">
- insert into TMSSHIP_TOTAL_RESULT (RESULT_ID, ORDER_ID, RESULT_DURATION,
- STANDARD_DATA_ID, RESULT_OUTLIER, INSERT_USERNAME,
- INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
- INSERT_UPDATE_REMARK, SHIP_STATUS)
- values (#{resultId,jdbcType=DECIMAL}, #{orderId,jdbcType=DECIMAL}, #{resultDuration,jdbcType=DECIMAL},
- #{standardDataId,jdbcType=DECIMAL}, #{resultOutlier,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR},
- #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
- #{insertUpdateRemark,jdbcType=VARCHAR}, #{shipStatus,jdbcType=DECIMAL})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmsshipTotalResult">
- insert into TMSSHIP_TOTAL_RESULT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="resultId != null">
- RESULT_ID,
- </if>
- <if test="orderId != null">
- ORDER_ID,
- </if>
- <if test="resultDuration != null">
- RESULT_DURATION,
- </if>
- <if test="standardDataId != null">
- STANDARD_DATA_ID,
- </if>
- <if test="resultOutlier != null">
- RESULT_OUTLIER,
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME,
- </if>
- <if test="insertTime != null">
- INSERT_TIME,
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME,
- </if>
- <if test="updateTime != null">
- UPDATE_TIME,
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK,
- </if>
- <if test="shipStatus != null">
- SHIP_STATUS,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="resultId != null">
- #{resultId,jdbcType=DECIMAL},
- </if>
- <if test="orderId != null">
- #{orderId,jdbcType=DECIMAL},
- </if>
- <if test="resultDuration != null">
- #{resultDuration,jdbcType=DECIMAL},
- </if>
- <if test="standardDataId != null">
- #{standardDataId,jdbcType=DECIMAL},
- </if>
- <if test="resultOutlier != null">
- #{resultOutlier,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>
- <if test="shipStatus != null">
- #{shipStatus,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmsshipTotalResult">
- update TMSSHIP_TOTAL_RESULT
- set ORDER_ID = #{orderId,jdbcType=DECIMAL},
- RESULT_DURATION = #{resultDuration,jdbcType=DECIMAL},
- STANDARD_DATA_ID = #{standardDataId,jdbcType=DECIMAL},
- RESULT_OUTLIER = #{resultOutlier,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},
- SHIP_STATUS = #{shipStatus,jdbcType=DECIMAL}
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmsshipTotalResult">
- update TMSSHIP_TOTAL_RESULT
- <set>
- <if test="orderId != null">
- ORDER_ID = #{orderId,jdbcType=DECIMAL},
- </if>
- <if test="resultDuration != null">
- RESULT_DURATION = #{resultDuration,jdbcType=DECIMAL},
- </if>
- <if test="standardDataId != null">
- STANDARD_DATA_ID = #{standardDataId,jdbcType=DECIMAL},
- </if>
- <if test="resultOutlier != null">
- RESULT_OUTLIER = #{resultOutlier,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="shipStatus != null">
- SHIP_STATUS = #{shipStatus,jdbcType=DECIMAL},
- </if>
- </set>
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
- <include refid="select"/>
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </select>
- <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="where"/>
- </select>
- <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="whereLike"/>
- </select>
- <insert id="batchInsert" parameterType="java.util.List">
- insert into TMSSHIP_TOTAL_RESULT
- (RESULT_ID,
- ORDER_ID, RESULT_DURATION, STANDARD_DATA_ID,
- RESULT_OUTLIER, INSERT_USERNAME,
- INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK,
- SHIP_STATUS)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.resultId,jdbcType=DECIMAL},
- #{item.orderId,jdbcType=DECIMAL}, #{item.resultDuration,jdbcType=DECIMAL}, #{item.standardDataId,jdbcType=DECIMAL},
- #{item.resultOutlier,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
- #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
- #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
- #{item.shipStatus,jdbcType=DECIMAL} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update TMSSHIP_TOTAL_RESULT
- set
- RESULT_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
- </foreach>
- ,ORDER_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.orderId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_DURATION=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultDuration,jdbcType=DECIMAL}
- </foreach>
- ,STANDARD_DATA_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.standardDataId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_OUTLIER=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultOutlier,jdbcType=DECIMAL}
- </foreach>
- ,INSERT_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- ,SHIP_STATUS=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.shipStatus,jdbcType=DECIMAL}
- </foreach>
- where RESULT_ID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.resultId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from TMSSHIP_TOTAL_RESULT
- where RESULT_ID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <select id="selectMaxId" resultType="DECIMAL">
- SELECT MAX(RESULT_ID) + 1
- FROM TMSSHIP_TOTAL_RESULT
- </select>
- <select id="selectResultTotalId" resultType="DECIMAL">
- SELECT RESULT_ID
- FROM TMSSHIP_TOTAL_RESULT
- WHERE ORDER_ID = #{orderId}
- </select>
- <sql id="orderByInsertTime">
- <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="selectOrderList" resultType="java.util.Map">
- select * from (
- SELECT DISTINCT
- ttr.ORDER_ID as "orderId",
- ttr.INSERT_TIME as "insertTime",
- rm.MATERIAL_NAME as "materialName",
- dbi.INFACTORY_SHIP_NAME as "infactoryShipName",--进厂船名
- db.RESULT_FOREIGN_SHIP_NAME as "foreignShipName",
- rc.CAPACITY_NUMBER as "capacityName",
- rp.PORT_NAME as "supplierAbbreviation",
- pier.PIER_NAME as "groupName",
- rps.PORT_NAME as "startPortName",
- rpe.PORT_NAME as "arrivePortName",
- oic.INSTRUCTION_PLANNED_LOADING as "planWeight",
- tlsr.RESULT_ARRIVAL_PORT_TIME as "arriveTime",
- tlsr.RESULT_OUT_PORT_TIME as "liveTime",
- tlsr.RESULT_LOAD_SHIP_DATE as "resultLoadShipDate",
- tlsr.RESULT_ACTUAL_INSTALLATIONS as "realWeight",
- tlsr.INSERT_UPDATE_REMARK as "resultMemo",
- tlsr.RESULT_DELIVERY_DATE as "deliveryTime",
- tlsr.RESULT_NUMBER as "resultNumber",
- tlsr.RESULT_ISCLEAR as "isClear", --是否清场
- adn.PURCHASE_CONTRACT_MOISTURE as "purchaseContactMoisture",--合同水分值
- towr.RESULT_OUT_WHARY_NAME as "outWharyName",--离港确认人
- twqr.RESULT_EMPTY_HEAVY_WATER_METER as "emptyHeavyWaterMeter",--空舱/重载水尺米
- twqr.RESULT_INSPECTION_FEES as "inspectionFees",--检测费
- twqr.RESULT_PLANNED_DATE as "plannedDate",--计划日期
- twqr.RESULT_ES_DELIVERY_DATE as "deliveryDate",--预计放货日期
- twqr.IS_NEED_ASSEMBLE as "isNeedAssemble",--是否拼装
- twqr.WATER_UNIT_PRICE as "waterUnitPrice",--单价
- twqr.RESULT_MOISTURE_CONTENT as "moistubeContent",--含水率
- twqr.RESULT_WATER_TONNAGE as "waterTonnage"--水分吨位
- FROM TMSSHIP_TOTAL_RESULT ttr
- LEFT JOIN OMSSHIP_INSTRUCTIONS_CAPACITY oic
- ON oic.INSTRUCTIONS_CAPACITY_ID = ttr.ORDER_ID
- LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS osi
- ON osi.SHIPMENT_INSTRUCTIONS_ID = oic.INSTRUCTIONS_ID
- left join DIL_BATCH_INFACOTRY dbi --批次中间表
- on osi.BATCH_ID=dbi.BATCH_INFACOTRY_ID
- LEFT JOIN DIL_BATCH db
- ON dbi.BATCH_ID = db.BATCH_ID
- LEFT JOIN RMS_MATERIAL rm
- ON db.MATERIAL_ID = rm.MATERIAL_ID
- LEFT JOIN AMSSHIP_DELIVERY_ATTORNEY ada
- on osi.BATCH_ID = ada.BATCH_ID
- LEFT JOIN AMSSHIP_DELIVERY_NOTICE adn
- on adn.BATCH_ID = ada.BATCH_ID
- LEFT JOIN RMS_PORT rp
- ON ada.CARRIER_ID = rp.PORT_ID
- LEFT JOIN RMS_PIER pier
- ON pier.PIER_ID = adn.GROUP_ID
- LEFT JOIN TMSSHIP_LOAD_SHIP_RESULT tlsr
- ON ttr.RESULT_ID = tlsr.TOTAL_RESULT_ID
- LEFT JOIN RMS_PORT rps
- ON ada.DOWN_SWIM_PORT_ID = rps.PORT_ID
- LEFT JOIN RMS_PORT rpe
- ON ada.PORT_ID = rpe.PORT_ID
- LEFT JOIN RMS_CAPACITY rc
- ON rc.CAPACITY_ID = oic.CAPACITY_ID
- LEFT JOIN TMSSHIP_WATER_QUALITY_RESULT twqr
- ON ttr.RESULT_ID=twqr.TOTAL_RESULT_ID
- LEFT JOIN TMSSHIP_OUT_WHARY_RESULT towr
- ON ttr.RESULT_ID =towr.TOTAL_RESULT_ID
- where tlsr.DELETED=0 and adn.DELETED=0 and ada.DELETED=0
- and oic.DELETED=0 and osi.DELETED=0
- )
- <where>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="," close=")">
- "materialName" in #{item}
- </foreach>
- </if>
- <if test="foreignShipName != null">
- and
- <foreach collection="foreignShipName" item="item" open="(" separator="," close=")">
- "foreignShipName" in #{item}
- </foreach>
- </if>
- <if test="capacityName != null">
- and
- <foreach collection="capacityName" item="item" open="(" separator="," close=")">
- "capacityName" in #{item}
- </foreach>
- </if>
- <if test="shipperAbbreviation != null">
- and
- <foreach collection="shipperAbbreviation" item="item" open="(" separator="," close=")">
- "shipperAbbreviation" in #{item}
- </foreach>
- </if>
- <if test="supplierAbbreviation != null">
- and
- <foreach collection="supplierAbbreviation" item="item" open="(" separator="," close=")">
- "supplierAbbreviation" in #{item}
- </foreach>
- </if>
- <if test="groupName != null">
- and
- <foreach collection="groupName" item="item" open="(" separator="," close=")">
- "groupName" in #{item}
- </foreach>
- </if>
- <if test="resultLoadShipDate != null">
- and
- <foreach collection="resultLoadShipDate" item="item" open="(" separator="," close=")">
- "resultLoadShipDate" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="startPortName != null">
- and
- <foreach collection="startPortName" item="item" open="(" separator="," close=")">
- "startPortName" in #{item}
- </foreach>
- </if>
- <if test="arrivePortName != null">
- and
- <foreach collection="arrivePortName" item="item" open="(" separator="," close=")">
- "arrivePortName" in #{item}
- </foreach>
- </if>
- <if test="arriveTime != null">
- and
- <foreach collection="arriveTime" item="item" open="(" separator="," close=")">
- "arriveTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="liveTime != null">
- and
- <foreach collection="liveTime" item="item" open="(" separator="," close=")">
- "liveTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="planWeight != null">
- and
- <foreach collection="planWeight" item="item" open="(" separator="," close=")">
- "planWeight" in #{item}
- </foreach>
- </if>
- <if test="realWeight != null">
- and
- <foreach collection="realWeight" item="item" open="(" separator="," close=")">
- "realWeight" in #{item}
- </foreach>
- </if>
- <if test="resultMemo != null">
- and
- <foreach collection="resultMemo" item="item" open="(" separator="," close=")">
- "resultMemo" in #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderByInsertTime"></include>
- </select>
- <select id="getCapacity" resultType="java.util.Map">
- SELECT DISTINCT
- DBI.INFACTORY_SHIP_NAME "infactoryShipName",
- db.RESULT_FOREIGN_SHIP_NAME AS "resultForeignShipName",
- rm.MATERIAL_NAME AS "materialName",
- rc.CAPACITY_NUMBER AS "capacityNumber",
- oic.INSTRUCTIONS_CAPACITY_ID AS "orderId",
- DBI.BATCH_INFACOTRY_ID AS "batchInfactoryId",
- ada.DOWN_SWIM_PORT_ID AS "downSwimPortId",
- rp1.PORT_NAME AS "portName1",
- ada.PORT_ID AS "portId",
- rp2.PORT_NAME AS "portName2",
- oic.INSTRUCTIONS_SHIP_POSITION "instructionsShipPosition"
- FROM
- OMSSHIP_INSTRUCTIONS_CAPACITY oic
- LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS osi ON oic.INSTRUCTIONS_ID = osi.SHIPMENT_INSTRUCTIONS_ID
- LEFT JOIN DIL_BATCH_INFACOTRY DBI ON DBI.BATCH_INFACOTRY_ID = osi.BATCH_ID
- LEFT JOIN DIL_BATCH db ON db.BATCH_ID = DBI.BATCH_ID
- LEFT JOIN AMSSHIP_DELIVERY_ATTORNEY ada ON ada.BATCH_ID = DBI.BATCH_INFACOTRY_ID
- LEFT JOIN RMS_PORT rp1 ON ada.DOWN_SWIM_PORT_ID = rp1.PORT_ID
- LEFT JOIN RMS_PORT rp2 ON ada.PORT_ID = rp2.PORT_ID
- LEFT JOIN RMS_MATERIAL rm ON rm.MATERIAL_ID = db.MATERIAL_ID
- LEFT JOIN RMS_CAPACITY rc ON rc.CAPACITY_ID = oic.CAPACITY_ID
- WHERE OSI.DELETED = 0
- AND OIC.DELETED = 0
- AND ADA.DELETED = 0
- AND OSI.INSTRUCTION_ISSUE_STATUS='已下发'
- <if test="con!=null">
- AND (DB.RESULT_FOREIGN_SHIP_NAME like concat('%', concat(#{con},'%'))
- or RM.MATERIAL_NAME like concat('%', concat(#{con}, '%'))
- or DBI.BATCH_INFACOTRY_ID like concat('%', concat(#{con}, '%'))
- or rc.CAPACITY_NUMBER like concat('%', concat(#{con}, '%'))
- or DBI.INFACTORY_SHIP_NAME like concat('%', concat(#{con}, '%'))
- )
- </if>
- </select>
- </mapper>
|