Diagram.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.persagy.adm.diagram.dao.DiagramMapper">
  4. <resultMap id="diagramBaseMap" type="com.persagy.adm.diagram.entity.DiagramEntity">
  5. <id column="id" property="id" jdbcType="VARCHAR"/>
  6. <result column="name" property="name" jdbcType="VARCHAR"/>
  7. <result column="remark" property="remark" jdbcType="VARCHAR"/>
  8. <result column="type" property="type" jdbcType="VARCHAR"/>
  9. <result column="bt_system" property="system" jdbcType="VARCHAR"/>
  10. <result column="template_id" property="templateId" jdbcType="VARCHAR"/>
  11. <result column="project_id" property="projectId" jdbcType="VARCHAR"/>
  12. <result column="system_id" property="systemId" jdbcType="VARCHAR"/>
  13. <result column="group_code" property="groupCode" jdbcType="VARCHAR"/>
  14. <result column="diagram_content" property="diagramContent" jdbcType="VARCHAR"/>
  15. <result column="creator" property="creator" jdbcType="VARCHAR"/>
  16. <result column="creation_time" property="creationTime" jdbcType="CHAR"/>
  17. <result column="modifier" property="modifier" jdbcType="VARCHAR"/>
  18. <result column="modified_time" property="modifiedTime" jdbcType="CHAR"/>
  19. <result column="valid" property="valid" jdbcType="TINYINT"/>
  20. <result column="ts" property="ts" jdbcType="TIMESTAMP"/>
  21. </resultMap>
  22. <sql id="baseSql">
  23. id,name,remark,type,bt_system,template_id,project_id,system_id,group_code,diagram_content,
  24. creator,creation_time,modifier,modified_time,valid,ts
  25. </sql>
  26. <insert id="saveDiagram">
  27. INSERT INTO diagram
  28. (id,name,remark,type,bt_system,template_id,
  29. project_id,system_id,group_code,diagram_content,
  30. creator,creation_time,modifier,modified_time)
  31. VALUES
  32. (#{id},#{name},#{remark},#{type},#{system},#{templateId},
  33. #{projectId},#{systemId},#{groupCode},#{diagramContent},
  34. #{creator}, #{creationTime},#{modifier},#{modifiedTime})
  35. </insert>
  36. <delete id="deleteByDiagramId">
  37. DELETE FROM diagram
  38. WHERE id=#{diagramId}
  39. </delete>
  40. <select id="getDiagram" resultMap="diagramBaseMap">
  41. SELECT
  42. <include refid="baseSql"/>
  43. FROM diagram
  44. WHERE id=#{diagramId}
  45. </select>
  46. <select id="getDiagrams" resultMap="diagramBaseMap">
  47. SELECT
  48. <include refid="baseSql"/>
  49. FROM diagram
  50. WHERE 1=1
  51. <if test="null != diagramType and diagramType.length > 0">
  52. AND type=#{diagramType}
  53. </if>
  54. <if test="null != projectId and projectId.length > 0">
  55. AND project_id=#{projectId}
  56. </if>
  57. <if test="null != systemId and systemId.length > 0">
  58. AND system_id=#{systemId}
  59. </if>
  60. <if test="null != groupCode and groupCode.length > 0">
  61. AND group_code=#{groupCode}
  62. </if>
  63. </select>
  64. </mapper>