|
@@ -0,0 +1,172 @@
|
|
|
+<?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.kgraph.graph.uploadDetail.mapper.AccidentMapper">
|
|
|
+ <resultMap type="Accident" id="AccidentResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="uploadId" column="upload_id" />
|
|
|
+ <result property="extra1" column="extra1" />
|
|
|
+ <result property="extra2" column="extra2" />
|
|
|
+ <result property="extra3" column="extra3" />
|
|
|
+ <result property="extra4" column="extra4" />
|
|
|
+ <result property="extra5" column="extra5" />
|
|
|
+ <result property="extra6" column="extra6" />
|
|
|
+ <result property="extra7" column="extra7" />
|
|
|
+ <result property="extra8" column="extra8" />
|
|
|
+ <result property="extra9" column="extra9" />
|
|
|
+ <result property="extra10" column="extra10" />
|
|
|
+ <result property="extra11" column="extra11" />
|
|
|
+ <result property="extra12" column="extra12" />
|
|
|
+ <result property="extra13" column="extra13" />
|
|
|
+ <result property="extra14" column="extra14" />
|
|
|
+ <result property="extra15" column="extra15" />
|
|
|
+ <result property="extra16" column="extra16" />
|
|
|
+ <result property="extra17" column="extra17" />
|
|
|
+ <result property="extra18" column="extra18" />
|
|
|
+ <result property="extra19" column="extra19" />
|
|
|
+ <result property="extra20" column="extra20" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectAccidentVo">
|
|
|
+ select id, upload_id, extra1, extra2, extra3, extra4, extra5, extra6, extra7, extra8, extra9, extra10, extra11, extra12, extra13, extra14, extra15, extra16, extra17, extra18, extra19, extra20, create_by, create_time, update_by, update_time from t_accident
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectList" parameterType="Accident" resultMap="AccidentResult">
|
|
|
+ <include refid="selectAccidentVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="uploadId != null "> and upload_id = #{uploadId}</if>
|
|
|
+ <if test="extra1 != null and extra1 != ''"> and extra1 = #{extra1}</if>
|
|
|
+ <if test="extra2 != null and extra2 != ''"> and extra2 = #{extra2}</if>
|
|
|
+ <if test="extra3 != null and extra3 != ''"> and extra3 = #{extra3}</if>
|
|
|
+ <if test="extra4 != null and extra4 != ''"> and extra4 = #{extra4}</if>
|
|
|
+ <if test="extra5 != null and extra5 != ''"> and extra5 = #{extra5}</if>
|
|
|
+ <if test="extra6 != null and extra6 != ''"> and extra6 = #{extra6}</if>
|
|
|
+ <if test="extra7 != null and extra7 != ''"> and extra7 = #{extra7}</if>
|
|
|
+ <if test="extra8 != null and extra8 != ''"> and extra8 = #{extra8}</if>
|
|
|
+ <if test="extra9 != null and extra9 != ''"> and extra9 = #{extra9}</if>
|
|
|
+ <if test="extra10 != null and extra10 != ''"> and extra10 = #{extra10}</if>
|
|
|
+ <if test="extra11 != null and extra11 != ''"> and extra11 = #{extra11}</if>
|
|
|
+ <if test="extra12 != null and extra12 != ''"> and extra12 = #{extra12}</if>
|
|
|
+ <if test="extra13 != null and extra13 != ''"> and extra13 = #{extra13}</if>
|
|
|
+ <if test="extra14 != null and extra14 != ''"> and extra14 = #{extra14}</if>
|
|
|
+ <if test="extra15 != null and extra15 != ''"> and extra15 = #{extra15}</if>
|
|
|
+ <if test="extra16 != null and extra16 != ''"> and extra16 = #{extra16}</if>
|
|
|
+ <if test="extra17 != null and extra17 != ''"> and extra17 = #{extra17}</if>
|
|
|
+ <if test="extra18 != null and extra18 != ''"> and extra18 = #{extra18}</if>
|
|
|
+ <if test="extra19 != null and extra19 != ''"> and extra19 = #{extra19}</if>
|
|
|
+ <if test="extra20 != null and extra20 != ''"> and extra20 = #{extra20}</if>
|
|
|
+ </where>
|
|
|
+ ORDER BY create_time ASC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectById" parameterType="Long" resultMap="AccidentResult">
|
|
|
+ <include refid="selectAccidentVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into t_accident
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="uploadId != null">upload_id,</if>
|
|
|
+ <if test="extra1 != null">extra1,</if>
|
|
|
+ <if test="extra2 != null">extra2,</if>
|
|
|
+ <if test="extra3 != null">extra3,</if>
|
|
|
+ <if test="extra4 != null">extra4,</if>
|
|
|
+ <if test="extra5 != null">extra5,</if>
|
|
|
+ <if test="extra6 != null">extra6,</if>
|
|
|
+ <if test="extra7 != null">extra7,</if>
|
|
|
+ <if test="extra8 != null">extra8,</if>
|
|
|
+ <if test="extra9 != null">extra9,</if>
|
|
|
+ <if test="extra10 != null">extra10,</if>
|
|
|
+ <if test="extra11 != null">extra11,</if>
|
|
|
+ <if test="extra12 != null">extra12,</if>
|
|
|
+ <if test="extra13 != null">extra13,</if>
|
|
|
+ <if test="extra14 != null">extra14,</if>
|
|
|
+ <if test="extra15 != null">extra15,</if>
|
|
|
+ <if test="extra16 != null">extra16,</if>
|
|
|
+ <if test="extra17 != null">extra17,</if>
|
|
|
+ <if test="extra18 != null">extra18,</if>
|
|
|
+ <if test="extra19 != null">extra19,</if>
|
|
|
+ <if test="extra20 != null">extra20,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="uploadId != null">#{uploadId},</if>
|
|
|
+ <if test="extra1 != null">#{extra1},</if>
|
|
|
+ <if test="extra2 != null">#{extra2},</if>
|
|
|
+ <if test="extra3 != null">#{extra3},</if>
|
|
|
+ <if test="extra4 != null">#{extra4},</if>
|
|
|
+ <if test="extra5 != null">#{extra5},</if>
|
|
|
+ <if test="extra6 != null">#{extra6},</if>
|
|
|
+ <if test="extra7 != null">#{extra7},</if>
|
|
|
+ <if test="extra8 != null">#{extra8},</if>
|
|
|
+ <if test="extra9 != null">#{extra9},</if>
|
|
|
+ <if test="extra10 != null">#{extra10},</if>
|
|
|
+ <if test="extra11 != null">#{extra11},</if>
|
|
|
+ <if test="extra12 != null">#{extra12},</if>
|
|
|
+ <if test="extra13 != null">#{extra13},</if>
|
|
|
+ <if test="extra14 != null">#{extra14},</if>
|
|
|
+ <if test="extra15 != null">#{extra15},</if>
|
|
|
+ <if test="extra16 != null">#{extra16},</if>
|
|
|
+ <if test="extra17 != null">#{extra17},</if>
|
|
|
+ <if test="extra18 != null">#{extra18},</if>
|
|
|
+ <if test="extra19 != null">#{extra19},</if>
|
|
|
+ <if test="extra20 != null">#{extra20},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="update" parameterType="Accident">
|
|
|
+ update t_accident
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="uploadId != null">upload_id = #{uploadId},</if>
|
|
|
+ <if test="extra1 != null">extra1 = #{extra1},</if>
|
|
|
+ <if test="extra2 != null">extra2 = #{extra2},</if>
|
|
|
+ <if test="extra3 != null">extra3 = #{extra3},</if>
|
|
|
+ <if test="extra4 != null">extra4 = #{extra4},</if>
|
|
|
+ <if test="extra5 != null">extra5 = #{extra5},</if>
|
|
|
+ <if test="extra6 != null">extra6 = #{extra6},</if>
|
|
|
+ <if test="extra7 != null">extra7 = #{extra7},</if>
|
|
|
+ <if test="extra8 != null">extra8 = #{extra8},</if>
|
|
|
+ <if test="extra9 != null">extra9 = #{extra9},</if>
|
|
|
+ <if test="extra10 != null">extra10 = #{extra10},</if>
|
|
|
+ <if test="extra11 != null">extra11 = #{extra11},</if>
|
|
|
+ <if test="extra12 != null">extra12 = #{extra12},</if>
|
|
|
+ <if test="extra13 != null">extra13 = #{extra13},</if>
|
|
|
+ <if test="extra14 != null">extra14 = #{extra14},</if>
|
|
|
+ <if test="extra15 != null">extra15 = #{extra15},</if>
|
|
|
+ <if test="extra16 != null">extra16 = #{extra16},</if>
|
|
|
+ <if test="extra17 != null">extra17 = #{extra17},</if>
|
|
|
+ <if test="extra18 != null">extra18 = #{extra18},</if>
|
|
|
+ <if test="extra19 != null">extra19 = #{extra19},</if>
|
|
|
+ <if test="extra20 != null">extra20 = #{extra20},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteById" parameterType="Long">
|
|
|
+ delete from t_accident where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteByIds" parameterType="String">
|
|
|
+ delete from t_accident where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|