DragTableMapper.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.system.mapper.DragTableMapper">
  6. <resultMap type="com.ruoyi.system.entity.DragTable" id="DragTableResult">
  7. <result property="tId" column="t_id" />
  8. <result property="dtName" column="dt_name" />
  9. <result property="dtNickname" column="dt_nickname" />
  10. <result property="tableKey" column="table_key" />
  11. <result property="sqlKey" column="sql_key" />
  12. <result property="dtTableName" column="dt_table_name" />
  13. <result property="dtNotes" column="dt_notes" />
  14. <result property="dtColumnName" column="dt_column_name" />
  15. <result property="spare" column="spare" />
  16. <result property="spare1" column="spare1" />
  17. <result property="delFlag" column="del_flag" />
  18. <result property="createBy" column="create_by" />
  19. <result property="createTime" column="create_time" />
  20. <result property="updateBy" column="update_by" />
  21. <result property="updateTime" column="update_time" />
  22. </resultMap>
  23. <sql id="selectDragTableVo">
  24. select t_id, dt_name, dt_nickname, table_key, sql_key, dt_table_name, dt_notes, dt_column_name, spare, spare1, del_flag, create_by, create_time, update_by, update_time from drag_table
  25. </sql>
  26. <select id="selectDragTableList" parameterType="com.ruoyi.system.entity.DragTable" resultMap="DragTableResult">
  27. <include refid="selectDragTableVo"/>
  28. <where>
  29. <if test="dtName != null and dtName != ''"> and dt_name like concat('%', #{dtName}, '%')</if>
  30. <if test="dtNickname != null and dtNickname != ''"> and dt_nickname like concat('%', #{dtNickname}, '%')</if>
  31. <if test="tableKey != null and tableKey != ''"> and table_key = #{tableKey}</if>
  32. <if test="sqlKey != null and sqlKey != ''"> and sql_key = #{sqlKey}</if>
  33. <if test="dtTableName != null and dtTableName != ''"> and dt_table_name like concat('%', #{dtTableName}, '%')</if>
  34. <if test="dtNotes != null and dtNotes != ''"> and dt_notes = #{dtNotes}</if>
  35. <if test="dtColumnName != null and dtColumnName != ''"> and dt_column_name like concat('%', #{dtColumnName}, '%')</if>
  36. <if test="spare != null and spare != ''"> and spare = #{spare}</if>
  37. <if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
  38. </where>
  39. </select>
  40. <select id="selectDragTableByTId" parameterType="Long" resultMap="DragTableResult">
  41. <include refid="selectDragTableVo"/>
  42. where t_id = #{tId}
  43. </select>
  44. <insert id="insertDragTable" parameterType="com.ruoyi.system.entity.DragTable" useGeneratedKeys="true" keyProperty="tId">
  45. insert into drag_table
  46. <trim prefix="(" suffix=")" suffixOverrides=",">
  47. <if test="dtName != null">dt_name,</if>
  48. <if test="dtNickname != null">dt_nickname,</if>
  49. <if test="tableKey != null">table_key,</if>
  50. <if test="sqlKey != null">sql_key,</if>
  51. <if test="dtTableName != null">dt_table_name,</if>
  52. <if test="dtNotes != null">dt_notes,</if>
  53. <if test="dtColumnName != null">dt_column_name,</if>
  54. <if test="spare != null">spare,</if>
  55. <if test="spare1 != null">spare1,</if>
  56. <if test="delFlag != null">del_flag,</if>
  57. <if test="createBy != null">create_by,</if>
  58. <if test="createTime != null">create_time,</if>
  59. <if test="updateBy != null">update_by,</if>
  60. <if test="updateTime != null">update_time,</if>
  61. </trim>
  62. <trim prefix="values (" suffix=")" suffixOverrides=",">
  63. <if test="dtName != null">#{dtName},</if>
  64. <if test="dtNickname != null">#{dtNickname},</if>
  65. <if test="tableKey != null">#{tableKey},</if>
  66. <if test="sqlKey != null">#{sqlKey},</if>
  67. <if test="dtTableName != null">#{dtTableName},</if>
  68. <if test="dtNotes != null">#{dtNotes},</if>
  69. <if test="dtColumnName != null">#{dtColumnName},</if>
  70. <if test="spare != null">#{spare},</if>
  71. <if test="spare1 != null">#{spare1},</if>
  72. <if test="delFlag != null">#{delFlag},</if>
  73. <if test="createBy != null">#{createBy},</if>
  74. <if test="createTime != null">#{createTime},</if>
  75. <if test="updateBy != null">#{updateBy},</if>
  76. <if test="updateTime != null">#{updateTime},</if>
  77. </trim>
  78. </insert>
  79. <update id="updateDragTable" parameterType="com.ruoyi.system.entity.DragTable">
  80. update drag_table
  81. <trim prefix="SET" suffixOverrides=",">
  82. <if test="dtName != null">dt_name = #{dtName},</if>
  83. <if test="dtNickname != null">dt_nickname = #{dtNickname},</if>
  84. <if test="tableKey != null">table_key = #{tableKey},</if>
  85. <if test="sqlKey != null">sql_key = #{sqlKey},</if>
  86. <if test="dtTableName != null">dt_table_name = #{dtTableName},</if>
  87. <if test="dtNotes != null">dt_notes = #{dtNotes},</if>
  88. <if test="dtColumnName != null">dt_column_name = #{dtColumnName},</if>
  89. <if test="spare != null">spare = #{spare},</if>
  90. <if test="spare1 != null">spare1 = #{spare1},</if>
  91. <if test="delFlag != null">del_flag = #{delFlag},</if>
  92. <if test="createBy != null">create_by = #{createBy},</if>
  93. <if test="createTime != null">create_time = #{createTime},</if>
  94. <if test="updateBy != null">update_by = #{updateBy},</if>
  95. <if test="updateTime != null">update_time = #{updateTime},</if>
  96. </trim>
  97. where t_id = #{tId}
  98. </update>
  99. <delete id="deleteDragTableByTId" parameterType="Long">
  100. delete from drag_table where t_id = #{tId}
  101. </delete>
  102. <delete id="deleteDragTableByTIds" parameterType="String">
  103. delete from drag_table where t_id in
  104. <foreach item="tId" collection="array" open="(" separator="," close=")">
  105. #{tId}
  106. </foreach>
  107. </delete>
  108. </mapper>