|
|
@@ -0,0 +1,212 @@
|
|
|
+<?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.railway.business.safetool.mapper.SecTestRecordMapper">
|
|
|
+
|
|
|
+ <resultMap id="BaseResultMap" type="com.railway.business.safetool.domain.SecTestRecord">
|
|
|
+ <result column="id" property="id"/>
|
|
|
+ <result column="dept_id" property="deptId"/>
|
|
|
+ <result column="store_place" property="storePlace"/>
|
|
|
+ <result column="lab_id" property="labId"/>
|
|
|
+ <result column="closing_time" property="closingTime"/>
|
|
|
+ <result column="apply_user" property="applyUser"/>
|
|
|
+ <result column="test_time" property="testTime"/>
|
|
|
+ <result column="test_user" property="testUser"/>
|
|
|
+ <result column="state" property="state"/>
|
|
|
+ <result column="del_flag" property="delFlag"/>
|
|
|
+ <result column="create_by" property="createBy"/>
|
|
|
+ <result column="create_time" property="createTime"/>
|
|
|
+ <result column="update_by" property="updateBy"/>
|
|
|
+ <result column="update_time" property="updateTime"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ id,
|
|
|
+ dept_id,
|
|
|
+ store_place,
|
|
|
+ lab_id,
|
|
|
+ closing_time,
|
|
|
+ apply_user,
|
|
|
+ test_time,
|
|
|
+ test_user,
|
|
|
+ state,
|
|
|
+ del_flag,
|
|
|
+ create_by,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_time
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <insert id="insert" parameterType="com.railway.business.safetool.domain.SecTestRecord">
|
|
|
+ <selectKey keyProperty="id" order="BEFORE" resultType="String">
|
|
|
+ select replace(uuid(), '-', '') from dual
|
|
|
+ </selectKey>
|
|
|
+ INSERT INTO sec_test_record
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test='null != deptId'>
|
|
|
+ dept_id,
|
|
|
+ </if>
|
|
|
+ <if test='null != storePlace'>
|
|
|
+ store_place,
|
|
|
+ </if>
|
|
|
+ <if test='null != labId'>
|
|
|
+ lab_id,
|
|
|
+ </if>
|
|
|
+ <if test='null != closingTime'>
|
|
|
+ closing_time,
|
|
|
+ </if>
|
|
|
+ <if test='null != applyUser'>
|
|
|
+ apply_user,
|
|
|
+ </if>
|
|
|
+ <if test='null != testTime'>
|
|
|
+ test_time,
|
|
|
+ </if>
|
|
|
+ <if test='null != testUser'>
|
|
|
+ test_user,
|
|
|
+ </if>
|
|
|
+ <if test='null != state'>
|
|
|
+ state,
|
|
|
+ </if>
|
|
|
+ <if test='null != delFlag'>
|
|
|
+ del_flag,
|
|
|
+ </if>
|
|
|
+ <if test='null != createBy'>
|
|
|
+ create_by,
|
|
|
+ </if>
|
|
|
+ <if test='null != createTime'>
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ <if test='null != updateBy'>
|
|
|
+ update_by,
|
|
|
+ </if>
|
|
|
+ <if test='null != updateTime'>
|
|
|
+ update_time
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test='null != deptId'>
|
|
|
+ #{deptId},
|
|
|
+ </if>
|
|
|
+ <if test='null != storePlace'>
|
|
|
+ #{storePlace},
|
|
|
+ </if>
|
|
|
+ <if test='null != labId'>
|
|
|
+ #{labId},
|
|
|
+ </if>
|
|
|
+ <if test='null != closingTime'>
|
|
|
+ #{closingTime},
|
|
|
+ </if>
|
|
|
+ <if test='null != applyUser'>
|
|
|
+ #{applyUser},
|
|
|
+ </if>
|
|
|
+ <if test='null != testTime'>
|
|
|
+ #{testTime},
|
|
|
+ </if>
|
|
|
+ <if test='null != testUser'>
|
|
|
+ #{testUser},
|
|
|
+ </if>
|
|
|
+ <if test='null != state'>
|
|
|
+ #{state},
|
|
|
+ </if>
|
|
|
+ <if test='null != delFlag'>
|
|
|
+ #{delFlag},
|
|
|
+ </if>
|
|
|
+ <if test='null != createBy'>
|
|
|
+ #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test='null != createTime'>
|
|
|
+ #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test='null != updateBy'>
|
|
|
+ #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test='null != updateTime'>
|
|
|
+ #{updateTime}
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <delete id="delete">
|
|
|
+ UPDATE sec_test_record
|
|
|
+ set del_flag='1'
|
|
|
+ WHERE id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <update id="update" parameterType="com.railway.business.safetool.domain.SecTestRecord">
|
|
|
+ UPDATE sec_test_record
|
|
|
+ <set>
|
|
|
+ <if test='null != deptId'>dept_id = #{deptId},</if>
|
|
|
+ <if test='null != storePlace'>store_place = #{storePlace},</if>
|
|
|
+ <if test='null != labId'>lab_id = #{labId},</if>
|
|
|
+ <if test='null != closingTime'>closing_time = #{closingTime},</if>
|
|
|
+ <if test='null != applyUser'>apply_user = #{applyUser},</if>
|
|
|
+ <if test='null != testTime'>test_time = #{testTime},</if>
|
|
|
+ <if test='null != testUser'>test_user = #{testUser},</if>
|
|
|
+ <if test='null != state'>state = #{state},</if>
|
|
|
+ <if test='null != delFlag'>del_flag = #{delFlag},</if>
|
|
|
+ <if test='null != createBy'>create_by = #{createBy},</if>
|
|
|
+ <if test='null != createTime'>create_time = #{createTime},</if>
|
|
|
+ <if test='null != updateBy'>update_by = #{updateBy},</if>
|
|
|
+ <if test='null != updateTime'>update_time = #{updateTime}</if>
|
|
|
+ </set>
|
|
|
+ WHERE id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getInfo" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM sec_test_record
|
|
|
+ WHERE del_flag='0' and id = #{id}
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getList" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM sec_test_record
|
|
|
+ <where>
|
|
|
+ del_flag='0'
|
|
|
+ <if test="deptId!=null and deptId!=''">
|
|
|
+ and dept_id=#{deptId}
|
|
|
+ </if>
|
|
|
+ <if test="storePlace!=null and storePlace!=''">
|
|
|
+ and store_place=#{storePlace}
|
|
|
+ </if>
|
|
|
+ <if test="labId!=null and labId!=''">
|
|
|
+ and lab_id=#{labId}
|
|
|
+ </if>
|
|
|
+ <if test="closingTime!=null and closingTime!=''">
|
|
|
+ and closing_time=#{closingTime}
|
|
|
+ </if>
|
|
|
+ <if test="applyUser!=null and applyUser!=''">
|
|
|
+ and apply_user=#{applyUser}
|
|
|
+ </if>
|
|
|
+ <if test="testTime!=null and testTime!=''">
|
|
|
+ and test_time=#{testTime}
|
|
|
+ </if>
|
|
|
+ <if test="testUser!=null and testUser!=''">
|
|
|
+ and test_user=#{testUser}
|
|
|
+ </if>
|
|
|
+ <if test="state!=null and state!=''">
|
|
|
+ and state=#{state}
|
|
|
+ </if>
|
|
|
+ <if test="delFlag!=null and delFlag!=''">
|
|
|
+ and del_flag=#{delFlag}
|
|
|
+ </if>
|
|
|
+ <if test="createBy!=null and createBy!=''">
|
|
|
+ and create_by=#{createBy}
|
|
|
+ </if>
|
|
|
+ <if test="createTime!=null and createTime!=''">
|
|
|
+ and create_time=#{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="updateBy!=null and updateBy!=''">
|
|
|
+ and update_by=#{updateBy}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime!=null and updateTime!=''">
|
|
|
+ and update_time=#{updateTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|