TemplateMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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.xmnk.springbootbase.dao.TemplateMapper">
  4. <resultMap id="BaseResultMap" type="com.xmnk.springbootbase.entity.Template">
  5. <!--
  6. WARNING - @mbg.generated
  7. -->
  8. <id column="id" jdbcType="INTEGER" property="id" />
  9. <result column="name" jdbcType="VARCHAR" property="name" />
  10. <result column="background_url" jdbcType="VARCHAR" property="backgroundUrl" />
  11. <result column="template_url" jdbcType="VARCHAR" property="templateUrl" />
  12. <result column="status" jdbcType="INTEGER" property="status" />
  13. <result column="deleted_at" jdbcType="TIMESTAMP" property="deletedAt" />
  14. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  15. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  16. </resultMap>
  17. <sql id="Example_Where_Clause">
  18. <!--
  19. WARNING - @mbg.generated
  20. -->
  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. <!--
  51. WARNING - @mbg.generated
  52. -->
  53. <where>
  54. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  55. <if test="criteria.valid">
  56. <trim prefix="(" prefixOverrides="and" suffix=")">
  57. <foreach collection="criteria.criteria" item="criterion">
  58. <choose>
  59. <when test="criterion.noValue">
  60. and ${criterion.condition}
  61. </when>
  62. <when test="criterion.singleValue">
  63. and ${criterion.condition} #{criterion.value}
  64. </when>
  65. <when test="criterion.betweenValue">
  66. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  67. </when>
  68. <when test="criterion.listValue">
  69. and ${criterion.condition}
  70. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  71. #{listItem}
  72. </foreach>
  73. </when>
  74. </choose>
  75. </foreach>
  76. </trim>
  77. </if>
  78. </foreach>
  79. </where>
  80. </sql>
  81. <sql id="Base_Column_List">
  82. <!--
  83. WARNING - @mbg.generated
  84. -->
  85. id, name, background_url, template_url, status, deleted_at, create_time, update_time
  86. </sql>
  87. <select id="selectByExample" parameterType="com.xmnk.springbootbase.entity.TemplateExample" resultMap="BaseResultMap">
  88. <!--
  89. WARNING - @mbg.generated
  90. -->
  91. select
  92. <if test="distinct">
  93. distinct
  94. </if>
  95. 'true' as QUERYID,
  96. <include refid="Base_Column_List" />
  97. from tb_template
  98. <if test="_parameter != null">
  99. <include refid="Example_Where_Clause" />
  100. </if>
  101. <if test="orderByClause != null">
  102. order by ${orderByClause}
  103. </if>
  104. </select>
  105. <delete id="deleteByExample" parameterType="com.xmnk.springbootbase.entity.TemplateExample">
  106. <!--
  107. WARNING - @mbg.generated
  108. -->
  109. delete from tb_template
  110. <if test="_parameter != null">
  111. <include refid="Example_Where_Clause" />
  112. </if>
  113. </delete>
  114. <select id="countByExample" parameterType="com.xmnk.springbootbase.entity.TemplateExample" resultType="java.lang.Integer">
  115. <!--
  116. WARNING - @mbg.generated
  117. -->
  118. select count(*) from tb_template
  119. <if test="_parameter != null">
  120. <include refid="Example_Where_Clause" />
  121. </if>
  122. </select>
  123. <update id="updateByExampleSelective" parameterType="map">
  124. <!--
  125. WARNING - @mbg.generated
  126. -->
  127. update tb_template
  128. <set>
  129. <if test="record.id != null">
  130. id = #{record.id,jdbcType=INTEGER},
  131. </if>
  132. <if test="record.name != null">
  133. name = #{record.name,jdbcType=VARCHAR},
  134. </if>
  135. <if test="record.backgroundUrl != null">
  136. background_url = #{record.backgroundUrl,jdbcType=VARCHAR},
  137. </if>
  138. <if test="record.templateUrl != null">
  139. template_url = #{record.templateUrl,jdbcType=VARCHAR},
  140. </if>
  141. <if test="record.status != null">
  142. status = #{record.status,jdbcType=INTEGER},
  143. </if>
  144. <if test="record.deletedAt != null">
  145. deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
  146. </if>
  147. <if test="record.createTime != null">
  148. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  149. </if>
  150. <if test="record.updateTime != null">
  151. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  152. </if>
  153. </set>
  154. <if test="_parameter != null">
  155. <include refid="Update_By_Example_Where_Clause" />
  156. </if>
  157. </update>
  158. <update id="updateByExample" parameterType="map">
  159. <!--
  160. WARNING - @mbg.generated
  161. -->
  162. update tb_template
  163. set id = #{record.id,jdbcType=INTEGER},
  164. name = #{record.name,jdbcType=VARCHAR},
  165. background_url = #{record.backgroundUrl,jdbcType=VARCHAR},
  166. template_url = #{record.templateUrl,jdbcType=VARCHAR},
  167. status = #{record.status,jdbcType=INTEGER},
  168. deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
  169. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  170. update_time = #{record.updateTime,jdbcType=TIMESTAMP}
  171. <if test="_parameter != null">
  172. <include refid="Update_By_Example_Where_Clause" />
  173. </if>
  174. </update>
  175. <resultMap id="BaseResultMap" type="com.xmnk.springbootfunction.entity.Template">
  176. <!--
  177. WARNING - @mbg.generated
  178. -->
  179. <id column="id" jdbcType="INTEGER" property="id" />
  180. <result column="name" jdbcType="VARCHAR" property="name" />
  181. <result column="background_url" jdbcType="VARCHAR" property="backgroundUrl" />
  182. <result column="template_url" jdbcType="VARCHAR" property="templateUrl" />
  183. <result column="status" jdbcType="INTEGER" property="status" />
  184. <result column="deleted_at" jdbcType="TIMESTAMP" property="deletedAt" />
  185. <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
  186. <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
  187. </resultMap>
  188. <sql id="Example_Where_Clause">
  189. <!--
  190. WARNING - @mbg.generated
  191. -->
  192. <where>
  193. <foreach collection="oredCriteria" item="criteria" separator="or">
  194. <if test="criteria.valid">
  195. <trim prefix="(" prefixOverrides="and" suffix=")">
  196. <foreach collection="criteria.criteria" item="criterion">
  197. <choose>
  198. <when test="criterion.noValue">
  199. and ${criterion.condition}
  200. </when>
  201. <when test="criterion.singleValue">
  202. and ${criterion.condition} #{criterion.value}
  203. </when>
  204. <when test="criterion.betweenValue">
  205. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  206. </when>
  207. <when test="criterion.listValue">
  208. and ${criterion.condition}
  209. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  210. #{listItem}
  211. </foreach>
  212. </when>
  213. </choose>
  214. </foreach>
  215. </trim>
  216. </if>
  217. </foreach>
  218. </where>
  219. </sql>
  220. <sql id="Update_By_Example_Where_Clause">
  221. <!--
  222. WARNING - @mbg.generated
  223. -->
  224. <where>
  225. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  226. <if test="criteria.valid">
  227. <trim prefix="(" prefixOverrides="and" suffix=")">
  228. <foreach collection="criteria.criteria" item="criterion">
  229. <choose>
  230. <when test="criterion.noValue">
  231. and ${criterion.condition}
  232. </when>
  233. <when test="criterion.singleValue">
  234. and ${criterion.condition} #{criterion.value}
  235. </when>
  236. <when test="criterion.betweenValue">
  237. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  238. </when>
  239. <when test="criterion.listValue">
  240. and ${criterion.condition}
  241. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  242. #{listItem}
  243. </foreach>
  244. </when>
  245. </choose>
  246. </foreach>
  247. </trim>
  248. </if>
  249. </foreach>
  250. </where>
  251. </sql>
  252. <sql id="Base_Column_List">
  253. <!--
  254. WARNING - @mbg.generated
  255. -->
  256. id, name, background_url, template_url, status, deleted_at, created_at, updated_at
  257. </sql>
  258. <select id="selectByExample" parameterType="com.xmnk.springbootfunction.entity.TemplateExample" resultMap="BaseResultMap">
  259. <!--
  260. WARNING - @mbg.generated
  261. -->
  262. select
  263. <if test="distinct">
  264. distinct
  265. </if>
  266. 'true' as QUERYID,
  267. <include refid="Base_Column_List" />
  268. from tb_template
  269. <if test="_parameter != null">
  270. <include refid="Example_Where_Clause" />
  271. </if>
  272. <if test="orderByClause != null">
  273. order by ${orderByClause}
  274. </if>
  275. </select>
  276. <delete id="deleteByExample" parameterType="com.xmnk.springbootfunction.entity.TemplateExample">
  277. <!--
  278. WARNING - @mbg.generated
  279. -->
  280. delete from tb_template
  281. <if test="_parameter != null">
  282. <include refid="Example_Where_Clause" />
  283. </if>
  284. </delete>
  285. <select id="countByExample" parameterType="com.xmnk.springbootfunction.entity.TemplateExample" resultType="java.lang.Integer">
  286. <!--
  287. WARNING - @mbg.generated
  288. -->
  289. select count(*) from tb_template
  290. <if test="_parameter != null">
  291. <include refid="Example_Where_Clause" />
  292. </if>
  293. </select>
  294. <update id="updateByExampleSelective" parameterType="map">
  295. <!--
  296. WARNING - @mbg.generated
  297. -->
  298. update tb_template
  299. <set>
  300. <if test="record.id != null">
  301. id = #{record.id,jdbcType=INTEGER},
  302. </if>
  303. <if test="record.name != null">
  304. name = #{record.name,jdbcType=VARCHAR},
  305. </if>
  306. <if test="record.backgroundUrl != null">
  307. background_url = #{record.backgroundUrl,jdbcType=VARCHAR},
  308. </if>
  309. <if test="record.templateUrl != null">
  310. template_url = #{record.templateUrl,jdbcType=VARCHAR},
  311. </if>
  312. <if test="record.status != null">
  313. status = #{record.status,jdbcType=INTEGER},
  314. </if>
  315. <if test="record.deletedAt != null">
  316. deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
  317. </if>
  318. <if test="record.createdAt != null">
  319. created_at = #{record.createdAt,jdbcType=TIMESTAMP},
  320. </if>
  321. <if test="record.updatedAt != null">
  322. updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
  323. </if>
  324. </set>
  325. <if test="_parameter != null">
  326. <include refid="Update_By_Example_Where_Clause" />
  327. </if>
  328. </update>
  329. <update id="updateByExample" parameterType="map">
  330. <!--
  331. WARNING - @mbg.generated
  332. -->
  333. update tb_template
  334. set id = #{record.id,jdbcType=INTEGER},
  335. name = #{record.name,jdbcType=VARCHAR},
  336. background_url = #{record.backgroundUrl,jdbcType=VARCHAR},
  337. template_url = #{record.templateUrl,jdbcType=VARCHAR},
  338. status = #{record.status,jdbcType=INTEGER},
  339. deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
  340. created_at = #{record.createdAt,jdbcType=TIMESTAMP},
  341. updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}
  342. <if test="_parameter != null">
  343. <include refid="Update_By_Example_Where_Clause" />
  344. </if>
  345. </update>
  346. </mapper>