SysFunctionCodeMapper.xml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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.SysFunctionCodeMapper">
  4. <resultMap id="BaseResultMap" type="com.bowintek.smartsearch.model.SysFunctionCode">
  5. <id column="FunctionCode" jdbcType="VARCHAR" property="functionCode" />
  6. <result column="FunctionName" jdbcType="VARCHAR" property="functionName" />
  7. <result column="ParentFunctionCode" jdbcType="VARCHAR" property="parentFunctionCode" />
  8. <result column="OrderNo" jdbcType="INTEGER" property="orderNo" />
  9. </resultMap>
  10. <sql id="Example_Where_Clause">
  11. <where>
  12. <foreach collection="oredCriteria" item="criteria" separator="or">
  13. <if test="criteria.valid">
  14. <trim prefix="(" prefixOverrides="and" suffix=")">
  15. <foreach collection="criteria.criteria" item="criterion">
  16. <choose>
  17. <when test="criterion.noValue">
  18. and ${criterion.condition}
  19. </when>
  20. <when test="criterion.singleValue">
  21. and ${criterion.condition} #{criterion.value}
  22. </when>
  23. <when test="criterion.betweenValue">
  24. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  25. </when>
  26. <when test="criterion.listValue">
  27. and ${criterion.condition}
  28. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  29. #{listItem}
  30. </foreach>
  31. </when>
  32. </choose>
  33. </foreach>
  34. </trim>
  35. </if>
  36. </foreach>
  37. </where>
  38. </sql>
  39. <sql id="Update_By_Example_Where_Clause">
  40. <where>
  41. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  42. <if test="criteria.valid">
  43. <trim prefix="(" prefixOverrides="and" suffix=")">
  44. <foreach collection="criteria.criteria" item="criterion">
  45. <choose>
  46. <when test="criterion.noValue">
  47. and ${criterion.condition}
  48. </when>
  49. <when test="criterion.singleValue">
  50. and ${criterion.condition} #{criterion.value}
  51. </when>
  52. <when test="criterion.betweenValue">
  53. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  54. </when>
  55. <when test="criterion.listValue">
  56. and ${criterion.condition}
  57. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  58. #{listItem}
  59. </foreach>
  60. </when>
  61. </choose>
  62. </foreach>
  63. </trim>
  64. </if>
  65. </foreach>
  66. </where>
  67. </sql>
  68. <sql id="Base_Column_List">
  69. FunctionCode, FunctionName, ParentFunctionCode, OrderNo
  70. </sql>
  71. <select id="selectByExample" parameterType="com.bowintek.smartsearch.model.SysFunctionCodeExample" resultMap="BaseResultMap">
  72. select
  73. <if test="distinct">
  74. distinct
  75. </if>
  76. <include refid="Base_Column_List" />
  77. from sys_function_code
  78. <if test="_parameter != null">
  79. <include refid="Example_Where_Clause" />
  80. </if>
  81. <if test="orderByClause != null">
  82. order by ${orderByClause}
  83. </if>
  84. </select>
  85. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  86. select
  87. <include refid="Base_Column_List" />
  88. from sys_function_code
  89. where FunctionCode = #{functionCode,jdbcType=VARCHAR}
  90. </select>
  91. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  92. delete from sys_function_code
  93. where FunctionCode = #{functionCode,jdbcType=VARCHAR}
  94. </delete>
  95. <delete id="deleteByExample" parameterType="com.bowintek.smartsearch.model.SysFunctionCodeExample">
  96. delete from sys_function_code
  97. <if test="_parameter != null">
  98. <include refid="Example_Where_Clause" />
  99. </if>
  100. </delete>
  101. <insert id="insert" parameterType="com.bowintek.smartsearch.model.SysFunctionCode">
  102. insert into sys_function_code (FunctionCode, FunctionName, ParentFunctionCode,
  103. OrderNo)
  104. values (#{functionCode,jdbcType=VARCHAR}, #{functionName,jdbcType=VARCHAR}, #{parentFunctionCode,jdbcType=VARCHAR},
  105. #{orderNo,jdbcType=INTEGER})
  106. </insert>
  107. <insert id="insertSelective" parameterType="com.bowintek.smartsearch.model.SysFunctionCode">
  108. insert into sys_function_code
  109. <trim prefix="(" suffix=")" suffixOverrides=",">
  110. <if test="functionCode != null">
  111. FunctionCode,
  112. </if>
  113. <if test="functionName != null">
  114. FunctionName,
  115. </if>
  116. <if test="parentFunctionCode != null">
  117. ParentFunctionCode,
  118. </if>
  119. <if test="orderNo != null">
  120. OrderNo,
  121. </if>
  122. </trim>
  123. <trim prefix="values (" suffix=")" suffixOverrides=",">
  124. <if test="functionCode != null">
  125. #{functionCode,jdbcType=VARCHAR},
  126. </if>
  127. <if test="functionName != null">
  128. #{functionName,jdbcType=VARCHAR},
  129. </if>
  130. <if test="parentFunctionCode != null">
  131. #{parentFunctionCode,jdbcType=VARCHAR},
  132. </if>
  133. <if test="orderNo != null">
  134. #{orderNo,jdbcType=INTEGER},
  135. </if>
  136. </trim>
  137. </insert>
  138. <select id="countByExample" parameterType="com.bowintek.smartsearch.model.SysFunctionCodeExample" resultType="java.lang.Long">
  139. select count(*) from sys_function_code
  140. <if test="_parameter != null">
  141. <include refid="Example_Where_Clause" />
  142. </if>
  143. </select>
  144. <update id="updateByExampleSelective" parameterType="map">
  145. update sys_function_code
  146. <set>
  147. <if test="row.functionCode != null">
  148. FunctionCode = #{row.functionCode,jdbcType=VARCHAR},
  149. </if>
  150. <if test="row.functionName != null">
  151. FunctionName = #{row.functionName,jdbcType=VARCHAR},
  152. </if>
  153. <if test="row.parentFunctionCode != null">
  154. ParentFunctionCode = #{row.parentFunctionCode,jdbcType=VARCHAR},
  155. </if>
  156. <if test="row.orderNo != null">
  157. OrderNo = #{row.orderNo,jdbcType=INTEGER},
  158. </if>
  159. </set>
  160. <if test="example != null">
  161. <include refid="Update_By_Example_Where_Clause" />
  162. </if>
  163. </update>
  164. <update id="updateByExample" parameterType="map">
  165. update sys_function_code
  166. set FunctionCode = #{row.functionCode,jdbcType=VARCHAR},
  167. FunctionName = #{row.functionName,jdbcType=VARCHAR},
  168. ParentFunctionCode = #{row.parentFunctionCode,jdbcType=VARCHAR},
  169. OrderNo = #{row.orderNo,jdbcType=INTEGER}
  170. <if test="example != null">
  171. <include refid="Update_By_Example_Where_Clause" />
  172. </if>
  173. </update>
  174. <update id="updateByPrimaryKeySelective" parameterType="com.bowintek.smartsearch.model.SysFunctionCode">
  175. update sys_function_code
  176. <set>
  177. <if test="functionName != null">
  178. FunctionName = #{functionName,jdbcType=VARCHAR},
  179. </if>
  180. <if test="parentFunctionCode != null">
  181. ParentFunctionCode = #{parentFunctionCode,jdbcType=VARCHAR},
  182. </if>
  183. <if test="orderNo != null">
  184. OrderNo = #{orderNo,jdbcType=INTEGER},
  185. </if>
  186. </set>
  187. where FunctionCode = #{functionCode,jdbcType=VARCHAR}
  188. </update>
  189. <update id="updateByPrimaryKey" parameterType="com.bowintek.smartsearch.model.SysFunctionCode">
  190. update sys_function_code
  191. set FunctionName = #{functionName,jdbcType=VARCHAR},
  192. ParentFunctionCode = #{parentFunctionCode,jdbcType=VARCHAR},
  193. OrderNo = #{orderNo,jdbcType=INTEGER}
  194. where FunctionCode = #{functionCode,jdbcType=VARCHAR}
  195. </update>
  196. </mapper>