TGlobalConfigMapper.xml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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.shawn.repository.TGlobalConfigMapper">
  4. <resultMap id="BaseResultMap" type="com.shawn.model.entity.TGlobalConfig">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  7. <result column="modify_date" jdbcType="TIMESTAMP" property="modifyDate" />
  8. <result column="orders" jdbcType="INTEGER" property="orders" />
  9. <result column="access_code" jdbcType="VARCHAR" property="accessCode" />
  10. </resultMap>
  11. <sql id="Example_Where_Clause">
  12. <where>
  13. <foreach collection="oredCriteria" item="criteria" separator="or">
  14. <if test="criteria.valid">
  15. <trim prefix="(" prefixOverrides="and" suffix=")">
  16. <foreach collection="criteria.criteria" item="criterion">
  17. <choose>
  18. <when test="criterion.noValue">
  19. and ${criterion.condition}
  20. </when>
  21. <when test="criterion.singleValue">
  22. and ${criterion.condition} #{criterion.value}
  23. </when>
  24. <when test="criterion.betweenValue">
  25. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  26. </when>
  27. <when test="criterion.listValue">
  28. and ${criterion.condition}
  29. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  30. #{listItem}
  31. </foreach>
  32. </when>
  33. </choose>
  34. </foreach>
  35. </trim>
  36. </if>
  37. </foreach>
  38. </where>
  39. </sql>
  40. <sql id="Update_By_Example_Where_Clause">
  41. <where>
  42. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  43. <if test="criteria.valid">
  44. <trim prefix="(" prefixOverrides="and" suffix=")">
  45. <foreach collection="criteria.criteria" item="criterion">
  46. <choose>
  47. <when test="criterion.noValue">
  48. and ${criterion.condition}
  49. </when>
  50. <when test="criterion.singleValue">
  51. and ${criterion.condition} #{criterion.value}
  52. </when>
  53. <when test="criterion.betweenValue">
  54. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  55. </when>
  56. <when test="criterion.listValue">
  57. and ${criterion.condition}
  58. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  59. #{listItem}
  60. </foreach>
  61. </when>
  62. </choose>
  63. </foreach>
  64. </trim>
  65. </if>
  66. </foreach>
  67. </where>
  68. </sql>
  69. <sql id="Base_Column_List">
  70. id, create_date, modify_date, orders, access_code
  71. </sql>
  72. <select id="selectByExample" parameterType="com.shawn.model.entity.TGlobalConfigExample" resultMap="BaseResultMap">
  73. select
  74. <if test="distinct">
  75. distinct
  76. </if>
  77. <include refid="Base_Column_List" />
  78. from t_global_config
  79. <if test="_parameter != null">
  80. <include refid="Example_Where_Clause" />
  81. </if>
  82. <if test="orderByClause != null">
  83. order by ${orderByClause}
  84. </if>
  85. <if test="limit != null">
  86. <if test="offset != null">
  87. limit ${offset}, ${limit}
  88. </if>
  89. <if test="offset == null">
  90. limit ${limit}
  91. </if>
  92. </if>
  93. </select>
  94. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  95. select
  96. <include refid="Base_Column_List" />
  97. from t_global_config
  98. where id = #{id,jdbcType=BIGINT}
  99. </select>
  100. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  101. delete from t_global_config
  102. where id = #{id,jdbcType=BIGINT}
  103. </delete>
  104. <delete id="deleteByExample" parameterType="com.shawn.model.entity.TGlobalConfigExample">
  105. delete from t_global_config
  106. <if test="_parameter != null">
  107. <include refid="Example_Where_Clause" />
  108. </if>
  109. </delete>
  110. <insert id="insert" parameterType="com.shawn.model.entity.TGlobalConfig">
  111. insert into t_global_config (id, create_date, modify_date,
  112. orders, access_code)
  113. values (#{id,jdbcType=BIGINT}, #{createDate,jdbcType=TIMESTAMP}, #{modifyDate,jdbcType=TIMESTAMP},
  114. #{orders,jdbcType=INTEGER}, #{accessCode,jdbcType=VARCHAR})
  115. </insert>
  116. <insert id="insertSelective" parameterType="com.shawn.model.entity.TGlobalConfig">
  117. insert into t_global_config
  118. <trim prefix="(" suffix=")" suffixOverrides=",">
  119. <if test="id != null">
  120. id,
  121. </if>
  122. <if test="createDate != null">
  123. create_date,
  124. </if>
  125. <if test="modifyDate != null">
  126. modify_date,
  127. </if>
  128. <if test="orders != null">
  129. orders,
  130. </if>
  131. <if test="accessCode != null">
  132. access_code,
  133. </if>
  134. </trim>
  135. <trim prefix="values (" suffix=")" suffixOverrides=",">
  136. <if test="id != null">
  137. #{id,jdbcType=BIGINT},
  138. </if>
  139. <if test="createDate != null">
  140. #{createDate,jdbcType=TIMESTAMP},
  141. </if>
  142. <if test="modifyDate != null">
  143. #{modifyDate,jdbcType=TIMESTAMP},
  144. </if>
  145. <if test="orders != null">
  146. #{orders,jdbcType=INTEGER},
  147. </if>
  148. <if test="accessCode != null">
  149. #{accessCode,jdbcType=VARCHAR},
  150. </if>
  151. </trim>
  152. </insert>
  153. <select id="countByExample" parameterType="com.shawn.model.entity.TGlobalConfigExample" resultType="java.lang.Long">
  154. select count(*) from t_global_config
  155. <if test="_parameter != null">
  156. <include refid="Example_Where_Clause" />
  157. </if>
  158. </select>
  159. <update id="updateByExampleSelective" parameterType="map">
  160. update t_global_config
  161. <set>
  162. <if test="record.id != null">
  163. id = #{record.id,jdbcType=BIGINT},
  164. </if>
  165. <if test="record.createDate != null">
  166. create_date = #{record.createDate,jdbcType=TIMESTAMP},
  167. </if>
  168. <if test="record.modifyDate != null">
  169. modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
  170. </if>
  171. <if test="record.orders != null">
  172. orders = #{record.orders,jdbcType=INTEGER},
  173. </if>
  174. <if test="record.accessCode != null">
  175. access_code = #{record.accessCode,jdbcType=VARCHAR},
  176. </if>
  177. </set>
  178. <if test="_parameter != null">
  179. <include refid="Update_By_Example_Where_Clause" />
  180. </if>
  181. </update>
  182. <update id="updateByExample" parameterType="map">
  183. update t_global_config
  184. set id = #{record.id,jdbcType=BIGINT},
  185. create_date = #{record.createDate,jdbcType=TIMESTAMP},
  186. modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
  187. orders = #{record.orders,jdbcType=INTEGER},
  188. access_code = #{record.accessCode,jdbcType=VARCHAR}
  189. <if test="_parameter != null">
  190. <include refid="Update_By_Example_Where_Clause" />
  191. </if>
  192. </update>
  193. <update id="updateByPrimaryKeySelective" parameterType="com.shawn.model.entity.TGlobalConfig">
  194. update t_global_config
  195. <set>
  196. <if test="createDate != null">
  197. create_date = #{createDate,jdbcType=TIMESTAMP},
  198. </if>
  199. <if test="modifyDate != null">
  200. modify_date = #{modifyDate,jdbcType=TIMESTAMP},
  201. </if>
  202. <if test="orders != null">
  203. orders = #{orders,jdbcType=INTEGER},
  204. </if>
  205. <if test="accessCode != null">
  206. access_code = #{accessCode,jdbcType=VARCHAR},
  207. </if>
  208. </set>
  209. where id = #{id,jdbcType=BIGINT}
  210. </update>
  211. <update id="updateByPrimaryKey" parameterType="com.shawn.model.entity.TGlobalConfig">
  212. update t_global_config
  213. set create_date = #{createDate,jdbcType=TIMESTAMP},
  214. modify_date = #{modifyDate,jdbcType=TIMESTAMP},
  215. orders = #{orders,jdbcType=INTEGER},
  216. access_code = #{accessCode,jdbcType=VARCHAR}
  217. where id = #{id,jdbcType=BIGINT}
  218. </update>
  219. <insert id="insertBatch" parameterType="java.util.List">
  220. insert into t_global_config (id,create_date,modify_date,orders,access_code)
  221. <foreach collection="list" index="index" item="item" separator="union all">
  222. select #{item.id,jdbcType=BIGINT},#{item.createDate,jdbcType=TIMESTAMP},#{item.modifyDate,jdbcType=TIMESTAMP},#{item.orders,jdbcType=INTEGER},#{item.accessCode,jdbcType=VARCHAR} from dual
  223. </foreach>
  224. </insert>
  225. <delete id="deleteBatchByIdList" parameterType="java.util.List">
  226. DELETE FROM t_global_config where id in
  227. <foreach close=")" collection="list" item="item" open="(" separator=",">
  228. #{item}
  229. </foreach>
  230. </delete>
  231. <update id="updateBatchByIdList" parameterType="com.shawn.model.param.TGlobalConfigParam">
  232. update t_global_config
  233. <trim prefix="set" suffixOverrides=",">
  234. <if test="id != null">
  235. id = #{id},
  236. </if>
  237. <if test="createDate != null">
  238. create_date = #{createDate},
  239. </if>
  240. <if test="modifyDate != null">
  241. modify_date = #{modifyDate},
  242. </if>
  243. <if test="orders != null">
  244. orders = #{orders},
  245. </if>
  246. <if test="accessCode != null">
  247. access_code = #{accessCode},
  248. </if>
  249. </trim>
  250. where id in
  251. <foreach close=")" collection="primaryKeyList" item="item" open="(" separator=",">
  252. #{item}
  253. </foreach>
  254. </update>
  255. </mapper>