SysCustomMenuMapper.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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.xinxin.topro.sysservice.dao.mysqlmapper.SysCustomMenuMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.SysCustomMenu" >
  5. <id column="SCM_ID" property="scmId" jdbcType="INTEGER" />
  6. <result column="SM_ID" property="smId" jdbcType="INTEGER" />
  7. <result column="UI_ID" property="uiId" jdbcType="INTEGER" />
  8. <result column="SCM_Menu_Name" property="scmMenuName" jdbcType="VARCHAR" />
  9. <result column="SCM_Sort" property="scmSort" jdbcType="INTEGER" />
  10. <result column="SCM_Position" property="scmPosition" jdbcType="VARCHAR" />
  11. <result column="SCM_IsDel" property="scmIsdel" jdbcType="INTEGER" />
  12. </resultMap>
  13. <sql id="Base_Column_List" >
  14. SCM_ID, SM_ID,UI_ID , SCM_Menu_Name, SCM_Sort, SCM_Position, SCM_IsDel
  15. </sql>
  16. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  17. select
  18. <include refid="Base_Column_List" />
  19. from sys_custom_menu
  20. where SCM_IsDel = 0 and SCM_ID = #{scmId,jdbcType=INTEGER}
  21. </select>
  22. <select id="selectBySMUuId" resultMap="BaseResultMap" parameterType="com.xinxin.topro.sysservice.request.SysCustomMenuInfoRequest" >
  23. select
  24. <include refid="Base_Column_List" />
  25. from sys_custom_menu
  26. where SCM_IsDel = 0 and SM_ID = #{smId,jdbcType=INTEGER} and UI_ID = #{uiId,jdbcType=INTEGER}
  27. </select>
  28. <select id="selectByPosition" resultType="java.lang.Integer" parameterType="com.xinxin.topro.sysservice.request.CustomMenuSearchRequest" >
  29. select
  30. MAX(SCM_Sort)
  31. from sys_custom_menu
  32. where SCM_IsDel = 0 and SCM_Position = #{position,jdbcType=VARCHAR} and UI_ID = #{uuId,jdbcType=INTEGER}
  33. </select>
  34. <select id="selectByRightUser" resultMap="BaseResultMap" parameterType="com.xinxin.topro.sysservice.request.CustomMenuSearchRequest" >
  35. select
  36. <include refid="Base_Column_List" />
  37. from sys_custom_menu
  38. where SCM_IsDel = 0 and UI_ID = #{uuId,jdbcType=INTEGER} and SCM_Position = #{position,jdbcType=VARCHAR}
  39. ORDER BY SCM_Sort ASC
  40. </select>
  41. <select id="selectByLeftUser" resultMap="BaseResultMap" parameterType="com.xinxin.topro.sysservice.request.CustomMenuSearchRequest" >
  42. select
  43. <include refid="Base_Column_List" />
  44. from sys_custom_menu
  45. where SCM_IsDel = 0 and UI_ID = #{uuId,jdbcType=INTEGER} and SCM_Position = #{position,jdbcType=VARCHAR}
  46. ORDER BY SCM_Sort ASC
  47. </select>
  48. <select id="selectByUser" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  49. select
  50. <include refid="Base_Column_List" />
  51. from sys_custom_menu
  52. where SCM_IsDel = 0 and UI_ID = #{uuId,jdbcType=INTEGER}
  53. ORDER BY SCM_Sort ASC
  54. </select>
  55. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  56. delete from sys_custom_menu
  57. where SCM_ID = #{scmId,jdbcType=INTEGER}
  58. </delete>
  59. <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysCustomMenu" >
  60. insert into sys_custom_menu (SCM_ID, SM_ID, UI_ID,
  61. SCM_Menu_Name, SCM_Sort, SCM_Position,
  62. SCM_IsDel)
  63. values (#{scmId,jdbcType=INTEGER}, #{smId,jdbcType=INTEGER}, #{uiId,jdbcType=INTEGER},
  64. #{scmMenuName,jdbcType=VARCHAR}, #{scmSort,jdbcType=INTEGER}, #{scmPosition,jdbcType=VARCHAR},
  65. #{scmIsdel,jdbcType=INTEGER})
  66. </insert>
  67. <insert id="insertSelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysCustomMenu" >
  68. insert into sys_custom_menu
  69. <trim prefix="(" suffix=")" suffixOverrides="," >
  70. <if test="scmId != null" >
  71. SCM_ID,
  72. </if>
  73. <if test="smId != null" >
  74. SM_ID,
  75. </if>
  76. <if test="uiId != null" >
  77. UI_ID,
  78. </if>
  79. <if test="scmMenuName != null" >
  80. SCM_Menu_Name,
  81. </if>
  82. <if test="scmSort != null" >
  83. SCM_Sort,
  84. </if>
  85. <if test="scmPosition != null" >
  86. SCM_Position,
  87. </if>
  88. <if test="scmIsdel != null" >
  89. SCM_IsDel,
  90. </if>
  91. </trim>
  92. <trim prefix="values (" suffix=")" suffixOverrides="," >
  93. <if test="scmId != null" >
  94. #{scmId,jdbcType=INTEGER},
  95. </if>
  96. <if test="smId != null" >
  97. #{smId,jdbcType=INTEGER},
  98. </if>
  99. <if test="uiId != null" >
  100. #{uiId,jdbcType=INTEGER},
  101. </if>
  102. <if test="scmMenuName != null" >
  103. #{scmMenuName,jdbcType=VARCHAR},
  104. </if>
  105. <if test="scmSort != null" >
  106. #{scmSort,jdbcType=INTEGER},
  107. </if>
  108. <if test="scmPosition != null" >
  109. #{scmPosition,jdbcType=VARCHAR},
  110. </if>
  111. <if test="scmIsdel != null" >
  112. #{scmIsdel,jdbcType=INTEGER},
  113. </if>
  114. </trim>
  115. </insert>
  116. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysCustomMenu" >
  117. update sys_custom_menu
  118. <set >
  119. <if test="smId != null" >
  120. SM_ID = #{smId,jdbcType=INTEGER},
  121. </if>
  122. <if test="uiId != null" >
  123. UI_ID = #{uiId,jdbcType=INTEGER},
  124. </if>
  125. <if test="scmMenuName != null" >
  126. SCM_Menu_Name = #{scmMenuName,jdbcType=VARCHAR},
  127. </if>
  128. <if test="scmSort != null" >
  129. SCM_Sort = #{scmSort,jdbcType=INTEGER},
  130. </if>
  131. <if test="scmPosition != null" >
  132. SCM_Position = #{scmPosition,jdbcType=VARCHAR},
  133. </if>
  134. <if test="scmIsdel != null" >
  135. SCM_IsDel = #{scmIsdel,jdbcType=INTEGER},
  136. </if>
  137. </set>
  138. where SCM_ID = #{scmId,jdbcType=INTEGER}
  139. </update>
  140. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysCustomMenu" >
  141. update sys_custom_menu
  142. set SCM_Menu_Name = #{scmMenuName,jdbcType=VARCHAR},
  143. where SCM_ID = #{scmId,jdbcType=INTEGER}
  144. </update>
  145. <update id="updateByStatus" parameterType="java.lang.Integer" >
  146. update sys_custom_menu
  147. set SCM_IsDel = -1
  148. where SCM_ID = #{scmId,jdbcType=INTEGER}
  149. </update>
  150. <update id="updateByScmIdStatus" parameterType="com.xinxin.topro.sysservice.request.SysCustomMenuInfoRequest" >
  151. update sys_custom_menu
  152. set SCM_IsDel = -1
  153. where SCM_ID = #{scmId,jdbcType=INTEGER}
  154. </update>
  155. <update id="updateList" parameterType="java.util.List">
  156. <foreach collection="list" item="item" index="index" separator=";">
  157. update sys_custom_menu
  158. set
  159. SCM_Sort = #{item.scmSort,jdbcType=INTEGER}
  160. where
  161. SCM_ID = #{item.scmId,jdbcType=INTEGER}
  162. </foreach>
  163. </update>
  164. <update id="updateBatchList" parameterType="java.util.List">
  165. <foreach collection="list" item="item" index="index" separator=";">
  166. update sys_custom_menu
  167. set
  168. SCM_Sort = #{item.scmSort,jdbcType=INTEGER}
  169. where
  170. SCM_ID = #{item.scmId,jdbcType=INTEGER}
  171. </foreach>
  172. </update>
  173. </mapper>