123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827 |
- <?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.AmstruckInwardPlanMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmstruckInwardPlan">
- <id column="PLAN_ID" jdbcType="DECIMAL" property="planId" />
- <result column="PLAN_NUMBER" jdbcType="VARCHAR" property="planNumber" />
- <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
- <result column="PLAN_TRUCK_NUMBER" jdbcType="DECIMAL" property="planTruckNumber" />
- <result column="PLAN_STATUS" jdbcType="DECIMAL" property="planStatus" />
- <result column="PLAN_ISSUE_TIME" jdbcType="TIMESTAMP" property="planIssueTime" />
- <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="DELETED" jdbcType="DECIMAL" property="deleted" />
- <result column="PLAN_ISSUE_NAME" jdbcType="VARCHAR" property="planIssueName" />
- <result column="PLAN_EABLE_STATUS" jdbcType="DECIMAL" property="planEableStatus" />
- </resultMap>
- <sql id="columns">
- PLAN_ID, PLAN_NUMBER, CARRIER_ID, PLAN_TRUCK_NUMBER, PLAN_STATUS, PLAN_ISSUE_TIME,
- INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
- DELETED, PLAN_ISSUE_NAME, PLAN_EABLE_STATUS
- </sql>
- <sql id="columns_alias">
- t.PLAN_ID, t.PLAN_NUMBER, t.CARRIER_ID, t.PLAN_TRUCK_NUMBER, t.PLAN_STATUS, t.PLAN_ISSUE_TIME,
- t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
- t.DELETED, t.PLAN_ISSUE_NAME, t.PLAN_EABLE_STATUS
- </sql>
- <sql id="select">
- SELECT <include refid="columns" /> FROM AMSTRUCK_INWARD_PLAN
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias" /> FROM AMSTRUCK_INWARD_PLAN t
- </sql>
- <sql id="where">
- <where>
- <if test="planId != null">
- and PLAN_ID = #{planId}
- </if>
- <if test="planNumber != null and planNumber != ''">
- and PLAN_NUMBER = #{planNumber}
- </if>
- <if test="carrierId != null">
- and CARRIER_ID = #{carrierId}
- </if>
- <if test="planTruckNumber != null">
- and PLAN_TRUCK_NUMBER = #{planTruckNumber}
- </if>
- <if test="planStatus != null">
- and PLAN_STATUS = #{planStatus}
- </if>
- <if test="planIssueTime != null">
- and TO_CHAR(PLAN_ISSUE_TIME,'yyyy-MM-dd') = #{planIssueTime}
- </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="deleted != null">
- and DELETED = #{deleted}
- </if>
- <if test="planIssueName != null and planIssueName != ''">
- and PLAN_ISSUE_NAME = #{planIssueName}
- </if>
- <if test="planEableStatus != null">
- and PLAN_EABLE_STATUS = #{planEableStatus}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="planId != null">
- and PLAN_ID = #{planId}
- </if>
- <if test="planNumber != null and planNumber != ''">
- and PLAN_NUMBER LIKE '%${planNumber}%'
- </if>
- <if test="carrierId != null">
- and CARRIER_ID = #{carrierId}
- </if>
- <if test="planTruckNumber != null">
- and PLAN_TRUCK_NUMBER = #{planTruckNumber}
- </if>
- <if test="planStatus != null">
- and PLAN_STATUS = #{planStatus}
- </if>
- <if test="planIssueTime != null">
- and TO_CHAR(PLAN_ISSUE_TIME,'yyyy-MM-dd') = #{planIssueTime}
- </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="deleted != null">
- and DELETED = #{deleted}
- </if>
- <if test="planIssueName != null and planIssueName != ''">
- and PLAN_ISSUE_NAME LIKE '%${planIssueName}%'
- </if>
- <if test="planEableStatus != null">
- and PLAN_EABLE_STATUS = #{planEableStatus}
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="DECIMAL">
- delete from AMSTRUCK_INWARD_PLAN
- where PLAN_ID = #{planId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from AMSTRUCK_INWARD_PLAN
- where 1!=1
- <if test="planNumber != null and planNumber != ''">
- or PLAN_NUMBER = #{planNumber}
- </if>
- <if test="carrierId != null">
- or CARRIER_ID = #{carrierId}
- </if>
- <if test="planTruckNumber != null">
- or PLAN_TRUCK_NUMBER = #{planTruckNumber}
- </if>
- <if test="planStatus != null">
- or PLAN_STATUS = #{planStatus}
- </if>
- <if test="planIssueTime != null">
- or TO_CHAR(PLAN_ISSUE_TIME,'yyyy-MM-dd') = '#{planIssueTime}'
- </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="deleted != null">
- or DELETED = #{deleted}
- </if>
- <if test="planIssueName != null and planIssueName != ''">
- or PLAN_ISSUE_NAME = #{planIssueName}
- </if>
- <if test="planEableStatus != null">
- or PLAN_EABLE_STATUS = #{planEableStatus}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.AmstruckInwardPlan">
- insert into AMSTRUCK_INWARD_PLAN (PLAN_ID, PLAN_NUMBER, CARRIER_ID,
- PLAN_TRUCK_NUMBER, PLAN_STATUS, PLAN_ISSUE_TIME,
- INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
- PLAN_ISSUE_NAME, PLAN_EABLE_STATUS)
- values (#{planId,jdbcType=DECIMAL}, #{planNumber,jdbcType=VARCHAR}, #{carrierId,jdbcType=DECIMAL},
- #{planTruckNumber,jdbcType=DECIMAL}, #{planStatus,jdbcType=DECIMAL}, #{planIssueTime,jdbcType=TIMESTAMP},
- #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
- #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
- #{planIssueName,jdbcType=VARCHAR}, #{planEableStatus,jdbcType=DECIMAL})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmstruckInwardPlan">
- insert into AMSTRUCK_INWARD_PLAN
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="planId != null">
- PLAN_ID,
- </if>
- <if test="planNumber != null">
- PLAN_NUMBER,
- </if>
- <if test="carrierId != null">
- CARRIER_ID,
- </if>
- <if test="planTruckNumber != null">
- PLAN_TRUCK_NUMBER,
- </if>
- <if test="planStatus != null">
- PLAN_STATUS,
- </if>
- <if test="planIssueTime != null">
- PLAN_ISSUE_TIME,
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME,
- </if>
- <if test="insertTime != null">
- INSERT_TIME,
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME,
- </if>
- <if test="updateTime != null">
- UPDATE_TIME,
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK,
- </if>
- <if test="deleted != null">
- DELETED,
- </if>
- <if test="planIssueName != null">
- PLAN_ISSUE_NAME,
- </if>
- <if test="planEableStatus != null">
- PLAN_EABLE_STATUS,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="planId != null">
- #{planId,jdbcType=DECIMAL},
- </if>
- <if test="planNumber != null">
- #{planNumber,jdbcType=VARCHAR},
- </if>
- <if test="carrierId != null">
- #{carrierId,jdbcType=DECIMAL},
- </if>
- <if test="planTruckNumber != null">
- #{planTruckNumber,jdbcType=DECIMAL},
- </if>
- <if test="planStatus != null">
- #{planStatus,jdbcType=DECIMAL},
- </if>
- <if test="planIssueTime != null">
- #{planIssueTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUsername != null">
- #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUpdateRemark != null">
- #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- <if test="deleted != null">
- #{deleted,jdbcType=DECIMAL},
- </if>
- <if test="planIssueName != null">
- #{planIssueName,jdbcType=VARCHAR},
- </if>
- <if test="planEableStatus != null">
- #{planEableStatus,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmstruckInwardPlan">
- update AMSTRUCK_INWARD_PLAN
- set PLAN_NUMBER = #{planNumber,jdbcType=VARCHAR},
- CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
- PLAN_TRUCK_NUMBER = #{planTruckNumber,jdbcType=DECIMAL},
- PLAN_STATUS = #{planStatus,jdbcType=DECIMAL},
- PLAN_ISSUE_TIME = #{planIssueTime,jdbcType=TIMESTAMP},
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- DELETED = #{deleted,jdbcType=DECIMAL},
- PLAN_ISSUE_NAME = #{planIssueName,jdbcType=VARCHAR},
- PLAN_EABLE_STATUS = #{planEableStatus,jdbcType=DECIMAL}
- where PLAN_ID = #{planId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmstruckInwardPlan">
- update AMSTRUCK_INWARD_PLAN
- <set>
- <if test="planNumber != null">
- PLAN_NUMBER = #{planNumber,jdbcType=VARCHAR},
- </if>
- <if test="carrierId != null">
- CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
- </if>
- <if test="planTruckNumber != null">
- PLAN_TRUCK_NUMBER = #{planTruckNumber,jdbcType=DECIMAL},
- </if>
- <if test="planStatus != null">
- PLAN_STATUS = #{planStatus,jdbcType=DECIMAL},
- </if>
- <if test="planIssueTime != null">
- PLAN_ISSUE_TIME = #{planIssueTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- <if test="deleted != null">
- DELETED = #{deleted,jdbcType=DECIMAL},
- </if>
- <if test="planIssueName != null">
- PLAN_ISSUE_NAME = #{planIssueName,jdbcType=VARCHAR},
- </if>
- <if test="planEableStatus != null">
- PLAN_EABLE_STATUS = #{planEableStatus,jdbcType=DECIMAL},
- </if>
- </set>
- where PLAN_ID = #{planId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="DECIMAL" resultMap="BaseResultMap">
- <include refid="select" />
- where PLAN_ID = #{planId,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 AMSTRUCK_INWARD_PLAN
- (PLAN_ID,
- PLAN_NUMBER, CARRIER_ID, PLAN_TRUCK_NUMBER,
- PLAN_STATUS, PLAN_ISSUE_TIME,
- INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME,
- INSERT_UPDATE_REMARK, DELETED,
- PLAN_ISSUE_NAME, PLAN_EABLE_STATUS
- )
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.planId,jdbcType=DECIMAL},
- #{item.planNumber,jdbcType=VARCHAR}, #{item.carrierId,jdbcType=DECIMAL}, #{item.planTruckNumber,jdbcType=DECIMAL},
- #{item.planStatus,jdbcType=DECIMAL}, #{item.planIssueTime,jdbcType=TIMESTAMP},
- #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
- #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
- #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL},
- #{item.planIssueName,jdbcType=VARCHAR}, #{item.planEableStatus,jdbcType=DECIMAL}
- from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update AMSTRUCK_INWARD_PLAN
- set
- PLAN_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
- when #{item.planId,jdbcType=DECIMAL} then #{item.planId,jdbcType=DECIMAL}
- </foreach>
- ,PLAN_NUMBER=
- <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
- when #{item.planId,jdbcType=DECIMAL} then #{item.planNumber,jdbcType=VARCHAR}
- </foreach>
- ,CARRIER_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
- when #{item.planId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
- </foreach>
- ,PLAN_TRUCK_NUMBER=
- <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
- when #{item.planId,jdbcType=DECIMAL} then #{item.planTruckNumber,jdbcType=DECIMAL}
- </foreach>
- ,PLAN_STATUS=
- <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
- when #{item.planId,jdbcType=DECIMAL} then #{item.planStatus,jdbcType=DECIMAL}
- </foreach>
- ,PLAN_ISSUE_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
- when #{item.planId,jdbcType=DECIMAL} then #{item.planIssueTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
- when #{item.planId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
- when #{item.planId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
- when #{item.planId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
- when #{item.planId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
- when #{item.planId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- ,DELETED=
- <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
- when #{item.planId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
- </foreach>
- ,PLAN_ISSUE_NAME=
- <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
- when #{item.planId,jdbcType=DECIMAL} then #{item.planIssueName,jdbcType=VARCHAR}
- </foreach>
- ,PLAN_EABLE_STATUS=
- <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
- when #{item.planId,jdbcType=DECIMAL} then #{item.planEableStatus,jdbcType=DECIMAL}
- </foreach>
- where PLAN_ID in
- <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
- #{item.planId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from AMSTRUCK_INWARD_PLAN
- where PLAN_ID in
- <foreach close=")" collection="list" item="id" open="(" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <select id="getTruckPlanList" resultType="java.util.Map" parameterType="java.util.Map">
- SELECT *
- FROM (SELECT AIP.PLAN_NUMBER AS "planNumber",
- RCA.CARRIER_NAME AS "carrierName",
- AIP.PLAN_TRUCK_NUMBER AS "planTruckNumber",
- AIR.REQUIREMENT_NUMBER AS "requirementNumber",
- AIR.REQUIREMENT_TYPE AS "requirementType",
- AIR.REQUIREMENT_TRUCK_TIME AS "requirementTruckTime",
- AIR.REQUIREMENT_ID AS "requirementId",
- AIR.REQUIREMENT_WORK_TYPE AS "requirementWorkType",
- AIR.REQUIREMENT_WORK_CONTENT AS "requirementWorkContent",
- AIR.REQUIREMENT_WORK_ENVIRONMENT AS "requirementWorkEnvironment",
- AIR.REQUIREMENT_ESTIMATED_DURATION AS "requirementEstimatedDuration",
- AIR.LOADING_REMARK AS "loadingRemark",
- RTR.TRANS_RANGE_VALUE AS "rangeValue",
- AIP.PLAN_ID AS "planId",
- AIP.INSERT_TIME AS "insertTime",
- RS.SHIPPER_NAME AS "shipperName"
- FROM AMSTRUCK_INWARD_PLAN AIP
- 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 RMS_CARRIER RCA
- ON RCA.CARRIER_ID = AIP.CARRIER_ID
- LEFT JOIN RMS_SHIPPER RS
- ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
- LEFT JOIN RMS_TRANS_RANGE RTR
- ON RTR.TRANS_RANGE_ID = AIR.LINE_ID
- WHERE AIP.PLAN_STATUS = #{planStatus}
- AND AIP.DELETED = 0
- AND AIR.PURCHASE_ORDER_ID IS NULL
- )
- <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="materialNumber != null">
- and
- <foreach collection="materialNumber" item="item" open="(" separator="or" close=")">
- "materialNumber" 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="requirementNumber != null">
- and
- <foreach collection="requirementNumber" item="item" open="(" separator="or" close=")">
- "requirementNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="requirementType != null">
- and
- <foreach collection="requirementType" item="item" open="(" separator="or" close=")">
- "requirementType" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityTypeName != null">
- and
- <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
- "capacityTypeName" like '%${item}%'
- </foreach>
- </if>
- <if test="requirementTruckTime != null">
- and
- <foreach collection="requirementTruckTime" item="item" open="(" separator="or" close=")">
- "requirementTruckTime" like '%${item}%'
- </foreach>
- </if>
- <if test="requirementWorkType != null">
- and
- <foreach collection="requirementWorkType" item="item" open="(" separator="or" close=")">
- "requirementWorkType" like '%${item}%'
- </foreach>
- </if>
- <if test="requirementWorkContent != null">
- and
- <foreach collection="requirementWorkContent" item="item" open="(" separator="or" close=")">
- "requirementWorkContent" like '%${item}%'
- </foreach>
- </if>
- <if test="requirementWorkEnvironment != null">
- and
- <foreach collection="requirementWorkEnvironment" item="item" open="(" separator="or" close=")">
- "requirementWorkEnvironment" like '%${item}%'
- </foreach>
- </if>
- <if test="requirementEstimatedDuration != null">
- and
- <foreach collection="requirementEstimatedDuration" item="item" open="(" separator="or" close=")">
- "requirementEstimatedDuration" like '%${item}%'
- </foreach>
- </if>
- <if test="planNumber != null">
- and
- <foreach collection="planNumber" item="item" open="(" separator="or" close=")">
- "planNumber" 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="planTruckNumber != null">
- and
- <foreach collection="planTruckNumber" item="item" open="(" separator="or" close=")">
- "planTruckNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="wareHouseName != null">
- and
- <foreach collection="wareHouseName" item="item" open="(" separator="or" close=")">
- "wareHouseName" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 展示运输计划 -->
- <select id="getIssuedPlanList" resultType="java.util.Map" parameterType="java.util.Map">
- select *
- from (SELECT AIP.PLAN_NUMBER AS "planNumber",
- RCA.CARRIER_NAME AS "carrierName",
- RTR.TRANS_RANGE_VALUE AS "rangeValue",
- AIP.PLAN_TRUCK_NUMBER AS "planTruckNumber",
- AIR.REQUIREMENT_NUMBER AS "requirementNumber",
- AIP.PLAN_ISSUE_TIME AS "planIssueTime",
- AIP.PLAN_ISSUE_NAME AS "planIssueName",
- AIR.REQUIREMENT_TYPE AS "requirementType",
- AIR.REQUIREMENT_TRUCK_TIME AS "requirementTruckTime",
- AIR.REQUIREMENT_WORK_TYPE AS "requirementWorkType",
- AIR.REQUIREMENT_WORK_CONTENT AS "requirementWorkContent",
- AIR.REQUIREMENT_WORK_ENVIRONMENT AS "requirementWorkEnvironment",
- AIR.REQUIREMENT_ESTIMATED_DURATION AS "requirementEstimatedDuration",
- AIR.REQUIREMENT_ID AS "requirementId",
- AIR.LOADING_REMARK AS "loadingRemark",
- AIP.PLAN_ID AS "planId",
- AIP.CARRIER_ID AS "carrierId",
- AIP.INSERT_TIME AS "insertTime",
- RS.SHIPPER_NAME AS "shipperName",
- AIR.DUE_DATE AS "dueDate",
- AIR.INSERT_USERNAME AS "insertUsername",
- rw1.warehouse_name "unloadName",
- rw1.WAREHOUSE_ID "unloadId",
- rw2.warehouse_name "loadName",
- rw2.WAREHOUSE_ID "loadId",
- arm.material_weight "materialWeight",
- arm.material_count "materialCount",
- arm.MATERIAL_ID "materialId",
- rm.material_name || rm.material_specification || '(' ||
- rm.material_model || ')' "materialName",
- AIR.INSERT_UPDATE_REMARK "Tel"
- FROM AMSTRUCK_INWARD_PLAN AIP
- 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 RMS_SHIPPER RS
- ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
- LEFT JOIN RMS_CARRIER RCA
- ON RCA.CARRIER_ID = AIP.CARRIER_ID
- LEFT JOIN amstruck_requirement_material arm
- ON air.requirement_id = arm.requirement_id
- LEFT JOIN rms_warehouse rw1
- ON rw1.warehouse_id = arm.requirement_unload_unit_id
- LEFT JOIN rms_warehouse rw2
- ON rw2.warehouse_id = arm.requirement_platform_id
- LEFT JOIN rms_material rm
- ON rm.material_id = arm.material_id
- LEFT JOIN RMS_TRANS_RANGE RTR
- ON RTR.TRANS_RANGE_ID = AIR.LINE_ID
- WHERE AIP.DELETED = 0
- AND AIR.PURCHASE_ORDER_ID IS NULL
- <if test="planId != null">
- and AIP.PLAN_ID = #{planId}
- </if>
- <if test="carrierId != null">
- and (select
- rc.carrier_sso_id from rms_carrier rc
- where rc.carrier_id = AIP.CARRIER_ID) = #{carrierId}
- </if>
- <if test="planStatus == 0">
- and AIP.PLAN_STATUS = 0
- </if>
- <if test="planStatus == 1">
- and AIP.PLAN_STATUS in (1,2)
- </if>
- <if test="planStatus == 4">
- and to_date(#{newTime}, 'yyyy-mm-dd hh24:mi:ss') >= AIR.DUE_DATE
- </if>
- <if test="planStatus == 2">
- and AIP.PLAN_STATUS = 2
- </if>
- <if test="planStatus == 3">
- and to_date(#{newTime}, 'yyyy-mm-dd hh24:mi:ss') <= AIR.DUE_DATE
- </if>
- <if test="con != null">
- and rm.material_name like #{con}
- </if>
- )
- <where>
- <if test="planNumber != null">
- <foreach collection="planNumber" item="item" open="(" separator="or" close=")">
- "planNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="loadName != null">
- <foreach collection="loadName" item="item" open="(" separator="or" close=")">
- "loadName" like '%${item}%'
- </foreach>
- </if>
- <if test="unloadName != null">
- <foreach collection="unloadName" item="item" open="(" separator="or" close=")">
- "unloadName" 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="planTruckNumber != null">
- and
- <foreach collection="planTruckNumber" item="item" open="(" separator="or" close=")">
- "planTruckNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="requirementNumber != null">
- and
- <foreach collection="requirementNumber" item="item" open="(" separator="or" close=")">
- "requirementNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="planIssueTime != null">
- and
- <foreach collection="planIssueTime" item="item" open="(" separator="or" close=")">
- "planIssueTime" like '%${item}%'
- </foreach>
- </if>
- <if test="requirementType != null">
- and
- <foreach collection="requirementType" item="item" open="(" separator="or" close=")">
- "requirementType" like '%${item}%'
- </foreach>
- </if>
- <if test="requirementTruckTime != null">
- and
- <foreach collection="requirementTruckTime" item="item" open="(" separator="or" close=")">
- "requirementTruckTime" 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="shipperName != null">
- and
- <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
- "shipperName" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <select id="getIssuedPlanList2" resultType="java.util.Map" parameterType="java.util.Map">
- SELECT *
- FROM (SELECT AIP.PLAN_NUMBER AS "planNumber",
- RCA.CARRIER_NAME AS "carrierName",
- RTR.TRANS_RANGE_VALUE AS "rangeValue",
- AIP.PLAN_TRUCK_NUMBER AS "planTruckNumber",
- AIR.REQUIREMENT_NUMBER AS "requirementNumber",
- AIP.PLAN_ISSUE_TIME AS "planIssueTime",
- AIP.PLAN_ISSUE_NAME AS "planIssueName",
- AIR.REQUIREMENT_TYPE AS "requirementType",
- AIR.REQUIREMENT_TRUCK_TIME AS "requirementTruckTime",
- AIR.REQUIREMENT_WORK_TYPE AS "requirementWorkType",
- AIR.REQUIREMENT_WORK_CONTENT AS "requirementWorkContent",
- AIR.REQUIREMENT_WORK_ENVIRONMENT AS "requirementWorkEnvironment",
- AIR.REQUIREMENT_ESTIMATED_DURATION AS "requirementEstimatedDuration",
- AIR.REQUIREMENT_ID AS "requirementId",
- AIP.PLAN_ID AS "planId",
- AIP.CARRIER_ID AS "carrierId",
- AIP.INSERT_TIME AS "insertTime",
- RS.SHIPPER_NAME AS "shipperName"
- FROM AMSTRUCK_INWARD_PLAN AIP
- 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 RMS_SHIPPER RS
- ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
- LEFT JOIN RMS_CARRIER RCA
- ON RCA.CARRIER_ID = AIP.CARRIER_ID
- LEFT JOIN RMS_TRANS_RANGE RTR
- ON RTR.TRANS_RANGE_ID = AIR.LINE_ID
- WHERE AIP.DELETED = 0
- AND AIR.PURCHASE_ORDER_ID IS NULL
- <if test="planId != null">
- and AIP.PLAN_ID = #{planId}
- </if>
- )
- </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="selectInwardPlanToUpdate" parameterType="DECIMAL" resultType="java.util.Map">
- SELECT AIP.CARRIER_ID AS "carrierId",
- AIP.PLAN_TRUCK_NUMBER AS "planTruckNumber",
- AIR.REQUIREMENT_NUMBER AS "requirementNumber",
- AIP.PLAN_NUMBER AS "planNumber"
- FROM AMSTRUCK_INWARD_PLAN AIP
- LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
- ON AIP.PLAN_ID = ARP.PLAN_ID
- LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
- ON AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
- WHERE AIP.PLAN_ID = #{planId}
- </select>
- <select id="getCarrierList" resultType="java.util.Map">
- SELECT RC.CARRIER_ID AS "id",
- RC.CARRIER_ID AS "value",
- RC.CARRIER_NAME AS "label"
- FROM RMS_CARRIER RC
- </select>
- <select id="getPlanOrder" resultType="java.util.Map" parameterType="java.util.Map">
- select RC.CAPACITY_ID "capacityId",
- rc.capacity_number "capacityNumber",
- oo.order_number "orderNumber",
- oo.order_id "orderId"
- from OMSTRUCK_ORDER OO
- left join RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_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
- where oo.order_status = #{orderStatus}
- <if test="planId != null ">
- and aip.plan_id = #{planId}
- </if>
- <if test="requirementId != null ">
- and air.requirement_id = #{requirementId}
- </if>
- </select>
- </mapper>
|