123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380 |
- <?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.TmstrainTotalResultMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstrainTotalResult">
- <id column="TOTAL_RESULT_ID" jdbcType="DECIMAL" property="totalResultId" />
- <result column="LOADING_ID" jdbcType="DECIMAL" property="loadingId" />
- <result column="UNLOADING_ID" jdbcType="DECIMAL" property="unloadingId" />
- <result column="RESULT_TOTAL_STAY_DURATION" jdbcType="DECIMAL" property="resultTotalStayDuration" />
- <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" />
- </resultMap>
- <sql id="columns">
- TOTAL_RESULT_ID, LOADING_ID, UNLOADING_ID, RESULT_TOTAL_STAY_DURATION, STANDARD_DATA_ID,
- RESULT_OUTLIER, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
- </sql>
- <sql id="columns_alias">
- t.TOTAL_RESULT_ID, t.LOADING_ID, t.UNLOADING_ID, t.RESULT_TOTAL_STAY_DURATION, t.STANDARD_DATA_ID,
- t.RESULT_OUTLIER, 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 TMSTRAIN_TOTAL_RESULT
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias" /> FROM TMSTRAIN_TOTAL_RESULT t
- </sql>
- <sql id="where">
- <where>
- <if test="totalResultId != null">
- and TOTAL_RESULT_ID = #{totalResultId}
- </if>
- <if test="loadingId != null">
- and LOADING_ID = #{loadingId}
- </if>
- <if test="unloadingId != null">
- and UNLOADING_ID = #{unloadingId}
- </if>
- <if test="resultTotalStayDuration != null">
- and RESULT_TOTAL_STAY_DURATION = #{resultTotalStayDuration}
- </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>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="totalResultId != null">
- and TOTAL_RESULT_ID = #{totalResultId}
- </if>
- <if test="loadingId != null">
- and LOADING_ID = #{loadingId}
- </if>
- <if test="unloadingId != null">
- and UNLOADING_ID = #{unloadingId}
- </if>
- <if test="resultTotalStayDuration != null">
- and RESULT_TOTAL_STAY_DURATION = #{resultTotalStayDuration}
- </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>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
- delete from TMSTRAIN_TOTAL_RESULT
- where TOTAL_RESULT_ID = #{totalResultId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from TMSTRAIN_TOTAL_RESULT
- where 1!=1
- <if test="loadingId != null">
- or LOADING_ID = #{loadingId}
- </if>
- <if test="unloadingId != null">
- or UNLOADING_ID = #{unloadingId}
- </if>
- <if test="resultTotalStayDuration != null">
- or RESULT_TOTAL_STAY_DURATION = #{resultTotalStayDuration}
- </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>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.TmstrainTotalResult">
- insert into TMSTRAIN_TOTAL_RESULT (TOTAL_RESULT_ID, LOADING_ID, UNLOADING_ID,
- RESULT_TOTAL_STAY_DURATION, STANDARD_DATA_ID,
- RESULT_OUTLIER, INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
- )
- values (#{totalResultId,jdbcType=DECIMAL}, #{loadingId,jdbcType=DECIMAL}, #{unloadingId,jdbcType=DECIMAL},
- #{resultTotalStayDuration,jdbcType=DECIMAL}, #{standardDataId,jdbcType=DECIMAL},
- #{resultOutlier,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.TmstrainTotalResult">
- insert into TMSTRAIN_TOTAL_RESULT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="totalResultId != null">
- TOTAL_RESULT_ID,
- </if>
- <if test="loadingId != null">
- LOADING_ID,
- </if>
- <if test="unloadingId != null">
- UNLOADING_ID,
- </if>
- <if test="resultTotalStayDuration != null">
- RESULT_TOTAL_STAY_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>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="totalResultId != null">
- #{totalResultId,jdbcType=DECIMAL},
- </if>
- <if test="loadingId != null">
- #{loadingId,jdbcType=DECIMAL},
- </if>
- <if test="unloadingId != null">
- #{unloadingId,jdbcType=DECIMAL},
- </if>
- <if test="resultTotalStayDuration != null">
- #{resultTotalStayDuration,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>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstrainTotalResult">
- update TMSTRAIN_TOTAL_RESULT
- set LOADING_ID = #{loadingId,jdbcType=DECIMAL},
- UNLOADING_ID = #{unloadingId,jdbcType=DECIMAL},
- RESULT_TOTAL_STAY_DURATION = #{resultTotalStayDuration,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}
- where TOTAL_RESULT_ID = #{totalResultId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstrainTotalResult">
- update TMSTRAIN_TOTAL_RESULT
- <set>
- <if test="loadingId != null">
- LOADING_ID = #{loadingId,jdbcType=DECIMAL},
- </if>
- <if test="unloadingId != null">
- UNLOADING_ID = #{unloadingId,jdbcType=DECIMAL},
- </if>
- <if test="resultTotalStayDuration != null">
- RESULT_TOTAL_STAY_DURATION = #{resultTotalStayDuration,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>
- </set>
- where TOTAL_RESULT_ID = #{totalResultId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
- <include refid="select" />
- where TOTAL_RESULT_ID = #{totalResultId,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_TOTAL_RESULT
- (TOTAL_RESULT_ID,
- LOADING_ID, UNLOADING_ID, RESULT_TOTAL_STAY_DURATION,
- STANDARD_DATA_ID, RESULT_OUTLIER,
- INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME,
- INSERT_UPDATE_REMARK)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.totalResultId,jdbcType=DECIMAL},
- #{item.loadingId,jdbcType=DECIMAL}, #{item.unloadingId,jdbcType=DECIMAL}, #{item.resultTotalStayDuration,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} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update TMSTRAIN_TOTAL_RESULT
- set
- TOTAL_RESULT_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case TOTAL_RESULT_ID" separator=" ">
- when #{item.totalResultId,jdbcType=DECIMAL} then #{item.totalResultId,jdbcType=DECIMAL}
- </foreach>
- ,LOADING_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case TOTAL_RESULT_ID" separator=" ">
- when #{item.totalResultId,jdbcType=DECIMAL} then #{item.loadingId,jdbcType=DECIMAL}
- </foreach>
- ,UNLOADING_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case TOTAL_RESULT_ID" separator=" ">
- when #{item.totalResultId,jdbcType=DECIMAL} then #{item.unloadingId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_TOTAL_STAY_DURATION=
- <foreach close="end" collection="list" index="index" item="item" open="case TOTAL_RESULT_ID" separator=" ">
- when #{item.totalResultId,jdbcType=DECIMAL} then #{item.resultTotalStayDuration,jdbcType=DECIMAL}
- </foreach>
- ,STANDARD_DATA_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case TOTAL_RESULT_ID" separator=" ">
- when #{item.totalResultId,jdbcType=DECIMAL} then #{item.standardDataId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_OUTLIER=
- <foreach close="end" collection="list" index="index" item="item" open="case TOTAL_RESULT_ID" separator=" ">
- when #{item.totalResultId,jdbcType=DECIMAL} then #{item.resultOutlier,jdbcType=DECIMAL}
- </foreach>
- ,INSERT_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case TOTAL_RESULT_ID" separator=" ">
- when #{item.totalResultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case TOTAL_RESULT_ID" separator=" ">
- when #{item.totalResultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case TOTAL_RESULT_ID" separator=" ">
- when #{item.totalResultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case TOTAL_RESULT_ID" separator=" ">
- when #{item.totalResultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach close="end" collection="list" index="index" item="item" open="case TOTAL_RESULT_ID" separator=" ">
- when #{item.totalResultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- where TOTAL_RESULT_ID in
- <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
- #{item.totalResultId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from TMSTRAIN_TOTAL_RESULT
- where TOTAL_RESULT_ID in
- <foreach close=")" collection="list" item="id" open="(" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <!-- 通过火运实绩Id -->
- <select id="getTotalIdByLoadingId" parameterType="int" resultType="java.math.BigDecimal">
- select
- TTR.TOTAL_RESULT_ID
- from TMSTRAIN_TOTAL_RESULT TTR
- where TTR.LOADING_ID = #{loadingId}
- </select>
- </mapper>
|