TemplateElementMapper.xml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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.springbootfunction.dao.TemplateElementMapper" >
  4. <resultMap id="BaseResultMap" type="com.xmnk.springbootfunction.entity.TemplateElement" >
  5. <!--
  6. WARNING - @mbg.generated
  7. -->
  8. <id column="id" property="id" jdbcType="INTEGER" />
  9. <result column="template_id" property="templateId" jdbcType="INTEGER" />
  10. <result column="type" property="type" jdbcType="INTEGER" />
  11. <result column="t_sore" property="tSore" jdbcType="INTEGER" />
  12. <result column="status" property="status" jdbcType="INTEGER" />
  13. <result column="deleted_at" property="deletedAt" jdbcType="TIMESTAMP" />
  14. <result column="created_at" property="createdAt" jdbcType="TIMESTAMP" />
  15. <result column="updated_at" property="updatedAt" jdbcType="TIMESTAMP" />
  16. </resultMap>
  17. <resultMap id="ResultMapWithBLOBs" type="com.xmnk.springbootfunction.entity.TemplateElement" extends="BaseResultMap" >
  18. <!--
  19. WARNING - @mbg.generated
  20. -->
  21. <result column="content" property="content" jdbcType="LONGVARCHAR" />
  22. <result column="area" property="area" jdbcType="LONGVARCHAR" />
  23. <result column="t_style" property="tStyle" jdbcType="LONGVARCHAR" />
  24. </resultMap>
  25. <sql id="Example_Where_Clause" >
  26. <!--
  27. WARNING - @mbg.generated
  28. -->
  29. <where >
  30. <foreach collection="oredCriteria" item="criteria" separator="or" >
  31. <if test="criteria.valid" >
  32. <trim prefix="(" suffix=")" prefixOverrides="and" >
  33. <foreach collection="criteria.criteria" item="criterion" >
  34. <choose >
  35. <when test="criterion.noValue" >
  36. and ${criterion.condition}
  37. </when>
  38. <when test="criterion.singleValue" >
  39. and ${criterion.condition} #{criterion.value}
  40. </when>
  41. <when test="criterion.betweenValue" >
  42. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  43. </when>
  44. <when test="criterion.listValue" >
  45. and ${criterion.condition}
  46. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  47. #{listItem}
  48. </foreach>
  49. </when>
  50. </choose>
  51. </foreach>
  52. </trim>
  53. </if>
  54. </foreach>
  55. </where>
  56. </sql>
  57. <sql id="Update_By_Example_Where_Clause" >
  58. <!--
  59. WARNING - @mbg.generated
  60. -->
  61. <where >
  62. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  63. <if test="criteria.valid" >
  64. <trim prefix="(" suffix=")" prefixOverrides="and" >
  65. <foreach collection="criteria.criteria" item="criterion" >
  66. <choose >
  67. <when test="criterion.noValue" >
  68. and ${criterion.condition}
  69. </when>
  70. <when test="criterion.singleValue" >
  71. and ${criterion.condition} #{criterion.value}
  72. </when>
  73. <when test="criterion.betweenValue" >
  74. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  75. </when>
  76. <when test="criterion.listValue" >
  77. and ${criterion.condition}
  78. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  79. #{listItem}
  80. </foreach>
  81. </when>
  82. </choose>
  83. </foreach>
  84. </trim>
  85. </if>
  86. </foreach>
  87. </where>
  88. </sql>
  89. <sql id="Base_Column_List" >
  90. <!--
  91. WARNING - @mbg.generated
  92. -->
  93. id, template_id, type, t_sore, status, deleted_at, created_at, updated_at
  94. </sql>
  95. <sql id="Blob_Column_List" >
  96. <!--
  97. WARNING - @mbg.generated
  98. -->
  99. content, area, t_style
  100. </sql>
  101. <select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs" parameterType="com.xmnk.springbootfunction.entity.TemplateElementExample" >
  102. <!--
  103. WARNING - @mbg.generated
  104. -->
  105. select
  106. <if test="distinct" >
  107. distinct
  108. </if>
  109. 'true' as QUERYID,
  110. <include refid="Base_Column_List" />
  111. ,
  112. <include refid="Blob_Column_List" />
  113. from tb_template_element
  114. <if test="_parameter != null" >
  115. <include refid="Example_Where_Clause" />
  116. </if>
  117. <if test="orderByClause != null" >
  118. order by ${orderByClause}
  119. </if>
  120. </select>
  121. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.xmnk.springbootfunction.entity.TemplateElementExample" >
  122. <!--
  123. WARNING - @mbg.generated
  124. -->
  125. select
  126. <if test="distinct" >
  127. distinct
  128. </if>
  129. 'true' as QUERYID,
  130. <include refid="Base_Column_List" />
  131. from tb_template_element
  132. <if test="_parameter != null" >
  133. <include refid="Example_Where_Clause" />
  134. </if>
  135. <if test="orderByClause != null" >
  136. order by ${orderByClause}
  137. </if>
  138. </select>
  139. <delete id="deleteByExample" parameterType="com.xmnk.springbootfunction.entity.TemplateElementExample" >
  140. <!--
  141. WARNING - @mbg.generated
  142. -->
  143. delete from tb_template_element
  144. <if test="_parameter != null" >
  145. <include refid="Example_Where_Clause" />
  146. </if>
  147. </delete>
  148. <select id="countByExample" parameterType="com.xmnk.springbootfunction.entity.TemplateElementExample" resultType="java.lang.Integer" >
  149. <!--
  150. WARNING - @mbg.generated
  151. -->
  152. select count(*) from tb_template_element
  153. <if test="_parameter != null" >
  154. <include refid="Example_Where_Clause" />
  155. </if>
  156. </select>
  157. <update id="updateByExampleSelective" parameterType="map" >
  158. <!--
  159. WARNING - @mbg.generated
  160. -->
  161. update tb_template_element
  162. <set >
  163. <if test="record.id != null" >
  164. id = #{record.id,jdbcType=INTEGER},
  165. </if>
  166. <if test="record.templateId != null" >
  167. template_id = #{record.templateId,jdbcType=INTEGER},
  168. </if>
  169. <if test="record.type != null" >
  170. type = #{record.type,jdbcType=INTEGER},
  171. </if>
  172. <if test="record.tSore != null" >
  173. t_sore = #{record.tSore,jdbcType=INTEGER},
  174. </if>
  175. <if test="record.status != null" >
  176. status = #{record.status,jdbcType=INTEGER},
  177. </if>
  178. <if test="record.deletedAt != null" >
  179. deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
  180. </if>
  181. <if test="record.createdAt != null" >
  182. created_at = #{record.createdAt,jdbcType=TIMESTAMP},
  183. </if>
  184. <if test="record.updatedAt != null" >
  185. updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
  186. </if>
  187. <if test="record.content != null" >
  188. content = #{record.content,jdbcType=LONGVARCHAR},
  189. </if>
  190. <if test="record.area != null" >
  191. area = #{record.area,jdbcType=LONGVARCHAR},
  192. </if>
  193. <if test="record.tStyle != null" >
  194. t_style = #{record.tStyle,jdbcType=LONGVARCHAR},
  195. </if>
  196. </set>
  197. <if test="_parameter != null" >
  198. <include refid="Update_By_Example_Where_Clause" />
  199. </if>
  200. </update>
  201. <update id="updateByExampleWithBLOBs" parameterType="map" >
  202. <!--
  203. WARNING - @mbg.generated
  204. -->
  205. update tb_template_element
  206. set id = #{record.id,jdbcType=INTEGER},
  207. template_id = #{record.templateId,jdbcType=INTEGER},
  208. type = #{record.type,jdbcType=INTEGER},
  209. t_sore = #{record.tSore,jdbcType=INTEGER},
  210. status = #{record.status,jdbcType=INTEGER},
  211. deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
  212. created_at = #{record.createdAt,jdbcType=TIMESTAMP},
  213. updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
  214. content = #{record.content,jdbcType=LONGVARCHAR},
  215. area = #{record.area,jdbcType=LONGVARCHAR},
  216. t_style = #{record.tStyle,jdbcType=LONGVARCHAR}
  217. <if test="_parameter != null" >
  218. <include refid="Update_By_Example_Where_Clause" />
  219. </if>
  220. </update>
  221. <update id="updateByExample" parameterType="map" >
  222. <!--
  223. WARNING - @mbg.generated
  224. -->
  225. update tb_template_element
  226. set id = #{record.id,jdbcType=INTEGER},
  227. template_id = #{record.templateId,jdbcType=INTEGER},
  228. type = #{record.type,jdbcType=INTEGER},
  229. t_sore = #{record.tSore,jdbcType=INTEGER},
  230. status = #{record.status,jdbcType=INTEGER},
  231. deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
  232. created_at = #{record.createdAt,jdbcType=TIMESTAMP},
  233. updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}
  234. <if test="_parameter != null" >
  235. <include refid="Update_By_Example_Where_Clause" />
  236. </if>
  237. </update>
  238. </mapper>