|
|
@@ -0,0 +1,290 @@
|
|
|
+<?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.meterwork.meterworkcheckfirstactual.mapper.MeterWorkCheckFirstActualMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.steerinfo.meterwork.meterworkcheckfirstactual.model.MeterWorkCheckFirstActual">
|
|
|
+ <id column="ID" jdbcType="VARCHAR" property="id" />
|
|
|
+ <result column="CHECK_ID" jdbcType="VARCHAR" property="checkId" />
|
|
|
+ <result column="CHECK_START_TIME" jdbcType="TIMESTAMP" property="checkStartTime" />
|
|
|
+ <result column="CHECK_END_TIME" jdbcType="TIMESTAMP" property="checkEndTime" />
|
|
|
+ <result column="CHECK_USED_SECONDS" jdbcType="DECIMAL" property="checkUsedSeconds" />
|
|
|
+ <result column="CHECK_MAN_NO" jdbcType="VARCHAR" property="checkManNo" />
|
|
|
+ <result column="CHECK_MAN_NAME" jdbcType="VARCHAR" property="checkManName" />
|
|
|
+ <result column="CHECK_RESULT" jdbcType="VARCHAR" property="checkResult" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="columns">
|
|
|
+ ID, CHECK_ID, CHECK_START_TIME, CHECK_END_TIME, CHECK_USED_SECONDS, CHECK_MAN_NO,
|
|
|
+ CHECK_MAN_NAME, CHECK_RESULT
|
|
|
+ </sql>
|
|
|
+ <sql id="columns_alias">
|
|
|
+ t.ID, t.CHECK_ID, t.CHECK_START_TIME, t.CHECK_END_TIME, t.CHECK_USED_SECONDS, t.CHECK_MAN_NO,
|
|
|
+ t.CHECK_MAN_NAME, t.CHECK_RESULT
|
|
|
+ </sql>
|
|
|
+ <sql id="select">
|
|
|
+ SELECT <include refid="columns"/> FROM METER_WORK_CHECK_FIRST_ACTUAL
|
|
|
+ </sql>
|
|
|
+ <sql id="select_alias">
|
|
|
+ SELECT <include refid="columns_alias"/> FROM METER_WORK_CHECK_FIRST_ACTUAL t
|
|
|
+ </sql>
|
|
|
+ <sql id="where">
|
|
|
+ <where>
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and ID = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="checkId != null and checkId != ''">
|
|
|
+ and CHECK_ID = #{checkId}
|
|
|
+ </if>
|
|
|
+ <if test="checkStartTime != null">
|
|
|
+ and TO_CHAR(CHECK_START_TIME,'yyyy-MM-dd') = #{checkStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="checkEndTime != null">
|
|
|
+ and TO_CHAR(CHECK_END_TIME,'yyyy-MM-dd') = #{checkEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="checkUsedSeconds != null">
|
|
|
+ and CHECK_USED_SECONDS = #{checkUsedSeconds}
|
|
|
+ </if>
|
|
|
+ <if test="checkManNo != null and checkManNo != ''">
|
|
|
+ and CHECK_MAN_NO = #{checkManNo}
|
|
|
+ </if>
|
|
|
+ <if test="checkManName != null and checkManName != ''">
|
|
|
+ and CHECK_MAN_NAME = #{checkManName}
|
|
|
+ </if>
|
|
|
+ <if test="checkResult != null and checkResult != ''">
|
|
|
+ and CHECK_RESULT = #{checkResult}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <sql id="whereLike">
|
|
|
+ <where>
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and ID LIKE '%${id}%'
|
|
|
+ </if>
|
|
|
+ <if test="checkId != null and checkId != ''">
|
|
|
+ and CHECK_ID LIKE '%${checkId}%'
|
|
|
+ </if>
|
|
|
+ <if test="checkStartTime != null">
|
|
|
+ and TO_CHAR(CHECK_START_TIME,'yyyy-MM-dd') = #{checkStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="checkEndTime != null">
|
|
|
+ and TO_CHAR(CHECK_END_TIME,'yyyy-MM-dd') = #{checkEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="checkUsedSeconds != null">
|
|
|
+ and CHECK_USED_SECONDS = #{checkUsedSeconds}
|
|
|
+ </if>
|
|
|
+ <if test="checkManNo != null and checkManNo != ''">
|
|
|
+ and CHECK_MAN_NO LIKE '%${checkManNo}%'
|
|
|
+ </if>
|
|
|
+ <if test="checkManName != null and checkManName != ''">
|
|
|
+ and CHECK_MAN_NAME LIKE '%${checkManName}%'
|
|
|
+ </if>
|
|
|
+ <if test="checkResult != null and checkResult != ''">
|
|
|
+ and CHECK_RESULT LIKE '%${checkResult}%'
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
+ delete from METER_WORK_CHECK_FIRST_ACTUAL
|
|
|
+ where ID = #{id,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
|
+ delete from METER_WORK_CHECK_FIRST_ACTUAL
|
|
|
+ where 1!=1
|
|
|
+ <if test="checkId != null and checkId != ''">
|
|
|
+ or CHECK_ID = #{checkId}
|
|
|
+ </if>
|
|
|
+ <if test="checkStartTime != null">
|
|
|
+ or TO_CHAR(CHECK_START_TIME,'yyyy-MM-dd') = '#{checkStartTime}'
|
|
|
+ </if>
|
|
|
+ <if test="checkEndTime != null">
|
|
|
+ or TO_CHAR(CHECK_END_TIME,'yyyy-MM-dd') = '#{checkEndTime}'
|
|
|
+ </if>
|
|
|
+ <if test="checkUsedSeconds != null">
|
|
|
+ or CHECK_USED_SECONDS = #{checkUsedSeconds}
|
|
|
+ </if>
|
|
|
+ <if test="checkManNo != null and checkManNo != ''">
|
|
|
+ or CHECK_MAN_NO = #{checkManNo}
|
|
|
+ </if>
|
|
|
+ <if test="checkManName != null and checkManName != ''">
|
|
|
+ or CHECK_MAN_NAME = #{checkManName}
|
|
|
+ </if>
|
|
|
+ <if test="checkResult != null and checkResult != ''">
|
|
|
+ or CHECK_RESULT = #{checkResult}
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.steerinfo.meterwork.meterworkcheckfirstactual.model.MeterWorkCheckFirstActual">
|
|
|
+ insert into METER_WORK_CHECK_FIRST_ACTUAL (ID, CHECK_ID, CHECK_START_TIME,
|
|
|
+ CHECK_END_TIME, CHECK_USED_SECONDS, CHECK_MAN_NO,
|
|
|
+ CHECK_MAN_NAME, CHECK_RESULT)
|
|
|
+ values (#{id,jdbcType=VARCHAR}, #{checkId,jdbcType=VARCHAR}, #{checkStartTime,jdbcType=TIMESTAMP},
|
|
|
+ #{checkEndTime,jdbcType=TIMESTAMP}, #{checkUsedSeconds,jdbcType=DECIMAL}, #{checkManNo,jdbcType=VARCHAR},
|
|
|
+ #{checkManName,jdbcType=VARCHAR}, #{checkResult,jdbcType=VARCHAR})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.steerinfo.meterwork.meterworkcheckfirstactual.model.MeterWorkCheckFirstActual">
|
|
|
+ insert into METER_WORK_CHECK_FIRST_ACTUAL
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ ID,
|
|
|
+ </if>
|
|
|
+ <if test="checkId != null">
|
|
|
+ CHECK_ID,
|
|
|
+ </if>
|
|
|
+ <if test="checkStartTime != null">
|
|
|
+ CHECK_START_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="checkEndTime != null">
|
|
|
+ CHECK_END_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="checkUsedSeconds != null">
|
|
|
+ CHECK_USED_SECONDS,
|
|
|
+ </if>
|
|
|
+ <if test="checkManNo != null">
|
|
|
+ CHECK_MAN_NO,
|
|
|
+ </if>
|
|
|
+ <if test="checkManName != null">
|
|
|
+ CHECK_MAN_NAME,
|
|
|
+ </if>
|
|
|
+ <if test="checkResult != null">
|
|
|
+ CHECK_RESULT,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ #{id,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="checkId != null">
|
|
|
+ #{checkId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="checkStartTime != null">
|
|
|
+ #{checkStartTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="checkEndTime != null">
|
|
|
+ #{checkEndTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="checkUsedSeconds != null">
|
|
|
+ #{checkUsedSeconds,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="checkManNo != null">
|
|
|
+ #{checkManNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="checkManName != null">
|
|
|
+ #{checkManName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="checkResult != null">
|
|
|
+ #{checkResult,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.steerinfo.meterwork.meterworkcheckfirstactual.model.MeterWorkCheckFirstActual">
|
|
|
+ update METER_WORK_CHECK_FIRST_ACTUAL
|
|
|
+ set CHECK_ID = #{checkId,jdbcType=VARCHAR},
|
|
|
+ CHECK_START_TIME = #{checkStartTime,jdbcType=TIMESTAMP},
|
|
|
+ CHECK_END_TIME = #{checkEndTime,jdbcType=TIMESTAMP},
|
|
|
+ CHECK_USED_SECONDS = #{checkUsedSeconds,jdbcType=DECIMAL},
|
|
|
+ CHECK_MAN_NO = #{checkManNo,jdbcType=VARCHAR},
|
|
|
+ CHECK_MAN_NAME = #{checkManName,jdbcType=VARCHAR},
|
|
|
+ CHECK_RESULT = #{checkResult,jdbcType=VARCHAR}
|
|
|
+ where ID = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.meterwork.meterworkcheckfirstactual.model.MeterWorkCheckFirstActual">
|
|
|
+ update METER_WORK_CHECK_FIRST_ACTUAL
|
|
|
+ <set>
|
|
|
+ <if test="checkId != null">
|
|
|
+ CHECK_ID = #{checkId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="checkStartTime != null">
|
|
|
+ CHECK_START_TIME = #{checkStartTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="checkEndTime != null">
|
|
|
+ CHECK_END_TIME = #{checkEndTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="checkUsedSeconds != null">
|
|
|
+ CHECK_USED_SECONDS = #{checkUsedSeconds,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="checkManNo != null">
|
|
|
+ CHECK_MAN_NO = #{checkManNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="checkManName != null">
|
|
|
+ CHECK_MAN_NAME = #{checkManName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="checkResult != null">
|
|
|
+ CHECK_RESULT = #{checkResult,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where ID = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ <include refid="select"/>
|
|
|
+ where ID = #{id,jdbcType=VARCHAR}
|
|
|
+ </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 METER_WORK_CHECK_FIRST_ACTUAL
|
|
|
+ (ID,
|
|
|
+ CHECK_ID, CHECK_START_TIME, CHECK_END_TIME,
|
|
|
+ CHECK_USED_SECONDS, CHECK_MAN_NO,
|
|
|
+ CHECK_MAN_NAME, CHECK_RESULT)
|
|
|
+ ( <foreach collection="list" item="item" separator="union all">
|
|
|
+ select
|
|
|
+ #{item.id,jdbcType=VARCHAR},
|
|
|
+ #{item.checkId,jdbcType=VARCHAR}, #{item.checkStartTime,jdbcType=TIMESTAMP}, #{item.checkEndTime,jdbcType=TIMESTAMP},
|
|
|
+ #{item.checkUsedSeconds,jdbcType=DECIMAL}, #{item.checkManNo,jdbcType=VARCHAR},
|
|
|
+ #{item.checkManName,jdbcType=VARCHAR}, #{item.checkResult,jdbcType=VARCHAR} from dual
|
|
|
+ </foreach> )
|
|
|
+ </insert>
|
|
|
+ <update id="batchUpdate" parameterType="java.util.List">
|
|
|
+ update METER_WORK_CHECK_FIRST_ACTUAL
|
|
|
+ set
|
|
|
+ ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.id,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,CHECK_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.checkId,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,CHECK_START_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.checkStartTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,CHECK_END_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.checkEndTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,CHECK_USED_SECONDS=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.checkUsedSeconds,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,CHECK_MAN_NO=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.checkManNo,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,CHECK_MAN_NAME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.checkManName,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,CHECK_RESULT=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.checkResult,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ where ID in
|
|
|
+ <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
|
+ #{item.id,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+ <delete id="batchDelete" parameterType="java.util.List">
|
|
|
+ delete from METER_WORK_CHECK_FIRST_ACTUAL
|
|
|
+ where ID in
|
|
|
+ <foreach collection="list" item="id" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+ <!-- 友情提示!!!-->
|
|
|
+ <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
+
|
|
|
+</mapper>
|