|
@@ -1,141 +0,0 @@
|
|
|
-<?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">
|
|
|
-<!-- namespace必须指向DAO接口 -->
|
|
|
-<mapper namespace="com.jpsoft.supervision.modules.base.dao.IncidentDAO">
|
|
|
- <resultMap id="IncidentMap" type="com.jpsoft.supervision.modules.base.entity.Incident">
|
|
|
- <id property="id" column="id_" />
|
|
|
- <result property="title" column="title_" />
|
|
|
- <result property="content" column="content_" />
|
|
|
- <result property="caseType" column="case_type" />
|
|
|
- <result property="instructions" column="instructions" />
|
|
|
- <result property="instructionsType" column="instructions_type" />
|
|
|
- <result property="instructionsTime" column="instructions_time" />
|
|
|
- <result property="isFinished" column="is_finished" />
|
|
|
- <result property="delFlag" column="del_flag" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="createBy" column="create_by" />
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
- <result property="updateBy" column="update_by" />
|
|
|
- </resultMap>
|
|
|
- <insert id="insert" parameterType="com.jpsoft.supervision.modules.base.entity.Incident">
|
|
|
- <!--
|
|
|
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
|
- select sys_guid() from dual
|
|
|
- </selectKey>
|
|
|
- -->
|
|
|
- <![CDATA[
|
|
|
- insert into base_incident
|
|
|
- (id_,title_,content_,case_type,instructions,instructions_type,instructions_time,is_finished,del_flag,create_time,create_by,update_time,update_by)
|
|
|
- values
|
|
|
- (
|
|
|
-#{id,jdbcType=VARCHAR}
|
|
|
-,#{title,jdbcType=VARCHAR}
|
|
|
-,#{content,jdbcType=VARCHAR}
|
|
|
-,#{caseType,jdbcType=VARCHAR}
|
|
|
-,#{instructions,jdbcType=VARCHAR}
|
|
|
-,#{instructionsType,jdbcType=VARCHAR}
|
|
|
-,#{instructionsTime,jdbcType= TIMESTAMP }
|
|
|
-,#{isFinished,jdbcType= NUMERIC }
|
|
|
-,#{delFlag,jdbcType= NUMERIC }
|
|
|
-,#{createTime,jdbcType= TIMESTAMP }
|
|
|
-,#{createBy,jdbcType=VARCHAR}
|
|
|
-,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
-,#{updateBy,jdbcType=VARCHAR}
|
|
|
- )
|
|
|
- ]]>
|
|
|
- </insert>
|
|
|
- <delete id="delete" parameterType="string">
|
|
|
- delete from base_incident where id_=#{id,jdbcType=VARCHAR}
|
|
|
- </delete>
|
|
|
- <update id="update" parameterType="com.jpsoft.supervision.modules.base.entity.Incident">
|
|
|
- update base_incident
|
|
|
- <set>
|
|
|
- <if test="title!=null">
|
|
|
- title_=#{title,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="content!=null">
|
|
|
- content_=#{content,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="caseType!=null">
|
|
|
- case_type=#{caseType,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="instructions!=null">
|
|
|
- instructions=#{instructions,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="instructionsType!=null">
|
|
|
- instructions_type=#{instructionsType,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="instructionsTime!=null">
|
|
|
- instructions_time=#{instructionsTime,jdbcType= TIMESTAMP },
|
|
|
- </if>
|
|
|
- <if test="isFinished!=null">
|
|
|
- is_finished=#{isFinished,jdbcType= NUMERIC },
|
|
|
- </if>
|
|
|
- <if test="delFlag!=null">
|
|
|
- del_flag=#{delFlag,jdbcType= NUMERIC },
|
|
|
- </if>
|
|
|
- <if test="createTime!=null">
|
|
|
- create_time=#{createTime,jdbcType= TIMESTAMP },
|
|
|
- </if>
|
|
|
- <if test="createBy!=null">
|
|
|
- create_by=#{createBy,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="updateTime!=null">
|
|
|
- update_time=#{updateTime,jdbcType= TIMESTAMP },
|
|
|
- </if>
|
|
|
- <if test="updateBy!=null">
|
|
|
- update_by=#{updateBy,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where id_=#{id}
|
|
|
- </update>
|
|
|
- <select id="get" parameterType="string" resultMap="IncidentMap">
|
|
|
- select
|
|
|
-id_,title_,content_,case_type,instructions,instructions_type,instructions_time,is_finished,del_flag,create_time,create_by,update_time,update_by from base_incident where id_=#{0}
|
|
|
- </select>
|
|
|
- <select id="exist" parameterType="string" resultType="int">
|
|
|
- select count(*) from base_incident where id_=#{0}
|
|
|
- </select>
|
|
|
- <select id="list" resultMap="IncidentMap">
|
|
|
- select * from base_incident
|
|
|
- </select>
|
|
|
- <select id="search" parameterType="hashmap" resultMap="IncidentMap">
|
|
|
- <![CDATA[
|
|
|
- select * from base_incident
|
|
|
- ]]>
|
|
|
- <where>
|
|
|
- and del_flag=0
|
|
|
- <if test="searchParams.title != null">
|
|
|
- and title_ like #{searchParams.title}
|
|
|
- </if>
|
|
|
- <if test="searchParams.caseType != null">
|
|
|
- and case_type = #{searchParams.caseType}
|
|
|
- </if>
|
|
|
- <if test="searchParams.isFinished != null">
|
|
|
- and is_finished = #{searchParams.isFinished}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
- ${sort.name} ${sort.order}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
- <select id="searchPanding" parameterType="hashmap" resultMap="IncidentMap">
|
|
|
- <![CDATA[
|
|
|
- SELECT b.* FROM base_incident_step a
|
|
|
- LEFT JOIN base_incident b ON a.incident_id = b.id_
|
|
|
- ]]>
|
|
|
- <where>
|
|
|
- and a.update_time IS NULL AND b.del_flag=0
|
|
|
- <if test="searchParams.title != null">
|
|
|
- and b.title_ like #{searchParams.title}
|
|
|
- </if>
|
|
|
- <if test="searchParams.caseType != null">
|
|
|
- and b.case_type = #{searchParams.caseType}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
- ${sort.name} ${sort.order}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
-</mapper>
|