DragTableBtnMapper.xml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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.DragTableBtnMapper">
  6. <resultMap type="com.ruoyi.system.entity.DragTableBtn" id="DragTableBtnResult">
  7. <result property="id" column="id" />
  8. <result property="btnParentId" column="btn_parent_id" />
  9. <result property="btnKey" column="btn_key" />
  10. <result property="ancestorsId" column="ancestors_id"/>
  11. <result property="btnGroupName" column="btn_group_name"/>
  12. <result property="btnName" column="btn_name" />
  13. <result property="btnType" column="btn_type" />
  14. <result property="btnIcon" column="btn_icon"/>
  15. <result property="btnFormKey" column="btn_form_key" />
  16. <result property="btnProcessKey" column="btn_process_key" />
  17. <result property="btnTableKey" column="btn_table_key" />
  18. <result property="btnScriptKey" column="btn_script_key" />
  19. <result property="btnShowCondition" column="btn_show_condition" />
  20. <result property="btnParams" column="btn_params" />
  21. <result property="btnHasPermi" column="btn_has_permi" />
  22. <result property="btnSort" column="btn_sort" />
  23. <result property="delFlag" column="del_flag" />
  24. <result property="createBy" column="create_by" />
  25. <result property="createById" column="create_by_id" />
  26. <result property="createTime" column="create_time" />
  27. <result property="updateBy" column="update_by" />
  28. <result property="updateById" column="update_by_id" />
  29. <result property="updateTime" column="update_time" />
  30. <result property="remark" column="remark" />
  31. </resultMap>
  32. <sql id="selectDragTableBtnVo">
  33. select id, btn_parent_id,ancestors_id, btn_key,btn_group_name, btn_name, btn_type,btn_icon, btn_form_key, btn_process_key, btn_table_key, btn_script_key, btn_show_condition, btn_params, btn_has_permi, btn_sort, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time, remark from drag_table_btn
  34. </sql>
  35. <select id="selectDragTableBtnList" parameterType="com.ruoyi.system.entity.DragTableBtn" resultMap="DragTableBtnResult">
  36. <include refid="selectDragTableBtnVo"/>
  37. where del_flag = '0'
  38. <if test="btnParentId != null "> and btn_parent_id = #{btnParentId}</if>
  39. <if test="btnKey != null and btnKey != ''"> and btn_key = #{btnKey}</if>
  40. <if test="btnGroupName != null and btnGroupName != ''"> and btn_group_name like concat('%', #{btnGroupName}, '%')</if>
  41. <if test="btnName != null and btnName != ''"> and btn_name like concat('%', #{btnName}, '%')</if>
  42. <if test="btnType != null and btnType != ''"> and btn_type = #{btnType}</if>
  43. <if test="btnFormKey != null and btnFormKey != ''"> and btn_form_key = #{btnFormKey}</if>
  44. <if test="btnProcessKey != null and btnProcessKey != ''"> and btn_process_key = #{btnProcessKey}</if>
  45. <if test="btnTableKey != null and btnTableKey != ''"> and btn_table_key = #{btnTableKey}</if>
  46. <if test="btnScriptKey != null and btnScriptKey != ''"> and btn_script_key = #{btnScriptKey}</if>
  47. <if test="btnShowCondition != null and btnShowCondition != ''"> and btn_show_condition = #{btnShowCondition}</if>
  48. <if test="btnParams != null and btnParams != ''"> and btn_params = #{btnParams}</if>
  49. <if test="btnHasPermi != null and btnHasPermi != ''"> and btn_has_permi = #{btnHasPermi}</if>
  50. <if test="btnSort != null "> and btn_sort = #{btnSort}</if>
  51. <if test="createById != null "> and create_by_id = #{createById}</if>
  52. <if test="updateById != null "> and update_by_id = #{updateById}</if>
  53. order by btn_sort asc
  54. </select>
  55. <select id="selectDragTableBtnById" parameterType="Long" resultMap="DragTableBtnResult">
  56. <include refid="selectDragTableBtnVo"/>
  57. where id = #{id}
  58. </select>
  59. <insert id="insertDragTableBtn" parameterType="com.ruoyi.system.entity.DragTableBtn">
  60. insert into drag_table_btn
  61. <trim prefix="(" suffix=")" suffixOverrides=",">
  62. <if test="btnParentId != null">btn_parent_id,</if>
  63. <if test="btnKey != null">btn_key,</if>
  64. <if test="ancestorsId != null">ancestors_id,</if>
  65. <if test="btnGroupName != null">btn_group_name,</if>
  66. <if test="btnName != null">btn_name,</if>
  67. <if test="btnType != null">btn_type,</if>
  68. <if test="btnIcon != null">btn_icon,</if>
  69. <if test="btnFormKey != null">btn_form_key,</if>
  70. <if test="btnProcessKey != null">btn_process_key,</if>
  71. <if test="btnTableKey != null">btn_table_key,</if>
  72. <if test="btnScriptKey != null">btn_script_key,</if>
  73. <if test="btnShowCondition != null">btn_show_condition,</if>
  74. <if test="btnParams != null">btn_params,</if>
  75. <if test="btnHasPermi != null">btn_has_permi,</if>
  76. <if test="btnSort != null">btn_sort,</if>
  77. <if test="createBy != null">create_by,</if>
  78. <if test="createById != null">create_by_id,</if>
  79. <if test="createTime != null">create_time,</if>
  80. <if test="remark != null">remark,</if>
  81. del_flag
  82. </trim>
  83. <trim prefix="values (" suffix=")" suffixOverrides=",">
  84. <if test="btnParentId != null">#{btnParentId},</if>
  85. <if test="btnKey != null">#{btnKey},</if>
  86. <if test="ancestorsId != null">#{ancestorsId},</if>
  87. <if test="btnGroupName != null">#{btnGroupName},</if>
  88. <if test="btnName != null">#{btnName},</if>
  89. <if test="btnType != null">#{btnType},</if>
  90. <if test="btnIcon != null">#{btnIcon},</if>
  91. <if test="btnFormKey != null">#{btnFormKey},</if>
  92. <if test="btnProcessKey != null">#{btnProcessKey},</if>
  93. <if test="btnTableKey != null">#{btnTableKey},</if>
  94. <if test="btnScriptKey != null">#{btnScriptKey},</if>
  95. <if test="btnShowCondition != null">#{btnShowCondition},</if>
  96. <if test="btnParams != null">#{btnParams},</if>
  97. <if test="btnHasPermi != null">#{btnHasPermi},</if>
  98. <if test="btnSort != null">#{btnSort},</if>
  99. <if test="createBy != null">#{createBy},</if>
  100. <if test="createById != null">#{createById},</if>
  101. <if test="createTime != null">#{createTime},</if>
  102. <if test="remark != null">#{remark},</if>
  103. '0'
  104. </trim>
  105. </insert>
  106. <update id="updateDragTableBtn" parameterType="com.ruoyi.system.entity.DragTableBtn">
  107. update drag_table_btn
  108. <trim prefix="SET" suffixOverrides=",">
  109. <if test="btnParentId != null">btn_parent_id = #{btnParentId},</if>
  110. <if test="btnKey != null">btn_key = #{btnKey},</if>
  111. <if test="ancestorsId != null">ancestors_id = #{ancestorsId},</if>
  112. <if test="btnGroupName != null">btn_group_name = #{btnGroupName},</if>
  113. <if test="btnName != null">btn_name = #{btnName},</if>
  114. <if test="btnType != null">btn_type = #{btnType},</if>
  115. <if test="btnIcon != null">btn_icon = #{btnIcon},</if>
  116. <if test="btnFormKey != null">btn_form_key = #{btnFormKey},</if>
  117. <if test="btnProcessKey != null">btn_process_key = #{btnProcessKey},</if>
  118. <if test="btnTableKey != null">btn_table_key = #{btnTableKey},</if>
  119. <if test="btnScriptKey != null">btn_script_key = #{btnScriptKey},</if>
  120. <if test="btnShowCondition != null">btn_show_condition = #{btnShowCondition},</if>
  121. <if test="btnParams != null">btn_params = #{btnParams},</if>
  122. <if test="btnHasPermi != null">btn_has_permi = #{btnHasPermi},</if>
  123. <if test="btnSort != null">btn_sort = #{btnSort},</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="remark != null">remark = #{remark},</if>
  128. </trim>
  129. where id = #{id}
  130. </update>
  131. <update id="deleteDragTableBtnById" parameterType="Long">
  132. update drag_table_btn set del_flag = '2' where id = #{id}
  133. </update>
  134. <update id="batchDeleteDragTableBtnByTableKey" parameterType="String">
  135. update drag_table_btn set del_flag = '2' where btn_table_key in
  136. <foreach item="btnTableKey" collection="list" open="(" separator="," close=")">
  137. #{btnTableKey}
  138. </foreach>
  139. </update>
  140. <select id="selectDragTableBtnListByBtnKey" resultMap="DragTableBtnResult">
  141. <include refid="selectDragTableBtnVo"></include>
  142. where del_flag = '0' and btn_key in
  143. <foreach collection="list" item="btnKey" open="(" close=")" separator=",">
  144. #{btnKey}
  145. </foreach>
  146. </select>
  147. <select id="selectChildNodeById" resultMap="DragTableBtnResult">
  148. <include refid="selectDragTableBtnVo"></include>
  149. where del_flag = '0' and
  150. <foreach collection="list" item="id" open="(" close=")" separator="or">
  151. FIND_IN_SET(#{id},ancestors_id)
  152. </foreach>
  153. </select>
  154. <select id="hasChildByBtnId" resultType="Integer">
  155. select count(1) from drag_table_btn where btn_parent_id = #{btnId} and del_flag = '0'
  156. </select>
  157. <select id="selectDragTableBtnByBtnKey" parameterType="String" resultMap="DragTableBtnResult">
  158. <include refid="selectDragTableBtnVo"/>
  159. where btn_key = #{btnKey}
  160. </select>
  161. </mapper>