123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- <?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.DilCapacityTimesMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.DilCapacityTimes">
- <id column="TIMES_ID" jdbcType="DECIMAL" property="timesId" />
- <result column="TIMES_VALUE" jdbcType="TIMESTAMP" property="timesValue" />
- <result column="TIMES_TYPE" jdbcType="DECIMAL" property="timesType" />
- <result column="TIMES_REMARK" jdbcType="VARCHAR" property="timesRemark" />
- <result column="TIMES_CAPACITY_NUMBER" jdbcType="VARCHAR" property="timesCapacityNumber" />
- </resultMap>
- <sql id="columns">
- TIMES_ID, TIMES_VALUE, TIMES_TYPE, TIMES_REMARK, TIMES_CAPACITY_NUMBER
- </sql>
- <sql id="columns_alias">
- t.TIMES_ID, t.TIMES_VALUE, t.TIMES_TYPE, t.TIMES_REMARK, t.TIMES_CAPACITY_NUMBER
- </sql>
- <sql id="select">
- SELECT <include refid="columns"/> FROM DIL_CAPACITY_TIMES
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias"/> FROM DIL_CAPACITY_TIMES t
- </sql>
- <sql id="where">
- <where>
- <if test="timesId != null">
- and TIMES_ID = #{timesId}
- </if>
- <if test="timesValue != null">
- and TO_CHAR(TIMES_VALUE,'yyyy-MM-dd') = #{timesValue}
- </if>
- <if test="timesType != null">
- and TIMES_TYPE = #{timesType}
- </if>
- <if test="timesRemark != null and timesRemark != ''">
- and TIMES_REMARK = #{timesRemark}
- </if>
- <if test="timesCapacityNumber != null and timesCapacityNumber != ''">
- and TIMES_CAPACITY_NUMBER = #{timesCapacityNumber}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="timesId != null">
- and TIMES_ID = #{timesId}
- </if>
- <if test="timesValue != null">
- and TO_CHAR(TIMES_VALUE,'yyyy-MM-dd') = #{timesValue}
- </if>
- <if test="timesType != null">
- and TIMES_TYPE = #{timesType}
- </if>
- <if test="timesRemark != null and timesRemark != ''">
- and TIMES_REMARK LIKE '%${timesRemark}%'
- </if>
- <if test="timesCapacityNumber != null and timesCapacityNumber != ''">
- and TIMES_CAPACITY_NUMBER LIKE '%${timesCapacityNumber}%'
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
- delete from DIL_CAPACITY_TIMES
- where TIMES_ID = #{timesId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from DIL_CAPACITY_TIMES
- where 1!=1
- <if test="timesValue != null">
- or TO_CHAR(TIMES_VALUE,'yyyy-MM-dd') = '#{timesValue}'
- </if>
- <if test="timesType != null">
- or TIMES_TYPE = #{timesType}
- </if>
- <if test="timesRemark != null and timesRemark != ''">
- or TIMES_REMARK = #{timesRemark}
- </if>
- <if test="timesCapacityNumber != null and timesCapacityNumber != ''">
- or TIMES_CAPACITY_NUMBER = #{timesCapacityNumber}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.DilCapacityTimes">
- insert into DIL_CAPACITY_TIMES (TIMES_ID, TIMES_VALUE, TIMES_TYPE,
- TIMES_REMARK, TIMES_CAPACITY_NUMBER)
- values (#{timesId,jdbcType=DECIMAL}, #{timesValue,jdbcType=TIMESTAMP}, #{timesType,jdbcType=DECIMAL},
- #{timesRemark,jdbcType=VARCHAR}, #{timesCapacityNumber,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.DilCapacityTimes">
- insert into DIL_CAPACITY_TIMES
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="timesId != null">
- TIMES_ID,
- </if>
- <if test="timesValue != null">
- TIMES_VALUE,
- </if>
- <if test="timesType != null">
- TIMES_TYPE,
- </if>
- <if test="timesRemark != null">
- TIMES_REMARK,
- </if>
- <if test="timesCapacityNumber != null">
- TIMES_CAPACITY_NUMBER,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="timesId != null">
- #{timesId,jdbcType=DECIMAL},
- </if>
- <if test="timesValue != null">
- #{timesValue,jdbcType=TIMESTAMP},
- </if>
- <if test="timesType != null">
- #{timesType,jdbcType=DECIMAL},
- </if>
- <if test="timesRemark != null">
- #{timesRemark,jdbcType=VARCHAR},
- </if>
- <if test="timesCapacityNumber != null">
- #{timesCapacityNumber,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.DilCapacityTimes">
- update DIL_CAPACITY_TIMES
- set TIMES_VALUE = #{timesValue,jdbcType=TIMESTAMP},
- TIMES_TYPE = #{timesType,jdbcType=DECIMAL},
- TIMES_REMARK = #{timesRemark,jdbcType=VARCHAR},
- TIMES_CAPACITY_NUMBER = #{timesCapacityNumber,jdbcType=VARCHAR}
- where TIMES_ID = #{timesId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.DilCapacityTimes">
- update DIL_CAPACITY_TIMES
- <set>
- <if test="timesValue != null">
- TIMES_VALUE = #{timesValue,jdbcType=TIMESTAMP},
- </if>
- <if test="timesType != null">
- TIMES_TYPE = #{timesType,jdbcType=DECIMAL},
- </if>
- <if test="timesRemark != null">
- TIMES_REMARK = #{timesRemark,jdbcType=VARCHAR},
- </if>
- <if test="timesCapacityNumber != null">
- TIMES_CAPACITY_NUMBER = #{timesCapacityNumber,jdbcType=VARCHAR},
- </if>
- </set>
- where TIMES_ID = #{timesId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
- <include refid="select"/>
- where TIMES_ID = #{timesId,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 DIL_CAPACITY_TIMES
- (TIMES_ID,
- TIMES_VALUE, TIMES_TYPE, TIMES_REMARK,
- TIMES_CAPACITY_NUMBER)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.timesId,jdbcType=DECIMAL},
- #{item.timesValue,jdbcType=TIMESTAMP}, #{item.timesType,jdbcType=DECIMAL}, #{item.timesRemark,jdbcType=VARCHAR},
- #{item.timesCapacityNumber,jdbcType=VARCHAR} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update DIL_CAPACITY_TIMES
- set
- TIMES_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case TIMES_ID" close="end">
- when #{item.timesId,jdbcType=DECIMAL} then #{item.timesId,jdbcType=DECIMAL}
- </foreach>
- ,TIMES_VALUE=
- <foreach collection="list" item="item" index="index" separator=" " open="case TIMES_ID" close="end">
- when #{item.timesId,jdbcType=DECIMAL} then #{item.timesValue,jdbcType=TIMESTAMP}
- </foreach>
- ,TIMES_TYPE=
- <foreach collection="list" item="item" index="index" separator=" " open="case TIMES_ID" close="end">
- when #{item.timesId,jdbcType=DECIMAL} then #{item.timesType,jdbcType=DECIMAL}
- </foreach>
- ,TIMES_REMARK=
- <foreach collection="list" item="item" index="index" separator=" " open="case TIMES_ID" close="end">
- when #{item.timesId,jdbcType=DECIMAL} then #{item.timesRemark,jdbcType=VARCHAR}
- </foreach>
- ,TIMES_CAPACITY_NUMBER=
- <foreach collection="list" item="item" index="index" separator=" " open="case TIMES_ID" close="end">
- when #{item.timesId,jdbcType=DECIMAL} then #{item.timesCapacityNumber,jdbcType=VARCHAR}
- </foreach>
- where TIMES_ID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.timesId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from DIL_CAPACITY_TIMES
- where TIMES_ID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- </mapper>
|