DragTreeMapper.xml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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.zkqy.system.mapper.DragTreeMapper">
  6. <resultMap type="com.zkqy.system.entity.DragTree" id="DragTreeResult">
  7. <result property="id" column="id" />
  8. <result property="menuId" column="menu_id" />
  9. <result property="menuName" column="menu_name" />
  10. <result property="treeDesc" column="tree_desc" />
  11. <result property="treeTableName" column="tree_table_name" />
  12. <result property="treeTablePrimaryKey" column="tree_table_primary_key" />
  13. <result property="treeTableDgl" column="tree_table_dgl" />
  14. <result property="treeTableCondition" column="tree_table_condition" />
  15. <result property="treeTableJoinTable" column="tree_table_join_table" />
  16. <result property="allJson" column="all_json" />
  17. <result property="delFlag" column="del_flag" />
  18. <result property="createBy" column="create_by" />
  19. <result property="createById" column="create_by_id" />
  20. <result property="createTime" column="create_time" />
  21. <result property="updateBy" column="update_by" />
  22. <result property="updateById" column="update_by_id" />
  23. <result property="updateTime" column="update_time" />
  24. <result property="tableId" column="table_id"/>
  25. <result property="tableNameDes" column="table_name_des"/>
  26. <result property="treeTableKey" column="tree_table_key"/>
  27. <result property="treeShowLabel" column="tree_show_label"/>
  28. <result property="treeTableJoinTableCondition" column="tree_table_join_table_condition"/>
  29. <result property="treeTableJoinTablePrimaryKey" column="tree_table_join_table_primary_key"/>
  30. </resultMap>
  31. <sql id="selectDragTreeVo">
  32. select id, menu_id, menu_name, tree_desc, tree_table_name, tree_table_primary_key, tree_table_dgl, tree_table_condition, tree_table_join_table, table_name_des, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time,table_id,tree_table_key,tree_show_label,tree_table_join_table_condition,tree_table_join_table_primary_key from {DBNAME}.drag_tree
  33. </sql>
  34. <select id="selectDragTreeList" parameterType="com.zkqy.system.entity.DragTree" resultMap="DragTreeResult">
  35. <include refid="selectDragTreeVo"/>
  36. <where>
  37. <if test="menuId != null "> and menu_id = #{menuId}</if>
  38. <if test="menuName != null and menuName != ''"> and menu_name like concat('%', #{menuName}, '%')</if>
  39. <if test="treeDesc != null and treeDesc != ''"> and tree_desc = #{treeDesc}</if>
  40. <if test="treeTableName != null and treeTableName != ''"> and tree_table_name like concat('%', #{treeTableName}, '%')</if>
  41. <if test="treeTablePrimaryKey != null and treeTablePrimaryKey != ''"> and tree_table_primary_key = #{treeTablePrimaryKey}</if>
  42. <if test="treeTableDgl != null and treeTableDgl != ''"> and tree_table_dgl = #{treeTableDgl}</if>
  43. <if test="treeTableCondition != null and treeTableCondition != ''"> and tree_table_condition = #{treeTableCondition}</if>
  44. <if test="treeTableJoinTable != null and treeTableJoinTable != ''"> and tree_table_join_table = #{treeTableJoinTable}</if>
  45. <if test="tableNameDes != null and tableNameDes != ''"> and table_name_des = #{tableNameDes}</if>
  46. <if test="createById != null "> and create_by_id = #{createById}</if>
  47. <if test="updateById != null "> and update_by_id = #{updateById}</if>
  48. <if test="tableId != null">and table_id=#{tableId}</if>
  49. <if test="treeTableKey!=null">and tree_table_key=#{treeTableKey}</if>
  50. <if test="treeShowLabel!=null">and tree_show_label=#{treeShowLabel}</if>
  51. <if test="treeTableJoinTableCondition!=null">and tree_table_join_table_condition=#{treeTableJoinTableCondition}</if>
  52. <if test="treeTableJoinTablePrimaryKey!=null">and tree_table_join_table_primary_key=#{treeTableJoinTablePrimaryKey}</if>
  53. </where>
  54. </select>
  55. <select id="selectDragTreeById" parameterType="Long" resultMap="DragTreeResult">
  56. <include refid="selectDragTreeVo"/>
  57. where id = #{id}
  58. </select>
  59. <insert id="insertDragTree" parameterType="com.zkqy.system.entity.DragTree" useGeneratedKeys="true" keyProperty="id">
  60. insert into {DBNAME}.drag_tree
  61. <trim prefix="(" suffix=")" suffixOverrides=",">
  62. <if test="menuId != null">menu_id,</if>
  63. <if test="menuName != null and menuName != ''">menu_name,</if>
  64. <if test="treeDesc != null and treeDesc != ''">tree_desc,</if>
  65. <if test="treeTableName != null and treeTableName != ''">tree_table_name,</if>
  66. <if test="treeTablePrimaryKey != null">tree_table_primary_key,</if>
  67. <if test="treeTableDgl != null">tree_table_dgl,</if>
  68. <if test="treeTableCondition != null">tree_table_condition,</if>
  69. <if test="treeTableJoinTable != null">tree_table_join_table,</if>
  70. <if test="tableNameDes != null">`table_name_des`,</if>
  71. <if test="delFlag != null">del_flag,</if>
  72. <if test="createBy != null">create_by,</if>
  73. <if test="createById != null">create_by_id,</if>
  74. <if test="createTime != null">create_time,</if>
  75. <if test="updateBy != null">update_by,</if>
  76. <if test="updateById != null">update_by_id,</if>
  77. <if test="updateTime != null">update_time,</if>
  78. <if test="tableId != null">table_id,</if>
  79. <if test="treeTableKey!=null">tree_table_key,</if>
  80. <if test="treeShowLabel!=null">tree_show_label,</if>
  81. <if test="treeTableJoinTableCondition!=null">tree_table_join_table_condition,</if>
  82. <if test="treeTableJoinTablePrimaryKey!=null">tree_table_join_table_primary_key,</if>
  83. </trim>
  84. <trim prefix="values (" suffix=")" suffixOverrides=",">
  85. <if test="menuId != null">#{menuId},</if>
  86. <if test="menuName != null and menuName != ''">#{menuName},</if>
  87. <if test="treeDesc != null and treeDesc != ''">#{treeDesc},</if>
  88. <if test="treeTableName != null and treeTableName != ''">#{treeTableName},</if>
  89. <if test="treeTablePrimaryKey != null">#{treeTablePrimaryKey},</if>
  90. <if test="treeTableDgl != null">#{treeTableDgl},</if>
  91. <if test="treeTableCondition != null">#{treeTableCondition},</if>
  92. <if test="treeTableJoinTable != null">#{treeTableJoinTable},</if>
  93. <if test="tableNameDes != null">#{tableNameDes},</if>
  94. <if test="delFlag != null">#{delFlag},</if>
  95. <if test="createBy != null">#{createBy},</if>
  96. <if test="createById != null">#{createById},</if>
  97. <if test="createTime != null">#{createTime},</if>
  98. <if test="updateBy != null">#{updateBy},</if>
  99. <if test="updateById != null">#{updateById},</if>
  100. <if test="updateTime != null">#{updateTime},</if>
  101. <if test="tableId != null">#{tableId},</if>
  102. <if test="treeTableKey!=null">#{treeTableKey},</if>
  103. <if test="treeShowLabel!=null">#{treeShowLabel},</if>
  104. <if test="treeTableJoinTableCondition!=null">#{treeTableJoinTableCondition},</if>
  105. <if test="treeTableJoinTablePrimaryKey!=null">#{treeTableJoinTablePrimaryKey},</if>
  106. </trim>
  107. </insert>
  108. <update id="updateDragTree" parameterType="com.zkqy.system.entity.DragTree">
  109. update {DBNAME}.drag_tree
  110. <trim prefix="SET" suffixOverrides=",">
  111. <if test="menuId != null">menu_id = #{menuId},</if>
  112. <if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
  113. <if test="treeDesc != null and treeDesc != ''">tree_desc = #{treeDesc},</if>
  114. <if test="treeTableName != null and treeTableName != ''">tree_table_name = #{treeTableName},</if>
  115. <if test="treeTablePrimaryKey != null">tree_table_primary_key = #{treeTablePrimaryKey},</if>
  116. <if test="treeTableDgl != null">tree_table_dgl = #{treeTableDgl},</if>
  117. <if test="treeTableCondition != null">tree_table_condition = #{treeTableCondition},</if>
  118. <if test="treeTableJoinTable != null">tree_table_join_table = #{treeTableJoinTable},</if>
  119. <if test="tableNameDes != null">`table_name_des`= #{tableNameDes},</if>
  120. <if test="delFlag != null">del_flag = #{delFlag},</if>
  121. <if test="createBy != null">create_by = #{createBy},</if>
  122. <if test="createById != null">create_by_id = #{createById},</if>
  123. <if test="createTime != null">create_time = #{createTime},</if>
  124. <if test="updateBy != null">update_by = #{updateBy},</if>
  125. <if test="updateById != null">update_by_id = #{updateById},</if>
  126. <if test="updateTime != null">update_time = #{updateTime},</if>
  127. <if test="tableId != null">table_id=#{tableId},</if>
  128. <if test="treeTableKey!=null">tree_table_key=#{treeTableKey},</if>
  129. <if test="treeShowLabel!=null">tree_show_label=#{treeShowLabel},</if>
  130. <if test="treeTableJoinTableCondition!=null">tree_table_join_table_condition=#{treeTableJoinTableCondition},</if>
  131. <if test="treeTableJoinTablePrimaryKey!=null">tree_table_join_table_primary_key=#{treeTableJoinTablePrimaryKey},</if>
  132. </trim>
  133. where id = #{id}
  134. </update>
  135. <delete id="deleteDragTreeById" parameterType="Long">
  136. delete from {DBNAME}.drag_tree where id = #{id}
  137. </delete>
  138. <delete id="deleteDragTreeByIds" parameterType="String">
  139. delete from {DBNAME}.drag_tree where id in
  140. <foreach item="id" collection="array" open="(" separator="," close=")">
  141. #{id}
  142. </foreach>
  143. </delete>
  144. </mapper>