|
@@ -0,0 +1,226 @@
|
|
|
+<?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.TmsshipControlLineMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmsshipControlLine">
|
|
|
+ <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
|
|
|
+ <result column="LINE_DATE" jdbcType="TIMESTAMP" property="lineDate" />
|
|
|
+ <result column="UP" jdbcType="DECIMAL" property="up" />
|
|
|
+ <result column="DOWN" jdbcType="DECIMAL" property="down" />
|
|
|
+ <result column="COUNT" jdbcType="DECIMAL" property="count" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="columns">
|
|
|
+ RESULT_ID, LINE_DATE, UP, DOWN, COUNT
|
|
|
+ </sql>
|
|
|
+ <sql id="columns_alias">
|
|
|
+ t.RESULT_ID, t.LINE_DATE, t.UP, t.DOWN, t.COUNT
|
|
|
+ </sql>
|
|
|
+ <sql id="select">
|
|
|
+ SELECT <include refid="columns"/> FROM TMSSHIP_CONTROL_LINE
|
|
|
+ </sql>
|
|
|
+ <sql id="select_alias">
|
|
|
+ SELECT <include refid="columns_alias"/> FROM TMSSHIP_CONTROL_LINE t
|
|
|
+ </sql>
|
|
|
+ <sql id="where">
|
|
|
+ <where>
|
|
|
+ <if test="resultId != null">
|
|
|
+ and RESULT_ID = #{resultId}
|
|
|
+ </if>
|
|
|
+ <if test="lineDate != null">
|
|
|
+ and TO_CHAR(LINE_DATE,'yyyy-MM-dd') = #{lineDate}
|
|
|
+ </if>
|
|
|
+ <if test="up != null">
|
|
|
+ and UP = #{up}
|
|
|
+ </if>
|
|
|
+ <if test="down != null">
|
|
|
+ and DOWN = #{down}
|
|
|
+ </if>
|
|
|
+ <if test="count != null">
|
|
|
+ and COUNT = #{count}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <sql id="whereLike">
|
|
|
+ <where>
|
|
|
+ <if test="resultId != null">
|
|
|
+ and RESULT_ID = #{resultId}
|
|
|
+ </if>
|
|
|
+ <if test="lineDate != null">
|
|
|
+ and TO_CHAR(LINE_DATE,'yyyy-MM-dd') = #{lineDate}
|
|
|
+ </if>
|
|
|
+ <if test="up != null">
|
|
|
+ and UP = #{up}
|
|
|
+ </if>
|
|
|
+ <if test="down != null">
|
|
|
+ and DOWN = #{down}
|
|
|
+ </if>
|
|
|
+ <if test="count != null">
|
|
|
+ and COUNT = #{count}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
|
|
|
+ delete from TMSSHIP_CONTROL_LINE
|
|
|
+ where RESULT_ID = #{resultId,jdbcType=DECIMAL}
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
|
+ delete from TMSSHIP_CONTROL_LINE
|
|
|
+ where 1!=1
|
|
|
+ <if test="lineDate != null">
|
|
|
+ or TO_CHAR(LINE_DATE,'yyyy-MM-dd') = '#{lineDate}'
|
|
|
+ </if>
|
|
|
+ <if test="up != null">
|
|
|
+ or UP = #{up}
|
|
|
+ </if>
|
|
|
+ <if test="down != null">
|
|
|
+ or DOWN = #{down}
|
|
|
+ </if>
|
|
|
+ <if test="count != null">
|
|
|
+ or COUNT = #{count}
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.steerinfo.dil.model.TmsshipControlLine">
|
|
|
+ insert into TMSSHIP_CONTROL_LINE (RESULT_ID, LINE_DATE, UP,
|
|
|
+ DOWN, COUNT)
|
|
|
+ values (#{resultId,jdbcType=DECIMAL}, #{lineDate,jdbcType=TIMESTAMP}, #{up,jdbcType=DECIMAL},
|
|
|
+ #{down,jdbcType=DECIMAL}, #{count,jdbcType=DECIMAL})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmsshipControlLine">
|
|
|
+ insert into TMSSHIP_CONTROL_LINE
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="resultId != null">
|
|
|
+ RESULT_ID,
|
|
|
+ </if>
|
|
|
+ <if test="lineDate != null">
|
|
|
+ LINE_DATE,
|
|
|
+ </if>
|
|
|
+ <if test="up != null">
|
|
|
+ UP,
|
|
|
+ </if>
|
|
|
+ <if test="down != null">
|
|
|
+ DOWN,
|
|
|
+ </if>
|
|
|
+ <if test="count != null">
|
|
|
+ COUNT,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="resultId != null">
|
|
|
+ #{resultId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="lineDate != null">
|
|
|
+ #{lineDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="up != null">
|
|
|
+ #{up,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="down != null">
|
|
|
+ #{down,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="count != null">
|
|
|
+ #{count,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmsshipControlLine">
|
|
|
+ update TMSSHIP_CONTROL_LINE
|
|
|
+ set LINE_DATE = #{lineDate,jdbcType=TIMESTAMP},
|
|
|
+ UP = #{up,jdbcType=DECIMAL},
|
|
|
+ DOWN = #{down,jdbcType=DECIMAL},
|
|
|
+ COUNT = #{count,jdbcType=DECIMAL}
|
|
|
+ where RESULT_ID = #{resultId,jdbcType=DECIMAL}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmsshipControlLine">
|
|
|
+ update TMSSHIP_CONTROL_LINE
|
|
|
+ <set>
|
|
|
+ <if test="lineDate != null">
|
|
|
+ LINE_DATE = #{lineDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="up != null">
|
|
|
+ UP = #{up,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="down != null">
|
|
|
+ DOWN = #{down,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="count != null">
|
|
|
+ COUNT = #{count,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_CONTROL_LINE
|
|
|
+ (RESULT_ID,
|
|
|
+ LINE_DATE, UP, DOWN,
|
|
|
+ COUNT)
|
|
|
+ ( <foreach collection="list" item="item" separator="union all">
|
|
|
+ select
|
|
|
+ #{item.resultId,jdbcType=DECIMAL},
|
|
|
+ #{item.lineDate,jdbcType=TIMESTAMP}, #{item.up,jdbcType=DECIMAL}, #{item.down,jdbcType=DECIMAL},
|
|
|
+ #{item.count,jdbcType=DECIMAL} from dual
|
|
|
+ </foreach> )
|
|
|
+ </insert>
|
|
|
+ <update id="batchUpdate" parameterType="java.util.List">
|
|
|
+ update TMSSHIP_CONTROL_LINE
|
|
|
+ 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>
|
|
|
+ ,LINE_DATE=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.lineDate,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,UP=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.up,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,DOWN=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.down,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,COUNT=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.count,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_CONTROL_LINE
|
|
|
+ where RESULT_ID in
|
|
|
+ <foreach collection="list" item="id" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+ <!-- 友情提示!!!-->
|
|
|
+ <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
+ <select id="selectMaxId" resultType="java.lang.Short">
|
|
|
+ select SEQ_TMSSHIP_CONTROL.nextval from dual
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getControlLines" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ RESULT_ID "resultId",
|
|
|
+ TO_CHAR(LINE_DATE,'MM') || '月' || TO_CHAR(LINE_DATE,'DD') || '日' "lineDate",
|
|
|
+ UP "up",
|
|
|
+ DOWN "down",
|
|
|
+ UP+DOWN "count"
|
|
|
+ from TMSSHIP_CONTROL_LINE
|
|
|
+ where TO_CHAR(LINE_DATE,'YYYY-MM')=#{time}
|
|
|
+ order by LINE_DATE
|
|
|
+ </select>
|
|
|
+</mapper>
|