SysLogMapper.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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.bowintek.practice.mapper.SysLogMapper">
  4. <resultMap id="BaseResultMap" type="com.bowintek.practice.model.SysLog">
  5. <id column="LogID" jdbcType="VARCHAR" property="logID" />
  6. <result column="PageName" jdbcType="VARCHAR" property="pageName" />
  7. <result column="PageUrl" jdbcType="VARCHAR" property="pageUrl" />
  8. <result column="ActionName" jdbcType="VARCHAR" property="actionName" />
  9. <result column="UserID" jdbcType="VARCHAR" property="userID" />
  10. <result column="LogTime" jdbcType="TIMESTAMP" property="logTime" />
  11. </resultMap>
  12. <sql id="Example_Where_Clause">
  13. <where>
  14. <foreach collection="oredCriteria" item="criteria" separator="or">
  15. <if test="criteria.valid">
  16. <trim prefix="(" prefixOverrides="and" suffix=")">
  17. <foreach collection="criteria.criteria" item="criterion">
  18. <choose>
  19. <when test="criterion.noValue">
  20. and ${criterion.condition}
  21. </when>
  22. <when test="criterion.singleValue">
  23. and ${criterion.condition} #{criterion.value}
  24. </when>
  25. <when test="criterion.betweenValue">
  26. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  27. </when>
  28. <when test="criterion.listValue">
  29. and ${criterion.condition}
  30. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  31. #{listItem}
  32. </foreach>
  33. </when>
  34. </choose>
  35. </foreach>
  36. </trim>
  37. </if>
  38. </foreach>
  39. </where>
  40. </sql>
  41. <sql id="Update_By_Example_Where_Clause">
  42. <where>
  43. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  44. <if test="criteria.valid">
  45. <trim prefix="(" prefixOverrides="and" suffix=")">
  46. <foreach collection="criteria.criteria" item="criterion">
  47. <choose>
  48. <when test="criterion.noValue">
  49. and ${criterion.condition}
  50. </when>
  51. <when test="criterion.singleValue">
  52. and ${criterion.condition} #{criterion.value}
  53. </when>
  54. <when test="criterion.betweenValue">
  55. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  56. </when>
  57. <when test="criterion.listValue">
  58. and ${criterion.condition}
  59. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  60. #{listItem}
  61. </foreach>
  62. </when>
  63. </choose>
  64. </foreach>
  65. </trim>
  66. </if>
  67. </foreach>
  68. </where>
  69. </sql>
  70. <sql id="Base_Column_List">
  71. LogID, PageName, PageUrl, ActionName, UserID, LogTime
  72. </sql>
  73. <select id="selectByExample" parameterType="com.bowintek.practice.model.SysLogExample" resultMap="BaseResultMap">
  74. select
  75. <if test="distinct">
  76. distinct
  77. </if>
  78. <include refid="Base_Column_List" />
  79. from sys_log
  80. <if test="_parameter != null">
  81. <include refid="Example_Where_Clause" />
  82. </if>
  83. <if test="orderByClause != null">
  84. order by ${orderByClause}
  85. </if>
  86. </select>
  87. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  88. select
  89. <include refid="Base_Column_List" />
  90. from sys_log
  91. where LogID = #{logID,jdbcType=VARCHAR}
  92. </select>
  93. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  94. delete from sys_log
  95. where LogID = #{logID,jdbcType=VARCHAR}
  96. </delete>
  97. <delete id="deleteByExample" parameterType="com.bowintek.practice.model.SysLogExample">
  98. delete from sys_log
  99. <if test="_parameter != null">
  100. <include refid="Example_Where_Clause" />
  101. </if>
  102. </delete>
  103. <insert id="insert" parameterType="com.bowintek.practice.model.SysLog">
  104. insert into sys_log (LogID, PageName, PageUrl,
  105. ActionName, UserID, LogTime
  106. )
  107. values (#{logID,jdbcType=VARCHAR}, #{pageName,jdbcType=VARCHAR}, #{pageUrl,jdbcType=VARCHAR},
  108. #{actionName,jdbcType=VARCHAR}, #{userID,jdbcType=VARCHAR}, #{logTime,jdbcType=TIMESTAMP}
  109. )
  110. </insert>
  111. <insert id="insertSelective" parameterType="com.bowintek.practice.model.SysLog">
  112. insert into sys_log
  113. <trim prefix="(" suffix=")" suffixOverrides=",">
  114. <if test="logID != null">
  115. LogID,
  116. </if>
  117. <if test="pageName != null">
  118. PageName,
  119. </if>
  120. <if test="pageUrl != null">
  121. PageUrl,
  122. </if>
  123. <if test="actionName != null">
  124. ActionName,
  125. </if>
  126. <if test="userID != null">
  127. UserID,
  128. </if>
  129. <if test="logTime != null">
  130. LogTime,
  131. </if>
  132. </trim>
  133. <trim prefix="values (" suffix=")" suffixOverrides=",">
  134. <if test="logID != null">
  135. #{logID,jdbcType=VARCHAR},
  136. </if>
  137. <if test="pageName != null">
  138. #{pageName,jdbcType=VARCHAR},
  139. </if>
  140. <if test="pageUrl != null">
  141. #{pageUrl,jdbcType=VARCHAR},
  142. </if>
  143. <if test="actionName != null">
  144. #{actionName,jdbcType=VARCHAR},
  145. </if>
  146. <if test="userID != null">
  147. #{userID,jdbcType=VARCHAR},
  148. </if>
  149. <if test="logTime != null">
  150. #{logTime,jdbcType=TIMESTAMP},
  151. </if>
  152. </trim>
  153. </insert>
  154. <select id="countByExample" parameterType="com.bowintek.practice.model.SysLogExample" resultType="java.lang.Long">
  155. select count(*) from sys_log
  156. <if test="_parameter != null">
  157. <include refid="Example_Where_Clause" />
  158. </if>
  159. </select>
  160. <update id="updateByExampleSelective" parameterType="map">
  161. update sys_log
  162. <set>
  163. <if test="row.logID != null">
  164. LogID = #{row.logID,jdbcType=VARCHAR},
  165. </if>
  166. <if test="row.pageName != null">
  167. PageName = #{row.pageName,jdbcType=VARCHAR},
  168. </if>
  169. <if test="row.pageUrl != null">
  170. PageUrl = #{row.pageUrl,jdbcType=VARCHAR},
  171. </if>
  172. <if test="row.actionName != null">
  173. ActionName = #{row.actionName,jdbcType=VARCHAR},
  174. </if>
  175. <if test="row.userID != null">
  176. UserID = #{row.userID,jdbcType=VARCHAR},
  177. </if>
  178. <if test="row.logTime != null">
  179. LogTime = #{row.logTime,jdbcType=TIMESTAMP},
  180. </if>
  181. </set>
  182. <if test="example != null">
  183. <include refid="Update_By_Example_Where_Clause" />
  184. </if>
  185. </update>
  186. <update id="updateByExample" parameterType="map">
  187. update sys_log
  188. set LogID = #{row.logID,jdbcType=VARCHAR},
  189. PageName = #{row.pageName,jdbcType=VARCHAR},
  190. PageUrl = #{row.pageUrl,jdbcType=VARCHAR},
  191. ActionName = #{row.actionName,jdbcType=VARCHAR},
  192. UserID = #{row.userID,jdbcType=VARCHAR},
  193. LogTime = #{row.logTime,jdbcType=TIMESTAMP}
  194. <if test="example != null">
  195. <include refid="Update_By_Example_Where_Clause" />
  196. </if>
  197. </update>
  198. <update id="updateByPrimaryKeySelective" parameterType="com.bowintek.practice.model.SysLog">
  199. update sys_log
  200. <set>
  201. <if test="pageName != null">
  202. PageName = #{pageName,jdbcType=VARCHAR},
  203. </if>
  204. <if test="pageUrl != null">
  205. PageUrl = #{pageUrl,jdbcType=VARCHAR},
  206. </if>
  207. <if test="actionName != null">
  208. ActionName = #{actionName,jdbcType=VARCHAR},
  209. </if>
  210. <if test="userID != null">
  211. UserID = #{userID,jdbcType=VARCHAR},
  212. </if>
  213. <if test="logTime != null">
  214. LogTime = #{logTime,jdbcType=TIMESTAMP},
  215. </if>
  216. </set>
  217. where LogID = #{logID,jdbcType=VARCHAR}
  218. </update>
  219. <update id="updateByPrimaryKey" parameterType="com.bowintek.practice.model.SysLog">
  220. update sys_log
  221. set PageName = #{pageName,jdbcType=VARCHAR},
  222. PageUrl = #{pageUrl,jdbcType=VARCHAR},
  223. ActionName = #{actionName,jdbcType=VARCHAR},
  224. UserID = #{userID,jdbcType=VARCHAR},
  225. LogTime = #{logTime,jdbcType=TIMESTAMP}
  226. where LogID = #{logID,jdbcType=VARCHAR}
  227. </update>
  228. </mapper>