12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?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.persagy.adm.diagram.dao.DiagramMapper">
- <resultMap id="diagramBaseMap" type="com.persagy.adm.diagram.entity.DiagramEntity">
- <id column="id" property="id" jdbcType="VARCHAR"/>
- <result column="name" property="name" jdbcType="VARCHAR"/>
- <result column="remark" property="remark" jdbcType="VARCHAR"/>
- <result column="type" property="type" jdbcType="VARCHAR"/>
- <result column="bt_system" property="system" jdbcType="VARCHAR"/>
- <result column="template_id" property="templateId" jdbcType="VARCHAR"/>
- <result column="project_id" property="projectId" jdbcType="VARCHAR"/>
- <result column="system_id" property="systemId" jdbcType="VARCHAR"/>
- <result column="group_code" property="groupCode" jdbcType="VARCHAR"/>
- <result column="diagram_content" property="diagramContent" jdbcType="VARCHAR"/>
- <result column="creator" property="creator" jdbcType="VARCHAR"/>
- <result column="creation_time" property="creationTime" jdbcType="CHAR"/>
- <result column="modifier" property="modifier" jdbcType="VARCHAR"/>
- <result column="modified_time" property="modifiedTime" jdbcType="CHAR"/>
- <result column="valid" property="valid" jdbcType="TINYINT"/>
- <result column="ts" property="ts" jdbcType="TIMESTAMP"/>
- </resultMap>
- <sql id="baseSql">
- id,name,remark,type,bt_system,template_id,project_id,system_id,group_code,diagram_content,
- creator,creation_time,modifier,modified_time,valid,ts
- </sql>
- <insert id="saveDiagram">
- INSERT INTO diagram
- (id,name,remark,type,bt_system,template_id,
- project_id,system_id,group_code,diagram_content,
- creator,creation_time,modifier,modified_time)
- VALUES
- (#{id},#{name},#{remark},#{type},#{system},#{templateId},
- #{projectId},#{systemId},#{groupCode},#{diagramContent},
- #{creator}, #{creationTime},#{modifier},#{modifiedTime})
- </insert>
- <delete id="deleteByDiagramId">
- DELETE FROM diagram
- WHERE id=#{diagramId}
- </delete>
- <select id="getDiagram" resultMap="diagramBaseMap">
- SELECT
- <include refid="baseSql"/>
- FROM diagram
- WHERE id=#{diagramId}
- </select>
- <select id="getDiagrams" resultMap="diagramBaseMap">
- SELECT
- <include refid="baseSql"/>
- FROM diagram
- WHERE 1=1
- <if test="null != diagramType and diagramType.length > 0">
- AND type=#{diagramType}
- </if>
- <if test="null != projectId and projectId.length > 0">
- AND project_id=#{projectId}
- </if>
- <if test="null != systemId and systemId.length > 0">
- AND system_id=#{systemId}
- </if>
- <if test="null != groupCode and groupCode.length > 0">
- AND group_code=#{groupCode}
- </if>
- </select>
- </mapper>
|