SysPositionMapper.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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.gyee.frame.mapper.auto.SysPositionMapper">
  4. <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.SysPosition">
  5. <result column="id" jdbcType="VARCHAR" property="id" />
  6. <result column="post_name" jdbcType="VARCHAR" property="postName" />
  7. <result column="order_num" jdbcType="INTEGER" property="orderNum" />
  8. <result column="status" jdbcType="INTEGER" property="status" />
  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. id,
  70. post_name,
  71. order_num,
  72. status
  73. </sql>
  74. <select id="selectByExample" parameterType="com.gyee.frame.model.auto.SysPositionExample" resultMap="BaseResultMap">
  75. select
  76. <if test="distinct">
  77. distinct
  78. </if>
  79. <include refid="Base_Column_List" />
  80. from t_sys_position
  81. <if test="_parameter != null">
  82. <include refid="Example_Where_Clause" />
  83. </if>
  84. <if test="orderByClause != null">
  85. order by ${orderByClause}
  86. </if>
  87. </select>
  88. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  89. select
  90. <include refid="Base_Column_List" />
  91. from t_sys_position
  92. where id = #{id,jdbcType=VARCHAR}
  93. </select>
  94. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  95. delete from t_sys_position
  96. where id = #{id,jdbcType=VARCHAR}
  97. </delete>
  98. <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.SysPositionExample">
  99. delete from t_sys_position
  100. <if test="_parameter != null">
  101. <include refid="Example_Where_Clause" />
  102. </if>
  103. </delete>
  104. <insert id="insert" parameterType="com.gyee.frame.model.auto.SysPosition">
  105. insert into t_sys_position (
  106. id,
  107. post_name,
  108. order_num,
  109. status
  110. )
  111. values (
  112. #{id,jdbcType=VARCHAR},
  113. #{postName,jdbcType=VARCHAR},
  114. #{orderNum,jdbcType=INTEGER},
  115. #{status,jdbcType=INTEGER}
  116. )
  117. </insert>
  118. <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.SysPosition">
  119. insert into t_sys_position
  120. <trim prefix="(" suffix=")" suffixOverrides=",">
  121. <if test="id != null">
  122. id,
  123. </if>
  124. <if test="postName != null">
  125. post_name,
  126. </if>
  127. <if test="orderNum != null">
  128. order_num,
  129. </if>
  130. <if test="status != null">
  131. status,
  132. </if>
  133. </trim>
  134. <trim prefix="values (" suffix=")" suffixOverrides=",">
  135. <if test="id != null">
  136. #{id,jdbcType=VARCHAR},
  137. </if>
  138. <if test="postName != null">
  139. #{postName,jdbcType=VARCHAR},
  140. </if>
  141. <if test="orderNum != null">
  142. #{orderNum,jdbcType=INTEGER},
  143. </if>
  144. <if test="status != null">
  145. #{status,jdbcType=INTEGER},
  146. </if>
  147. </trim>
  148. </insert>
  149. <select id="countByExample" parameterType="com.gyee.frame.model.auto.SysPositionExample" resultType="java.lang.Long">
  150. select count(*) from t_sys_position
  151. <if test="_parameter != null">
  152. <include refid="Example_Where_Clause" />
  153. </if>
  154. </select>
  155. <update id="updateByExampleSelective" parameterType="map">
  156. update t_sys_position
  157. <set>
  158. <if test="record.id != null">
  159. id = #{record.id,jdbcType=VARCHAR},
  160. </if>
  161. <if test="record.postName != null">
  162. post_name = #{record.postName,jdbcType=VARCHAR},
  163. </if>
  164. <if test="record.orderNum != null">
  165. order_num = #{record.orderNum,jdbcType=INTEGER},
  166. </if>
  167. <if test="record.status != null">
  168. status = #{record.status,jdbcType=INTEGER},
  169. </if>
  170. </set>
  171. <if test="_parameter != null">
  172. <include refid="Update_By_Example_Where_Clause" />
  173. </if>
  174. </update>
  175. <update id="updateByExample" parameterType="map">
  176. update t_sys_position
  177. set
  178. id = #{record.id,jdbcType=VARCHAR},
  179. post_name = #{record.postName,jdbcType=VARCHAR},
  180. order_num = #{record.orderNum,jdbcType=INTEGER},
  181. status = #{record.status,jdbcType=INTEGER}
  182. <if test="_parameter != null">
  183. <include refid="Update_By_Example_Where_Clause" />
  184. </if>
  185. </update>
  186. <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.SysPosition">
  187. update t_sys_position
  188. <set>
  189. <if test="postName != null">
  190. post_name = #{postName,jdbcType=VARCHAR},
  191. </if>
  192. <if test="orderNum != null">
  193. order_num = #{orderNum,jdbcType=INTEGER},
  194. </if>
  195. <if test="status != null">
  196. status = #{status,jdbcType=INTEGER},
  197. </if>
  198. </set>
  199. where
  200. id = #{id,jdbcType=VARCHAR}
  201. </update>
  202. <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.SysPosition">
  203. update t_sys_position
  204. set
  205. post_name = #{postName,jdbcType=VARCHAR},
  206. order_num = #{orderNum,jdbcType=INTEGER},
  207. status = #{status,jdbcType=INTEGER}
  208. where
  209. id = #{id,jdbcType=VARCHAR}
  210. </update>
  211. </mapper>