KwsMenuRightsDao.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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.sckw.system.dao.KwsMenuRightsDao">
  4. <resultMap id="BaseResultMap" type="com.sckw.system.model.KwsMenuRights">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="ent_id" jdbcType="BIGINT" property="entId" />
  7. <result column="menu_id" jdbcType="BIGINT" property="menuId" />
  8. <result column="role_id" jdbcType="BIGINT" property="roleId" />
  9. <result column="remark" jdbcType="VARCHAR" property="remark" />
  10. <result column="status" jdbcType="INTEGER" property="status" />
  11. <result column="create_by" jdbcType="BIGINT" property="createBy" />
  12. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  13. <result column="update_by" jdbcType="BIGINT" property="updateBy" />
  14. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  15. <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
  16. </resultMap>
  17. <sql id="Base_Column_List">
  18. id, ent_id, menu_id, role_id, remark, status, create_by, create_time, update_by,
  19. update_time, del_flag
  20. </sql>
  21. <select id="selectByKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  22. select
  23. <include refid="Base_Column_List" />
  24. from kws_menu_rights
  25. where id = #{id,jdbcType=BIGINT}
  26. </select>
  27. <insert id="insert" parameterType="com.sckw.system.model.KwsMenuRights">
  28. insert into kws_menu_rights
  29. <trim prefix="(" suffix=")" suffixOverrides=",">
  30. <if test="id != null">
  31. id,
  32. </if>
  33. <if test="entId != null">
  34. ent_id,
  35. </if>
  36. <if test="menuId != null">
  37. menu_id,
  38. </if>
  39. <if test="roleId != null">
  40. role_id,
  41. </if>
  42. <if test="remark != null">
  43. remark,
  44. </if>
  45. <if test="status != null">
  46. status,
  47. </if>
  48. <if test="createBy != null">
  49. create_by,
  50. </if>
  51. <if test="createTime != null">
  52. create_time,
  53. </if>
  54. <if test="updateBy != null">
  55. update_by,
  56. </if>
  57. <if test="updateTime != null">
  58. update_time,
  59. </if>
  60. <if test="delFlag != null">
  61. del_flag,
  62. </if>
  63. </trim>
  64. <trim prefix="values (" suffix=")" suffixOverrides=",">
  65. <if test="id != null">
  66. #{id,jdbcType=BIGINT},
  67. </if>
  68. <if test="entId != null">
  69. #{entId,jdbcType=BIGINT},
  70. </if>
  71. <if test="menuId != null">
  72. #{menuId,jdbcType=BIGINT},
  73. </if>
  74. <if test="roleId != null">
  75. #{roleId,jdbcType=BIGINT},
  76. </if>
  77. <if test="remark != null">
  78. #{remark,jdbcType=VARCHAR},
  79. </if>
  80. <if test="status != null">
  81. #{status,jdbcType=INTEGER},
  82. </if>
  83. <if test="createBy != null">
  84. #{createBy,jdbcType=BIGINT},
  85. </if>
  86. <if test="createTime != null">
  87. #{createTime,jdbcType=TIMESTAMP},
  88. </if>
  89. <if test="updateBy != null">
  90. #{updateBy,jdbcType=BIGINT},
  91. </if>
  92. <if test="updateTime != null">
  93. #{updateTime,jdbcType=TIMESTAMP},
  94. </if>
  95. <if test="delFlag != null">
  96. #{delFlag,jdbcType=INTEGER},
  97. </if>
  98. </trim>
  99. </insert>
  100. <insert id="saveBatch" parameterType="com.sckw.system.model.KwsMenuRights">
  101. insert into kws_menu_rights
  102. <trim prefix="(" suffix=")" suffixOverrides=",">
  103. id,
  104. ent_id,
  105. menu_id,
  106. role_id,
  107. remark,
  108. status,
  109. create_by,
  110. create_time,
  111. update_by,
  112. update_time,
  113. del_flag
  114. </trim>
  115. values
  116. <foreach collection="list" item="item" separator=",">
  117. <trim prefix="(" suffix=")" suffixOverrides=",">
  118. #{item.id,jdbcType=BIGINT},
  119. #{item.entId,jdbcType=BIGINT},
  120. #{item.menuId,jdbcType=BIGINT},
  121. #{item.roleId,jdbcType=BIGINT},
  122. #{item.remark,jdbcType=VARCHAR},
  123. #{item.status,jdbcType=INTEGER},
  124. #{item.createBy,jdbcType=BIGINT},
  125. #{item.createTime,jdbcType=TIMESTAMP},
  126. #{item.updateBy,jdbcType=BIGINT},
  127. #{item.updateTime,jdbcType=TIMESTAMP},
  128. #{item.delFlag,jdbcType=INTEGER}
  129. </trim>
  130. </foreach>
  131. </insert>
  132. <update id="update" parameterType="com.sckw.system.model.KwsMenuRights">
  133. update kws_menu_rights
  134. <set>
  135. <if test="entId != null">
  136. ent_id = #{entId,jdbcType=BIGINT},
  137. </if>
  138. <if test="menuId != null">
  139. menu_id = #{menuId,jdbcType=BIGINT},
  140. </if>
  141. <if test="roleId != null">
  142. role_id = #{roleId,jdbcType=BIGINT},
  143. </if>
  144. <if test="remark != null">
  145. remark = #{remark,jdbcType=VARCHAR},
  146. </if>
  147. <if test="status != null">
  148. status = #{status,jdbcType=INTEGER},
  149. </if>
  150. <if test="createBy != null">
  151. create_by = #{createBy,jdbcType=BIGINT},
  152. </if>
  153. <if test="createTime != null">
  154. create_time = #{createTime,jdbcType=TIMESTAMP},
  155. </if>
  156. <if test="updateBy != null">
  157. update_by = #{updateBy,jdbcType=BIGINT},
  158. </if>
  159. <if test="updateTime != null">
  160. update_time = #{updateTime,jdbcType=TIMESTAMP},
  161. </if>
  162. <if test="delFlag != null">
  163. del_flag = #{delFlag,jdbcType=INTEGER},
  164. </if>
  165. </set>
  166. where id = #{id,jdbcType=BIGINT}
  167. </update>
  168. </mapper>