SysMenuMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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.bowintek.smartsearch.mapper.SysMenuMapper">
  4. <resultMap id="BaseResultMap" type="com.bowintek.smartsearch.model.SysMenu">
  5. <id column="MenuNo" jdbcType="VARCHAR" property="menuNo" />
  6. <result column="OrderNo" jdbcType="INTEGER" property="orderNo" />
  7. <result column="MenuName" jdbcType="VARCHAR" property="menuName" />
  8. <result column="Icon" jdbcType="VARCHAR" property="icon" />
  9. <result column="ViewPath" jdbcType="VARCHAR" property="viewPath" />
  10. <result column="Url" jdbcType="VARCHAR" property="url" />
  11. <result column="ParentMenuNo" jdbcType="VARCHAR" property="parentMenuNo" />
  12. <result column="Description" jdbcType="VARCHAR" property="description" />
  13. <result column="IsTopMenu" jdbcType="BIT" property="isTopMenu" />
  14. <result column="IsVisible" jdbcType="BIT" property="isVisible" />
  15. <result column="IsLeaf" jdbcType="BIT" property="isLeaf" />
  16. <result column="FunctionCode" jdbcType="VARCHAR" property="functionCode" />
  17. <result column="RecordStatus" jdbcType="INTEGER" property="recordStatus" />
  18. <result column="ShortcutIcon" jdbcType="VARCHAR" property="shortcutIcon" />
  19. </resultMap>
  20. <sql id="Example_Where_Clause">
  21. <where>
  22. <foreach collection="oredCriteria" item="criteria" separator="or">
  23. <if test="criteria.valid">
  24. <trim prefix="(" prefixOverrides="and" suffix=")">
  25. <foreach collection="criteria.criteria" item="criterion">
  26. <choose>
  27. <when test="criterion.noValue">
  28. and ${criterion.condition}
  29. </when>
  30. <when test="criterion.singleValue">
  31. and ${criterion.condition} #{criterion.value}
  32. </when>
  33. <when test="criterion.betweenValue">
  34. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  35. </when>
  36. <when test="criterion.listValue">
  37. and ${criterion.condition}
  38. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  39. #{listItem}
  40. </foreach>
  41. </when>
  42. </choose>
  43. </foreach>
  44. </trim>
  45. </if>
  46. </foreach>
  47. </where>
  48. </sql>
  49. <sql id="Update_By_Example_Where_Clause">
  50. <where>
  51. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  52. <if test="criteria.valid">
  53. <trim prefix="(" prefixOverrides="and" suffix=")">
  54. <foreach collection="criteria.criteria" item="criterion">
  55. <choose>
  56. <when test="criterion.noValue">
  57. and ${criterion.condition}
  58. </when>
  59. <when test="criterion.singleValue">
  60. and ${criterion.condition} #{criterion.value}
  61. </when>
  62. <when test="criterion.betweenValue">
  63. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  64. </when>
  65. <when test="criterion.listValue">
  66. and ${criterion.condition}
  67. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  68. #{listItem}
  69. </foreach>
  70. </when>
  71. </choose>
  72. </foreach>
  73. </trim>
  74. </if>
  75. </foreach>
  76. </where>
  77. </sql>
  78. <sql id="Base_Column_List">
  79. MenuNo, OrderNo, MenuName, Icon, ViewPath, Url, ParentMenuNo, Description, IsTopMenu,
  80. IsVisible, IsLeaf, FunctionCode, RecordStatus, ShortcutIcon
  81. </sql>
  82. <select id="selectByExample" parameterType="com.bowintek.smartsearch.model.SysMenuExample" resultMap="BaseResultMap">
  83. select
  84. <if test="distinct">
  85. distinct
  86. </if>
  87. <include refid="Base_Column_List" />
  88. from sys_menu
  89. <if test="_parameter != null">
  90. <include refid="Example_Where_Clause" />
  91. </if>
  92. <if test="orderByClause != null">
  93. order by ${orderByClause}
  94. </if>
  95. </select>
  96. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  97. select
  98. <include refid="Base_Column_List" />
  99. from sys_menu
  100. where MenuNo = #{menuNo,jdbcType=VARCHAR}
  101. </select>
  102. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  103. delete from sys_menu
  104. where MenuNo = #{menuNo,jdbcType=VARCHAR}
  105. </delete>
  106. <delete id="deleteByExample" parameterType="com.bowintek.smartsearch.model.SysMenuExample">
  107. delete from sys_menu
  108. <if test="_parameter != null">
  109. <include refid="Example_Where_Clause" />
  110. </if>
  111. </delete>
  112. <insert id="insert" parameterType="com.bowintek.smartsearch.model.SysMenu">
  113. insert into sys_menu (MenuNo, OrderNo, MenuName,
  114. Icon, ViewPath, Url,
  115. ParentMenuNo, Description, IsTopMenu,
  116. IsVisible, IsLeaf, FunctionCode,
  117. RecordStatus, ShortcutIcon)
  118. values (#{menuNo,jdbcType=VARCHAR}, #{orderNo,jdbcType=INTEGER}, #{menuName,jdbcType=VARCHAR},
  119. #{icon,jdbcType=VARCHAR}, #{viewPath,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR},
  120. #{parentMenuNo,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{isTopMenu,jdbcType=BIT},
  121. #{isVisible,jdbcType=BIT}, #{isLeaf,jdbcType=BIT}, #{functionCode,jdbcType=VARCHAR},
  122. #{recordStatus,jdbcType=INTEGER}, #{shortcutIcon,jdbcType=VARCHAR})
  123. </insert>
  124. <insert id="insertSelective" parameterType="com.bowintek.smartsearch.model.SysMenu">
  125. insert into sys_menu
  126. <trim prefix="(" suffix=")" suffixOverrides=",">
  127. <if test="menuNo != null">
  128. MenuNo,
  129. </if>
  130. <if test="orderNo != null">
  131. OrderNo,
  132. </if>
  133. <if test="menuName != null">
  134. MenuName,
  135. </if>
  136. <if test="icon != null">
  137. Icon,
  138. </if>
  139. <if test="viewPath != null">
  140. ViewPath,
  141. </if>
  142. <if test="url != null">
  143. Url,
  144. </if>
  145. <if test="parentMenuNo != null">
  146. ParentMenuNo,
  147. </if>
  148. <if test="description != null">
  149. Description,
  150. </if>
  151. <if test="isTopMenu != null">
  152. IsTopMenu,
  153. </if>
  154. <if test="isVisible != null">
  155. IsVisible,
  156. </if>
  157. <if test="isLeaf != null">
  158. IsLeaf,
  159. </if>
  160. <if test="functionCode != null">
  161. FunctionCode,
  162. </if>
  163. <if test="recordStatus != null">
  164. RecordStatus,
  165. </if>
  166. <if test="shortcutIcon != null">
  167. ShortcutIcon,
  168. </if>
  169. </trim>
  170. <trim prefix="values (" suffix=")" suffixOverrides=",">
  171. <if test="menuNo != null">
  172. #{menuNo,jdbcType=VARCHAR},
  173. </if>
  174. <if test="orderNo != null">
  175. #{orderNo,jdbcType=INTEGER},
  176. </if>
  177. <if test="menuName != null">
  178. #{menuName,jdbcType=VARCHAR},
  179. </if>
  180. <if test="icon != null">
  181. #{icon,jdbcType=VARCHAR},
  182. </if>
  183. <if test="viewPath != null">
  184. #{viewPath,jdbcType=VARCHAR},
  185. </if>
  186. <if test="url != null">
  187. #{url,jdbcType=VARCHAR},
  188. </if>
  189. <if test="parentMenuNo != null">
  190. #{parentMenuNo,jdbcType=VARCHAR},
  191. </if>
  192. <if test="description != null">
  193. #{description,jdbcType=VARCHAR},
  194. </if>
  195. <if test="isTopMenu != null">
  196. #{isTopMenu,jdbcType=BIT},
  197. </if>
  198. <if test="isVisible != null">
  199. #{isVisible,jdbcType=BIT},
  200. </if>
  201. <if test="isLeaf != null">
  202. #{isLeaf,jdbcType=BIT},
  203. </if>
  204. <if test="functionCode != null">
  205. #{functionCode,jdbcType=VARCHAR},
  206. </if>
  207. <if test="recordStatus != null">
  208. #{recordStatus,jdbcType=INTEGER},
  209. </if>
  210. <if test="shortcutIcon != null">
  211. #{shortcutIcon,jdbcType=VARCHAR},
  212. </if>
  213. </trim>
  214. </insert>
  215. <select id="countByExample" parameterType="com.bowintek.smartsearch.model.SysMenuExample" resultType="java.lang.Long">
  216. select count(*) from sys_menu
  217. <if test="_parameter != null">
  218. <include refid="Example_Where_Clause" />
  219. </if>
  220. </select>
  221. <update id="updateByExampleSelective" parameterType="map">
  222. update sys_menu
  223. <set>
  224. <if test="row.menuNo != null">
  225. MenuNo = #{row.menuNo,jdbcType=VARCHAR},
  226. </if>
  227. <if test="row.orderNo != null">
  228. OrderNo = #{row.orderNo,jdbcType=INTEGER},
  229. </if>
  230. <if test="row.menuName != null">
  231. MenuName = #{row.menuName,jdbcType=VARCHAR},
  232. </if>
  233. <if test="row.icon != null">
  234. Icon = #{row.icon,jdbcType=VARCHAR},
  235. </if>
  236. <if test="row.viewPath != null">
  237. ViewPath = #{row.viewPath,jdbcType=VARCHAR},
  238. </if>
  239. <if test="row.url != null">
  240. Url = #{row.url,jdbcType=VARCHAR},
  241. </if>
  242. <if test="row.parentMenuNo != null">
  243. ParentMenuNo = #{row.parentMenuNo,jdbcType=VARCHAR},
  244. </if>
  245. <if test="row.description != null">
  246. Description = #{row.description,jdbcType=VARCHAR},
  247. </if>
  248. <if test="row.isTopMenu != null">
  249. IsTopMenu = #{row.isTopMenu,jdbcType=BIT},
  250. </if>
  251. <if test="row.isVisible != null">
  252. IsVisible = #{row.isVisible,jdbcType=BIT},
  253. </if>
  254. <if test="row.isLeaf != null">
  255. IsLeaf = #{row.isLeaf,jdbcType=BIT},
  256. </if>
  257. <if test="row.functionCode != null">
  258. FunctionCode = #{row.functionCode,jdbcType=VARCHAR},
  259. </if>
  260. <if test="row.recordStatus != null">
  261. RecordStatus = #{row.recordStatus,jdbcType=INTEGER},
  262. </if>
  263. <if test="row.shortcutIcon != null">
  264. ShortcutIcon = #{row.shortcutIcon,jdbcType=VARCHAR},
  265. </if>
  266. </set>
  267. <if test="example != null">
  268. <include refid="Update_By_Example_Where_Clause" />
  269. </if>
  270. </update>
  271. <update id="updateByExample" parameterType="map">
  272. update sys_menu
  273. set MenuNo = #{row.menuNo,jdbcType=VARCHAR},
  274. OrderNo = #{row.orderNo,jdbcType=INTEGER},
  275. MenuName = #{row.menuName,jdbcType=VARCHAR},
  276. Icon = #{row.icon,jdbcType=VARCHAR},
  277. ViewPath = #{row.viewPath,jdbcType=VARCHAR},
  278. Url = #{row.url,jdbcType=VARCHAR},
  279. ParentMenuNo = #{row.parentMenuNo,jdbcType=VARCHAR},
  280. Description = #{row.description,jdbcType=VARCHAR},
  281. IsTopMenu = #{row.isTopMenu,jdbcType=BIT},
  282. IsVisible = #{row.isVisible,jdbcType=BIT},
  283. IsLeaf = #{row.isLeaf,jdbcType=BIT},
  284. FunctionCode = #{row.functionCode,jdbcType=VARCHAR},
  285. RecordStatus = #{row.recordStatus,jdbcType=INTEGER},
  286. ShortcutIcon = #{row.shortcutIcon,jdbcType=VARCHAR}
  287. <if test="example != null">
  288. <include refid="Update_By_Example_Where_Clause" />
  289. </if>
  290. </update>
  291. <update id="updateByPrimaryKeySelective" parameterType="com.bowintek.smartsearch.model.SysMenu">
  292. update sys_menu
  293. <set>
  294. <if test="orderNo != null">
  295. OrderNo = #{orderNo,jdbcType=INTEGER},
  296. </if>
  297. <if test="menuName != null">
  298. MenuName = #{menuName,jdbcType=VARCHAR},
  299. </if>
  300. <if test="icon != null">
  301. Icon = #{icon,jdbcType=VARCHAR},
  302. </if>
  303. <if test="viewPath != null">
  304. ViewPath = #{viewPath,jdbcType=VARCHAR},
  305. </if>
  306. <if test="url != null">
  307. Url = #{url,jdbcType=VARCHAR},
  308. </if>
  309. <if test="parentMenuNo != null">
  310. ParentMenuNo = #{parentMenuNo,jdbcType=VARCHAR},
  311. </if>
  312. <if test="description != null">
  313. Description = #{description,jdbcType=VARCHAR},
  314. </if>
  315. <if test="isTopMenu != null">
  316. IsTopMenu = #{isTopMenu,jdbcType=BIT},
  317. </if>
  318. <if test="isVisible != null">
  319. IsVisible = #{isVisible,jdbcType=BIT},
  320. </if>
  321. <if test="isLeaf != null">
  322. IsLeaf = #{isLeaf,jdbcType=BIT},
  323. </if>
  324. <if test="functionCode != null">
  325. FunctionCode = #{functionCode,jdbcType=VARCHAR},
  326. </if>
  327. <if test="recordStatus != null">
  328. RecordStatus = #{recordStatus,jdbcType=INTEGER},
  329. </if>
  330. <if test="shortcutIcon != null">
  331. ShortcutIcon = #{shortcutIcon,jdbcType=VARCHAR},
  332. </if>
  333. </set>
  334. where MenuNo = #{menuNo,jdbcType=VARCHAR}
  335. </update>
  336. <update id="updateByPrimaryKey" parameterType="com.bowintek.smartsearch.model.SysMenu">
  337. update sys_menu
  338. set OrderNo = #{orderNo,jdbcType=INTEGER},
  339. MenuName = #{menuName,jdbcType=VARCHAR},
  340. Icon = #{icon,jdbcType=VARCHAR},
  341. ViewPath = #{viewPath,jdbcType=VARCHAR},
  342. Url = #{url,jdbcType=VARCHAR},
  343. ParentMenuNo = #{parentMenuNo,jdbcType=VARCHAR},
  344. Description = #{description,jdbcType=VARCHAR},
  345. IsTopMenu = #{isTopMenu,jdbcType=BIT},
  346. IsVisible = #{isVisible,jdbcType=BIT},
  347. IsLeaf = #{isLeaf,jdbcType=BIT},
  348. FunctionCode = #{functionCode,jdbcType=VARCHAR},
  349. RecordStatus = #{recordStatus,jdbcType=INTEGER},
  350. ShortcutIcon = #{shortcutIcon,jdbcType=VARCHAR}
  351. where MenuNo = #{menuNo,jdbcType=VARCHAR}
  352. </update>
  353. </mapper>