123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928 |
- <?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.TmstrainPleaseApproveResultMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstrainPleaseApproveResult">
- <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId"/>
- <result column="RAIL_PLAN_ID" jdbcType="DECIMAL" property="railPlanId"/>
- <result column="RESULT_PLEASE_PLAN_NO" jdbcType="VARCHAR" property="resultPleasePlanNo"/>
- <result column="RESULT_PLAN_DATE" jdbcType="TIMESTAMP" property="resultPlanDate"/>
- <result column="RESULT_CATEGORY" jdbcType="VARCHAR" property="resultCategory"/>
- <result column="SHIPPER_ID" jdbcType="DECIMAL" property="shipperId"/>
- <result column="SEND_STATION_ID" jdbcType="DECIMAL" property="sendStationId"/>
- <result column="TO_THE_STATION_ID" jdbcType="DECIMAL" property="toTheStationId"/>
- <result column="RESULT_PLEASE_NUMBER" jdbcType="DECIMAL" property="resultPleaseNumber"/>
- <result column="RESULT_PLEASE_DATE" jdbcType="TIMESTAMP" property="resultPleaseDate"/>
- <result column="RESULT_APPROVE_NUMBER" jdbcType="DECIMAL" property="resultApproveNumber"/>
- <result column="RESULT_APPROVE_DATE" jdbcType="TIMESTAMP" property="resultApproveDate"/>
- <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="STATUS" jdbcType="DECIMAL" property="status"/>
- <result column="RESULT_TYPE" jdbcType="DECIMAL" property="resultType"/>
- </resultMap>
- <sql id="columns">
- RESULT_ID, RAIL_PLAN_ID, RESULT_PLEASE_PLAN_NO, RESULT_PLAN_DATE, RESULT_CATEGORY,
- SHIPPER_ID, SEND_STATION_ID, TO_THE_STATION_ID, RESULT_PLEASE_NUMBER, RESULT_PLEASE_DATE,
- RESULT_APPROVE_NUMBER, RESULT_APPROVE_DATE, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK, STATUS, RESULT_TYPE
- </sql>
- <sql id="columns_alias">
- t.RESULT_ID, t.RAIL_PLAN_ID, t.RESULT_PLEASE_PLAN_NO, t.RESULT_PLAN_DATE, t.RESULT_CATEGORY,
- t.SHIPPER_ID, t.SEND_STATION_ID, t.TO_THE_STATION_ID, t.RESULT_PLEASE_NUMBER, t.RESULT_PLEASE_DATE,
- t.RESULT_APPROVE_NUMBER, t.RESULT_APPROVE_DATE, t.INSERT_USERNAME, t.INSERT_TIME,
- t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.STATUS, t.RESULT_TYPE
- </sql>
- <sql id="select">
- SELECT
- <include refid="columns"/>
- FROM TMSTRAIN_PLEASE_APPROVE_RESULT
- </sql>
- <sql id="select_alias">
- SELECT
- <include refid="columns_alias"/>
- FROM TMSTRAIN_PLEASE_APPROVE_RESULT t
- </sql>
- <sql id="where">
- <where>
- <if test="resultId != null">
- and RESULT_ID = #{resultId}
- </if>
- <if test="railPlanId != null">
- and RAIL_PLAN_ID = #{railPlanId}
- </if>
- <if test="resultPleasePlanNo != null and resultPleasePlanNo != ''">
- and RESULT_PLEASE_PLAN_NO = #{resultPleasePlanNo}
- </if>
- <if test="resultPlanDate != null">
- and TO_CHAR(RESULT_PLAN_DATE,'yyyy-MM-dd') = #{resultPlanDate}
- </if>
- <if test="resultCategory != null and resultCategory != ''">
- and RESULT_CATEGORY = #{resultCategory}
- </if>
- <if test="shipperId != null">
- and SHIPPER_ID = #{shipperId}
- </if>
- <if test="sendStationId != null">
- and SEND_STATION_ID = #{sendStationId}
- </if>
- <if test="toTheStationId != null">
- and TO_THE_STATION_ID = #{toTheStationId}
- </if>
- <if test="resultPleaseNumber != null">
- and RESULT_PLEASE_NUMBER = #{resultPleaseNumber}
- </if>
- <if test="resultPleaseDate != null">
- and TO_CHAR(RESULT_PLEASE_DATE,'yyyy-MM-dd') = #{resultPleaseDate}
- </if>
- <if test="resultApproveNumber != null">
- and RESULT_APPROVE_NUMBER = #{resultApproveNumber}
- </if>
- <if test="resultApproveDate != null">
- and TO_CHAR(RESULT_APPROVE_DATE,'yyyy-MM-dd') = #{resultApproveDate}
- </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="status != null">
- and STATUS = #{status}
- </if>
- <if test="resultType != null">
- and RESULT_TYPE = #{resultType}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="resultId != null">
- and RESULT_ID = #{resultId}
- </if>
- <if test="railPlanId != null">
- and RAIL_PLAN_ID = #{railPlanId}
- </if>
- <if test="resultPleasePlanNo != null and resultPleasePlanNo != ''">
- and RESULT_PLEASE_PLAN_NO LIKE '%${resultPleasePlanNo}%'
- </if>
- <if test="resultPlanDate != null">
- and TO_CHAR(RESULT_PLAN_DATE,'yyyy-MM-dd') = #{resultPlanDate}
- </if>
- <if test="resultCategory != null and resultCategory != ''">
- and RESULT_CATEGORY LIKE '%${resultCategory}%'
- </if>
- <if test="shipperId != null">
- and SHIPPER_ID = #{shipperId}
- </if>
- <if test="sendStationId != null">
- and SEND_STATION_ID = #{sendStationId}
- </if>
- <if test="toTheStationId != null">
- and TO_THE_STATION_ID = #{toTheStationId}
- </if>
- <if test="resultPleaseNumber != null">
- and RESULT_PLEASE_NUMBER = #{resultPleaseNumber}
- </if>
- <if test="resultPleaseDate != null">
- and TO_CHAR(RESULT_PLEASE_DATE,'yyyy-MM-dd') = #{resultPleaseDate}
- </if>
- <if test="resultApproveNumber != null">
- and RESULT_APPROVE_NUMBER = #{resultApproveNumber}
- </if>
- <if test="resultApproveDate != null">
- and TO_CHAR(RESULT_APPROVE_DATE,'yyyy-MM-dd') = #{resultApproveDate}
- </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="status != null">
- and STATUS = #{status}
- </if>
- <if test="resultType != null">
- and RESULT_TYPE = #{resultType}
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
- delete
- from TMSTRAIN_PLEASE_APPROVE_RESULT
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from TMSTRAIN_PLEASE_APPROVE_RESULT
- where 1!=1
- <if test="railPlanId != null">
- or RAIL_PLAN_ID = #{railPlanId}
- </if>
- <if test="resultPleasePlanNo != null and resultPleasePlanNo != ''">
- or RESULT_PLEASE_PLAN_NO = #{resultPleasePlanNo}
- </if>
- <if test="resultPlanDate != null">
- or TO_CHAR(RESULT_PLAN_DATE,'yyyy-MM-dd') = '#{resultPlanDate}'
- </if>
- <if test="resultCategory != null and resultCategory != ''">
- or RESULT_CATEGORY = #{resultCategory}
- </if>
- <if test="shipperId != null">
- or SHIPPER_ID = #{shipperId}
- </if>
- <if test="sendStationId != null">
- or SEND_STATION_ID = #{sendStationId}
- </if>
- <if test="toTheStationId != null">
- or TO_THE_STATION_ID = #{toTheStationId}
- </if>
- <if test="resultPleaseNumber != null">
- or RESULT_PLEASE_NUMBER = #{resultPleaseNumber}
- </if>
- <if test="resultPleaseDate != null">
- or TO_CHAR(RESULT_PLEASE_DATE,'yyyy-MM-dd') = '#{resultPleaseDate}'
- </if>
- <if test="resultApproveNumber != null">
- or RESULT_APPROVE_NUMBER = #{resultApproveNumber}
- </if>
- <if test="resultApproveDate != null">
- or TO_CHAR(RESULT_APPROVE_DATE,'yyyy-MM-dd') = '#{resultApproveDate}'
- </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="status != null">
- or STATUS = #{status}
- </if>
- <if test="resultType != null">
- or RESULT_TYPE = #{resultType}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.TmstrainPleaseApproveResult">
- insert into TMSTRAIN_PLEASE_APPROVE_RESULT (RESULT_ID, RAIL_PLAN_ID, RESULT_PLEASE_PLAN_NO,
- RESULT_PLAN_DATE, RESULT_CATEGORY, SHIPPER_ID,
- SEND_STATION_ID, TO_THE_STATION_ID, RESULT_PLEASE_NUMBER,
- RESULT_PLEASE_DATE, RESULT_APPROVE_NUMBER,
- RESULT_APPROVE_DATE, INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
- STATUS, RESULT_TYPE)
- values (#{resultId,jdbcType=DECIMAL}, #{railPlanId,jdbcType=DECIMAL}, #{resultPleasePlanNo,jdbcType=VARCHAR},
- #{resultPlanDate,jdbcType=TIMESTAMP}, #{resultCategory,jdbcType=VARCHAR}, #{shipperId,jdbcType=DECIMAL},
- #{sendStationId,jdbcType=DECIMAL}, #{toTheStationId,jdbcType=DECIMAL},
- #{resultPleaseNumber,jdbcType=DECIMAL},
- #{resultPleaseDate,jdbcType=TIMESTAMP}, #{resultApproveNumber,jdbcType=DECIMAL},
- #{resultApproveDate,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR},
- #{insertTime,jdbcType=TIMESTAMP},
- #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
- #{insertUpdateRemark,jdbcType=VARCHAR},
- #{status,jdbcType=DECIMAL}, #{resultType,jdbcType=DECIMAL})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstrainPleaseApproveResult">
- insert into TMSTRAIN_PLEASE_APPROVE_RESULT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="resultId != null">
- RESULT_ID,
- </if>
- <if test="railPlanId != null">
- RAIL_PLAN_ID,
- </if>
- <if test="resultPleasePlanNo != null">
- RESULT_PLEASE_PLAN_NO,
- </if>
- <if test="resultPlanDate != null">
- RESULT_PLAN_DATE,
- </if>
- <if test="resultCategory != null">
- RESULT_CATEGORY,
- </if>
- <if test="shipperId != null">
- SHIPPER_ID,
- </if>
- <if test="sendStationId != null">
- SEND_STATION_ID,
- </if>
- <if test="toTheStationId != null">
- TO_THE_STATION_ID,
- </if>
- <if test="resultPleaseNumber != null">
- RESULT_PLEASE_NUMBER,
- </if>
- <if test="resultPleaseDate != null">
- RESULT_PLEASE_DATE,
- </if>
- <if test="resultApproveNumber != null">
- RESULT_APPROVE_NUMBER,
- </if>
- <if test="resultApproveDate != null">
- RESULT_APPROVE_DATE,
- </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="status != null">
- STATUS,
- </if>
- <if test="resultType != null">
- RESULT_TYPE,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="resultId != null">
- #{resultId,jdbcType=DECIMAL},
- </if>
- <if test="railPlanId != null">
- #{railPlanId,jdbcType=DECIMAL},
- </if>
- <if test="resultPleasePlanNo != null">
- #{resultPleasePlanNo,jdbcType=VARCHAR},
- </if>
- <if test="resultPlanDate != null">
- #{resultPlanDate,jdbcType=TIMESTAMP},
- </if>
- <if test="resultCategory != null">
- #{resultCategory,jdbcType=VARCHAR},
- </if>
- <if test="shipperId != null">
- #{shipperId,jdbcType=DECIMAL},
- </if>
- <if test="sendStationId != null">
- #{sendStationId,jdbcType=DECIMAL},
- </if>
- <if test="toTheStationId != null">
- #{toTheStationId,jdbcType=DECIMAL},
- </if>
- <if test="resultPleaseNumber != null">
- #{resultPleaseNumber,jdbcType=DECIMAL},
- </if>
- <if test="resultPleaseDate != null">
- #{resultPleaseDate,jdbcType=TIMESTAMP},
- </if>
- <if test="resultApproveNumber != null">
- #{resultApproveNumber,jdbcType=DECIMAL},
- </if>
- <if test="resultApproveDate != null">
- #{resultApproveDate,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="status != null">
- #{status,jdbcType=DECIMAL},
- </if>
- <if test="resultType != null">
- #{resultType,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstrainPleaseApproveResult">
- update TMSTRAIN_PLEASE_APPROVE_RESULT
- set RAIL_PLAN_ID = #{railPlanId,jdbcType=DECIMAL},
- RESULT_PLEASE_PLAN_NO = #{resultPleasePlanNo,jdbcType=VARCHAR},
- RESULT_PLAN_DATE = #{resultPlanDate,jdbcType=TIMESTAMP},
- RESULT_CATEGORY = #{resultCategory,jdbcType=VARCHAR},
- SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
- SEND_STATION_ID = #{sendStationId,jdbcType=DECIMAL},
- TO_THE_STATION_ID = #{toTheStationId,jdbcType=DECIMAL},
- RESULT_PLEASE_NUMBER = #{resultPleaseNumber,jdbcType=DECIMAL},
- RESULT_PLEASE_DATE = #{resultPleaseDate,jdbcType=TIMESTAMP},
- RESULT_APPROVE_NUMBER = #{resultApproveNumber,jdbcType=DECIMAL},
- RESULT_APPROVE_DATE = #{resultApproveDate,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},
- STATUS = #{status,jdbcType=DECIMAL},
- RESULT_TYPE = #{resultType,jdbcType=DECIMAL}
- where RESULT_ID = #{resultId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstrainPleaseApproveResult">
- update TMSTRAIN_PLEASE_APPROVE_RESULT
- <set>
- <if test="railPlanId != null">
- RAIL_PLAN_ID = #{railPlanId,jdbcType=DECIMAL},
- </if>
- <if test="resultPleasePlanNo != null">
- RESULT_PLEASE_PLAN_NO = #{resultPleasePlanNo,jdbcType=VARCHAR},
- </if>
- <if test="resultPlanDate != null">
- RESULT_PLAN_DATE = #{resultPlanDate,jdbcType=TIMESTAMP},
- </if>
- <if test="resultCategory != null">
- RESULT_CATEGORY = #{resultCategory,jdbcType=VARCHAR},
- </if>
- <if test="shipperId != null">
- SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
- </if>
- <if test="sendStationId != null">
- SEND_STATION_ID = #{sendStationId,jdbcType=DECIMAL},
- </if>
- <if test="toTheStationId != null">
- TO_THE_STATION_ID = #{toTheStationId,jdbcType=DECIMAL},
- </if>
- <if test="resultPleaseNumber != null">
- RESULT_PLEASE_NUMBER = #{resultPleaseNumber,jdbcType=DECIMAL},
- </if>
- <if test="resultPleaseDate != null">
- RESULT_PLEASE_DATE = #{resultPleaseDate,jdbcType=TIMESTAMP},
- </if>
- <if test="resultApproveNumber != null">
- RESULT_APPROVE_NUMBER = #{resultApproveNumber,jdbcType=DECIMAL},
- </if>
- <if test="resultApproveDate != null">
- RESULT_APPROVE_DATE = #{resultApproveDate,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="status != null">
- STATUS = #{status,jdbcType=DECIMAL},
- </if>
- <if test="resultType != null">
- RESULT_TYPE = #{resultType,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 TMSTRAIN_PLEASE_APPROVE_RESULT
- (RESULT_ID,
- RAIL_PLAN_ID, RESULT_PLEASE_PLAN_NO,
- RESULT_PLAN_DATE, RESULT_CATEGORY,
- SHIPPER_ID, SEND_STATION_ID, TO_THE_STATION_ID,
- RESULT_PLEASE_NUMBER, RESULT_PLEASE_DATE,
- RESULT_APPROVE_NUMBER, RESULT_APPROVE_DATE,
- INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME,
- INSERT_UPDATE_REMARK, STATUS, RESULT_TYPE
- )
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.resultId,jdbcType=DECIMAL},
- #{item.railPlanId,jdbcType=DECIMAL}, #{item.resultPleasePlanNo,jdbcType=VARCHAR},
- #{item.resultPlanDate,jdbcType=TIMESTAMP}, #{item.resultCategory,jdbcType=VARCHAR},
- #{item.shipperId,jdbcType=DECIMAL}, #{item.sendStationId,jdbcType=DECIMAL},
- #{item.toTheStationId,jdbcType=DECIMAL},
- #{item.resultPleaseNumber,jdbcType=DECIMAL}, #{item.resultPleaseDate,jdbcType=TIMESTAMP},
- #{item.resultApproveNumber,jdbcType=DECIMAL}, #{item.resultApproveDate,jdbcType=TIMESTAMP},
- #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
- #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
- #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.status,jdbcType=DECIMAL},
- #{item.resultType,jdbcType=DECIMAL}
- from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update TMSTRAIN_PLEASE_APPROVE_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>
- ,RAIL_PLAN_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.railPlanId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_PLEASE_PLAN_NO=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultPleasePlanNo,jdbcType=VARCHAR}
- </foreach>
- ,RESULT_PLAN_DATE=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultPlanDate,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_CATEGORY=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultCategory,jdbcType=VARCHAR}
- </foreach>
- ,SHIPPER_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.shipperId,jdbcType=DECIMAL}
- </foreach>
- ,SEND_STATION_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.sendStationId,jdbcType=DECIMAL}
- </foreach>
- ,TO_THE_STATION_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.toTheStationId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_PLEASE_NUMBER=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultPleaseNumber,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_PLEASE_DATE=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultPleaseDate,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_APPROVE_NUMBER=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultApproveNumber,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_APPROVE_DATE=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultApproveDate,jdbcType=TIMESTAMP}
- </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>
- ,STATUS=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_TYPE=
- <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
- when #{item.resultId,jdbcType=DECIMAL} then #{item.resultType,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 TMSTRAIN_PLEASE_APPROVE_RESULT
- where RESULT_ID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <!-- 查询未下发0 已下发1 请车作业 -->
- <select id="getAllWagonPlease" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select
- *
- from
- (
- select
- t1.RESULT_ID "resultId",
- t1.RESULT_PLEASE_PLAN_NO "resultPleasePlanNo",
- t1.RESULT_PLEASE_NUMBER "resultPleaseNumber",
- TO_CHAR(t1.RESULT_PLEASE_DATE , 'yyyy-mm-dd')"resultPleaseDate",
- TO_CHAR(t1.RESULT_PLAN_DATE, 'yyyy-mm-dd') "resultPlanDate",
- t2.SHIPPER_NAME "shipperName",
- t3.ARRIVAL_NAME "forwardName",
- t4.ARRIVAL_NAME "arrivalName",
- t1.RESULT_CATEGORY "resultCategory",
- t1.INSERT_USERNAME "insertUserName"
- from TMSTRAIN_PLEASE_APPROVE_RESULT t1
- left join RMS_SHIPPER t2
- on t1.SHIPPER_ID = t2.SHIPPER_ID
- left join RMSTRAIN_ARRIVAL_SEND t3
- on t1.SEND_STATION_ID = t3.ARRIVAL_ID
- left join RMSTRAIN_ARRIVAL_SEND t4
- on t1.TO_THE_STATION_ID = t4.ARRIVAL_ID
- where t1.STATUS = #{status} and t1.RESULT_TYPE = #{resultType}
- )
- <where>
- <if test="resultId != null">
- <foreach collection="resultId" item="item" open="(" separator="or" close=")">
- "resultId" 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="forwardName != null">
- and
- <foreach collection="forwardName" item="item" open="(" separator="or" close=")">
- "forwardName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultPleasePlanNo != null">
- and
- <foreach collection="resultPleasePlanNo" item="item" open="(" separator="or" close=")">
- "resultPleasePlanNo" like '%${item}%'
- </foreach>
- </if>
- <if test="arrivalName != null">
- and
- <foreach collection="arrivalName" item="item" open="(" separator="or" close=")">
- "arrivalName" like '%${item}%'
- </foreach>
- </if>
- <if test="pleaseCategory != null">
- and
- <foreach collection="pleaseCategory" item="item" open="(" separator="or" close=")">
- "pleaseCategory" like '%${item}%'
- </foreach>
- </if>
- <if test="resultPleaseNumber != null">
- and
- <foreach collection="resultPleaseNumber" item="item" open="(" separator="or" close=")">
- "resultPleaseNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultPleaseDate != null">
- and
- <foreach collection="resultPleaseDate" item="item" open="(" separator="or" close=")">
- "resultPleaseDate" like '%${item}%'
- </foreach>
- </if>
- <if test="resultPlanDate != null">
- and
- <foreach collection="resultPlanDate" item="item" open="(" separator="or" close=")">
- "resultPlanDate" 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>
- <if test="orderField == null ">
- order by "resultPleaseDate" desc
- </if>
- </select>
- <!-- 排序 -->
- <sql id="orderBy">
- <if test="orderField != null and orderField != ''">
- order by "${orderField}"
- <if test="orderType != null and orderType != ''">
- ${orderType}
- </if>
- </if>
- </sql>
- <!-- 查询所有已批车作业 状态码为 2 -->
- <select id="getAllApproveWagonPlease" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select
- *
- from
- (
- select
- t1.RESULT_ID "resultId",
- t1.RESULT_PLEASE_PLAN_NO "resultPleasePlanNo",
- TO_CHAR(t1.RESULT_APPROVE_DATE, 'yyyy-mm-dd') "resultApproveDate",
- t1.RESULT_APPROVE_NUMBER "resultApproveNumber",
- t2.SHIPPER_NAME "shipperName",
- t1.RESULT_CATEGORY "resultCategory",
- t3.ARRIVAL_NAME "forwardName",
- t4.ARRIVAL_NAME "arrivalName"
- from TMSTRAIN_PLEASE_APPROVE_RESULT t1
- left join RMS_SHIPPER t2
- on t1.SHIPPER_ID = t2.SHIPPER_ID
- left join RMSTRAIN_ARRIVAL_SEND t3
- on t1.SEND_STATION_ID = t3.ARRIVAL_ID
- left join RMSTRAIN_ARRIVAL_SEND t4
- on t1.TO_THE_STATION_ID = t4.ARRIVAL_ID
- where t1.STATUS = 2 and t1.RESULT_TYPE = #{resultType}
- )
- <where>
- <if test="resultId != null">
- <foreach collection="resultId" item="item" open="(" separator="or" close=")">
- "resultId" 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="forwardName != null">
- and
- <foreach collection="forwardName" item="item" open="(" separator="or" close=")">
- "forwardName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultPleasePlanNo != null">
- and
- <foreach collection="resultPleasePlanNo" item="item" open="(" separator="or" close=")">
- "resultPleasePlanNo" like '%${item}%'
- </foreach>
- </if>
- <if test="arrivalName != null">
- and
- <foreach collection="arrivalName" item="item" open="(" separator="or" close=")">
- "arrivalName" like '%${item}%'
- </foreach>
- </if>
- <if test="pleaseCategory != null">
- and
- <foreach collection="pleaseCategory" item="item" open="(" separator="or" close=")">
- "pleaseCategory" like '%${item}%'
- </foreach>
- </if>
- <if test="resultApproveDate != null">
- and
- <foreach collection="resultApproveDate" item="item" open="(" separator="or" close=")">
- "resultApproveDate" like '%${item}%'
- </foreach>
- </if>
- <if test="resultApproveNumber != null">
- and
- <foreach collection="resultApproveNumber" item="item" open="(" separator="or" close=")">
- "resultApproveNumber" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy">
- </include>
- <if test="orderField == null ">
- order by "resultApproveDate" desc
- </if>
- </select>
- <!-- //通过Id查询请车作业 getWagonPleaseById(Integer pleasePlanId);-->
- <select id="getWagonPleaseById" parameterType="int" resultType="java.util.Map">
- select APAR.RESULT_PLEASE_PLAN_NO "resultPleasePlanNo",
- APAR.SHIPPER_ID "shipperId",
- APAR.SEND_STATION_ID "sendStationId",
- APAR.TO_THE_STATION_ID "toTheStationId",
- APAR.RESULT_CATEGORY "resultCategory",
- APAR.RESULT_PLEASE_NUMBER "resultPleaseNumber",
- APAR.RESULT_PLAN_DATE "resultPlanDate",
- APAR.INSERT_USERNAME "insertUsername",
- APAR.RAIL_PLAN_ID "railPlanId",
- APAR.RESULT_PLEASE_DATE "resultPleaseDate",
- APAR.RESULT_APPROVE_DATE "resultApproveDate",
- APAR.RESULT_APPROVE_NUMBER "resultApproveNumber"
- from TMSTRAIN_PLEASE_APPROVE_RESULT APAR
- where RESULT_ID = #{resultId}
- </select>
- <!-- 通过Id查询批车作业-->
- <select id="getApproveWagonPleaseById" parameterType="int" resultType="java.util.Map">
- select AOD.DAYPLAN_NO "dayplanNo",
- APAR.RESULT_PLEASE_PLAN_NO "resultPleasePlanNo",
- APAR.RESULT_APPROVE_DATE "resultApproveDate",
- APAR.RESULT_APPROVE_NUMBER "resultApproveNumber",
- APAR.SHIPPER_ID "shipperId",
- APAR.RESULT_CATEGORY "resultCategory",
- APAR.SEND_STATION_ID "sendStationId",
- APAR.TO_THE_STATION_ID "toTheStationId"
- from TMSTRAIN_PLEASE_APPROVE_RESULT APAR
- left join AMS_RAIL_OFFSET_DAYPLAN AOD
- on APAR.RAIL_PLAN_ID = AOD.DAYPLAN_ID
- where RESULT_ID = #{resultId}
- </select>
- <!-- 下拉框中获取收货单位 -->
- <select id="getShipper" resultType="java.util.LinkedHashMap">
- select RS.SHIPPER_ID "id",
- RS.SHIPPER_ID "value",
- RS.SHIPPER_NAME "label"
- from RMS_SHIPPER RS
- </select>
- <!-- 下拉框中获取发运计划 -->
- <select id="getRailPlan" resultType="java.util.LinkedHashMap">
- select AOD.DAYPLAN_ID "id",
- AOD.DAYPLAN_ID "value",
- AOD.DAYPLAN_NO "label"
- from AMS_RAIL_OFFSET_DAYPLAN AOD
- </select>
- <!--根据id查找用户名 -->
- <select id="selectPersonNameByPersonnelId" resultType="java.lang.String" parameterType="java.lang.Integer">
- select RP.PERSONNEL_NAME "personnelName"
- from RMS_PERSONNEL RP
- where RP.PERSONNEL_ID = #{personnelId}
- </select>
- <!--内转物流查询请车计划-->
- <select id="selectPleaseApprovePlanForConverted" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT
- TPAR.RESULT_ID "resultId",
- AROD.DAYPLAN_ID "dayplanId",
- TPAR.RESULT_PLEASE_PLAN_NO "resultPleasePlanNo",
- TPAR.RESULT_PLEASE_NUMBER "resultPleaseNumber",
- TPAR.INSERT_USERNAME "insertUsername",
- TO_CHAR(TPAR.RESULT_PLEASE_DATE, 'yyyy-mm-dd') "resultPleaseDate",
- AROD.DAYPLAN_NO "dayplanNo",
- RS.SHIPPER_NAME "shipperName",
- TO_CHAR(AROD.DAYPLAN_DATE,'yyyy-mm-dd') "dayplanDate",
- RAS.ARRIVAL_NAME "dayplanSendStationName",
- RAS2.ARRIVAL_NAME "dayplanToTheStationName",
- RAS2.DAYPLAN_DEDICATED_LINE "dayPlanDedicatedLine",
- RC.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
- AROD.DAYPLAN_CONSIGNEE_TEL "dayplanConsigneeTel",
- AROD.DAYPLAN_CONSIGNEE_NAME "dayplanConsigneeName",
- TO_char(TPAR.RESULT_APPROVE_DATE, 'yyyy-mm-dd') "resultApproveDate",
- TPAR.RESULT_APPROVE_NUMBER "resultApproveNumber",
- TO_CHAR(AROD.DAYPLAN_DELIVERY_DATE, 'yyyy-mm-dd') "dayplanDeliveryDate"
- FROM TMSTRAIN_PLEASE_APPROVE_RESULT TPAR
- LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
- ON AROD.DAYPLAN_ID = TPAR.RAIL_PLAN_ID
- LEFT JOIN RMS_SHIPPER RS
- ON RS.SHIPPER_ID = AROD.SHIPPER_ID
- LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS --发站
- ON AROD.DAYPLAN_SEND_STATION_ID = RAS.ARRIVAL_ID
- LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS2 --到站
- ON AROD.DAYPLAN_TO_THE_STATION_ID = RAS2.ARRIVAL_ID
- LEFT JOIN RMS_SHIPPER RSH
- ON RSH.SHIPPER_ID = AROD.SHIPPER_ID
- LEFT JOIN RMS_CONSIGNEE RC
- ON RC.CONSIGNEE_ID = AROD.RECEIVING_UNIT_ID
- WHERE
- TPAR.STATUS = #{status}
- AND TPAR.RESULT_TYPE = 4
- <if test="resultId != null">
- AND TPAR.RESULT_ID = #{resultId}
- </if>
- </select>
- <!-- 发站/到站下拉框 -->
- <select id="getArrivalSend" resultType="java.util.LinkedHashMap">
- select RAS.ARRIVAL_ID "id",
- RAS.ARRIVAL_ID "value",
- RAS.ARRIVAL_NAME "label"
- from RMSTRAIN_ARRIVAL_SEND RAS
- </select>
- <!-- 请车计划号-->
- <select id="getPleasePlanNo" resultType="java.util.LinkedHashMap">
- select TPAR.RESULT_ID "id",
- TPAR.RESULT_ID "value",
- TPAR.RESULT_APPROVE_NUMBER "label"
- from TMSTRAIN_PLEASE_APPROVE_RESULT TPAR
- </select>
- <!--通过id渲染查询内转物流请车计划 -->
- <select id="selectPleasePlanByResultId" parameterType="java.lang.Integer" resultType="java.util.LinkedHashMap">
- SELECT TPAR.RESULT_PLEASE_PLAN_NO "planNo",
- TPAR.RAIL_PLAN_ID "planId",
- TPAR.SEND_STATION_ID "sendStationId",
- TPAR.RESULT_APPROVE_NUMBER "approveNumber",
- TPAR.RESULT_APPROVE_DATE "approveDate"
- FROM TMSTRAIN_PLEASE_APPROVE_RESULT TPAR
- WHERE TPAR.RESULT_ID = #{resultId}
- </select>
- <!-- 通过id渲染批车计划 -->
- <select id="selectApproveBYResultId" parameterType="java.lang.Integer" resultType="java.util.LinkedHashMap">
- SELECT TPAR.RESULT_PLEASE_PLAN_NO "pleaseNo",
- TPAR.RESULT_APPROVE_NUMBER "approveNumber",
- TPAR.RESULT_APPROVE_DATE "approveDate"
- FROM TMSTRAIN_PLEASE_APPROVE_RESULT TPAR
- WHERE TPAR.RESULT_ID = #{resultId}
- </select>
- </mapper>
|