LogMapper.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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.dao.LogMapper" >
  4. <resultMap id="BaseResultMap" type="com.xmnk.springbootbase.entity.Log" >
  5. <!--
  6. WARNING - @mbg.generated
  7. -->
  8. <id column="id" property="id" jdbcType="VARCHAR" />
  9. <result column="user_id" property="userId" jdbcType="VARCHAR" />
  10. <result column="username" property="username" jdbcType="VARCHAR" />
  11. <result column="operation" property="operation" jdbcType="VARCHAR" />
  12. <result column="time" property="time" jdbcType="INTEGER" />
  13. <result column="method" property="method" jdbcType="VARCHAR" />
  14. <result column="params" property="params" jdbcType="VARCHAR" />
  15. <result column="ip" property="ip" jdbcType="VARCHAR" />
  16. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  17. </resultMap>
  18. <sql id="Example_Where_Clause" >
  19. <!--
  20. WARNING - @mbg.generated
  21. -->
  22. <where >
  23. <foreach collection="oredCriteria" item="criteria" separator="or" >
  24. <if test="criteria.valid" >
  25. <trim prefix="(" suffix=")" prefixOverrides="and" >
  26. <foreach collection="criteria.criteria" item="criterion" >
  27. <choose >
  28. <when test="criterion.noValue" >
  29. and ${criterion.condition}
  30. </when>
  31. <when test="criterion.singleValue" >
  32. and ${criterion.condition} #{criterion.value}
  33. </when>
  34. <when test="criterion.betweenValue" >
  35. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  36. </when>
  37. <when test="criterion.listValue" >
  38. and ${criterion.condition}
  39. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  40. #{listItem}
  41. </foreach>
  42. </when>
  43. </choose>
  44. </foreach>
  45. </trim>
  46. </if>
  47. </foreach>
  48. </where>
  49. </sql>
  50. <sql id="Update_By_Example_Where_Clause" >
  51. <!--
  52. WARNING - @mbg.generated
  53. -->
  54. <where >
  55. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  56. <if test="criteria.valid" >
  57. <trim prefix="(" suffix=")" prefixOverrides="and" >
  58. <foreach collection="criteria.criteria" item="criterion" >
  59. <choose >
  60. <when test="criterion.noValue" >
  61. and ${criterion.condition}
  62. </when>
  63. <when test="criterion.singleValue" >
  64. and ${criterion.condition} #{criterion.value}
  65. </when>
  66. <when test="criterion.betweenValue" >
  67. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  68. </when>
  69. <when test="criterion.listValue" >
  70. and ${criterion.condition}
  71. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  72. #{listItem}
  73. </foreach>
  74. </when>
  75. </choose>
  76. </foreach>
  77. </trim>
  78. </if>
  79. </foreach>
  80. </where>
  81. </sql>
  82. <sql id="Base_Column_List" >
  83. <!--
  84. WARNING - @mbg.generated
  85. -->
  86. id, user_id, username, operation, time, method, params, ip, create_time
  87. </sql>
  88. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.xmnk.springbootbase.entity.LogExample" >
  89. <!--
  90. WARNING - @mbg.generated
  91. -->
  92. select
  93. <if test="distinct" >
  94. distinct
  95. </if>
  96. 'true' as QUERYID,
  97. <include refid="Base_Column_List" />
  98. from sys_log
  99. <if test="_parameter != null" >
  100. <include refid="Example_Where_Clause" />
  101. </if>
  102. <if test="orderByClause != null" >
  103. order by ${orderByClause}
  104. </if>
  105. </select>
  106. <delete id="deleteByExample" parameterType="com.xmnk.springbootbase.entity.LogExample" >
  107. <!--
  108. WARNING - @mbg.generated
  109. -->
  110. delete from sys_log
  111. <if test="_parameter != null" >
  112. <include refid="Example_Where_Clause" />
  113. </if>
  114. </delete>
  115. <select id="countByExample" parameterType="com.xmnk.springbootbase.entity.LogExample" resultType="java.lang.Integer" >
  116. <!--
  117. WARNING - @mbg.generated
  118. -->
  119. select count(*) from sys_log
  120. <if test="_parameter != null" >
  121. <include refid="Example_Where_Clause" />
  122. </if>
  123. </select>
  124. <update id="updateByExampleSelective" parameterType="map" >
  125. <!--
  126. WARNING - @mbg.generated
  127. -->
  128. update sys_log
  129. <set >
  130. <if test="record.id != null" >
  131. id = #{record.id,jdbcType=VARCHAR},
  132. </if>
  133. <if test="record.userId != null" >
  134. user_id = #{record.userId,jdbcType=VARCHAR},
  135. </if>
  136. <if test="record.username != null" >
  137. username = #{record.username,jdbcType=VARCHAR},
  138. </if>
  139. <if test="record.operation != null" >
  140. operation = #{record.operation,jdbcType=VARCHAR},
  141. </if>
  142. <if test="record.time != null" >
  143. time = #{record.time,jdbcType=INTEGER},
  144. </if>
  145. <if test="record.method != null" >
  146. method = #{record.method,jdbcType=VARCHAR},
  147. </if>
  148. <if test="record.params != null" >
  149. params = #{record.params,jdbcType=VARCHAR},
  150. </if>
  151. <if test="record.ip != null" >
  152. ip = #{record.ip,jdbcType=VARCHAR},
  153. </if>
  154. <if test="record.createTime != null" >
  155. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  156. </if>
  157. </set>
  158. <if test="_parameter != null" >
  159. <include refid="Update_By_Example_Where_Clause" />
  160. </if>
  161. </update>
  162. <update id="updateByExample" parameterType="map" >
  163. <!--
  164. WARNING - @mbg.generated
  165. -->
  166. update sys_log
  167. set id = #{record.id,jdbcType=VARCHAR},
  168. user_id = #{record.userId,jdbcType=VARCHAR},
  169. username = #{record.username,jdbcType=VARCHAR},
  170. operation = #{record.operation,jdbcType=VARCHAR},
  171. time = #{record.time,jdbcType=INTEGER},
  172. method = #{record.method,jdbcType=VARCHAR},
  173. params = #{record.params,jdbcType=VARCHAR},
  174. ip = #{record.ip,jdbcType=VARCHAR},
  175. create_time = #{record.createTime,jdbcType=TIMESTAMP}
  176. <if test="_parameter != null" >
  177. <include refid="Update_By_Example_Where_Clause" />
  178. </if>
  179. </update>
  180. </mapper>