ParkWaitReadMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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.idea.workPanel.mapper.ParkWaitReadMapper">
  4. <resultMap id="BaseResultMap" type="com.idea.workPanel.model.ParkWaitRead">
  5. <id column="id" jdbcType="VARCHAR" property="id" />
  6. <result column="read_type" jdbcType="INTEGER" property="readType" />
  7. <result column="title" jdbcType="VARCHAR" property="title" />
  8. <result column="src_user_id" jdbcType="VARCHAR" property="srcUserId" />
  9. <result column="src_user_type" jdbcType="INTEGER" property="srcUserType" />
  10. <result column="src_user_name" jdbcType="VARCHAR" property="srcUserName" />
  11. <result column="receive_user_id" jdbcType="VARCHAR" property="receiveUserId" />
  12. <result column="route_url" jdbcType="VARCHAR" property="routeUrl" />
  13. <result column="route_param" jdbcType="VARCHAR" property="routeParam" />
  14. <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
  15. <result column="create_by" jdbcType="VARCHAR" property="createBy" />
  16. </resultMap>
  17. <sql id="Example_Where_Clause">
  18. <where>
  19. <foreach collection="oredCriteria" item="criteria" separator="or">
  20. <if test="criteria.valid">
  21. <trim prefix="(" prefixOverrides="and" suffix=")">
  22. <foreach collection="criteria.criteria" item="criterion">
  23. <choose>
  24. <when test="criterion.noValue">
  25. and ${criterion.condition}
  26. </when>
  27. <when test="criterion.singleValue">
  28. and ${criterion.condition} #{criterion.value}
  29. </when>
  30. <when test="criterion.betweenValue">
  31. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  32. </when>
  33. <when test="criterion.listValue">
  34. and ${criterion.condition}
  35. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  36. #{listItem}
  37. </foreach>
  38. </when>
  39. </choose>
  40. </foreach>
  41. </trim>
  42. </if>
  43. </foreach>
  44. </where>
  45. </sql>
  46. <sql id="Update_By_Example_Where_Clause">
  47. <where>
  48. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  49. <if test="criteria.valid">
  50. <trim prefix="(" prefixOverrides="and" suffix=")">
  51. <foreach collection="criteria.criteria" item="criterion">
  52. <choose>
  53. <when test="criterion.noValue">
  54. and ${criterion.condition}
  55. </when>
  56. <when test="criterion.singleValue">
  57. and ${criterion.condition} #{criterion.value}
  58. </when>
  59. <when test="criterion.betweenValue">
  60. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  61. </when>
  62. <when test="criterion.listValue">
  63. and ${criterion.condition}
  64. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  65. #{listItem}
  66. </foreach>
  67. </when>
  68. </choose>
  69. </foreach>
  70. </trim>
  71. </if>
  72. </foreach>
  73. </where>
  74. </sql>
  75. <sql id="Base_Column_List">
  76. id, read_type, title, src_user_id, src_user_type, src_user_name, receive_user_id,
  77. route_url, route_param, created_at, create_by
  78. </sql>
  79. <select id="selectByExample" parameterType="com.idea.workPanel.model.ParkWaitReadExample" resultMap="BaseResultMap">
  80. select
  81. <if test="distinct">
  82. distinct
  83. </if>
  84. <include refid="Base_Column_List" />
  85. from park_wait_read
  86. <if test="_parameter != null">
  87. <include refid="Example_Where_Clause" />
  88. </if>
  89. <if test="orderByClause != null">
  90. order by ${orderByClause}
  91. </if>
  92. </select>
  93. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  94. select
  95. <include refid="Base_Column_List" />
  96. from park_wait_read
  97. where id = #{id,jdbcType=VARCHAR}
  98. </select>
  99. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  100. delete from park_wait_read
  101. where id = #{id,jdbcType=VARCHAR}
  102. </delete>
  103. <delete id="deleteByExample" parameterType="com.idea.workPanel.model.ParkWaitReadExample">
  104. delete from park_wait_read
  105. <if test="_parameter != null">
  106. <include refid="Example_Where_Clause" />
  107. </if>
  108. </delete>
  109. <insert id="insert" parameterType="com.idea.workPanel.model.ParkWaitRead">
  110. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.String">
  111. SELECT LAST_INSERT_ID()
  112. </selectKey>
  113. insert into park_wait_read (id, read_type, title, src_user_id,
  114. src_user_type, src_user_name, receive_user_id,
  115. route_url, route_param, created_at,
  116. create_by)
  117. values (#{id,jdbcType=INTEGER}, #{readType,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{srcUserId,jdbcType=VARCHAR},
  118. #{srcUserType,jdbcType=INTEGER}, #{srcUserName,jdbcType=VARCHAR}, #{receiveUserId,jdbcType=VARCHAR},
  119. #{routeUrl,jdbcType=VARCHAR}, #{routeParam,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP},
  120. #{createBy,jdbcType=VARCHAR})
  121. </insert>
  122. <insert id="insertSelective" parameterType="com.idea.workPanel.model.ParkWaitRead">
  123. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.String">
  124. SELECT LAST_INSERT_ID()
  125. </selectKey>
  126. insert into park_wait_read
  127. <trim prefix="(" suffix=")" suffixOverrides=",">
  128. <if test="id != null">
  129. id,
  130. </if>
  131. <if test="readType != null">
  132. read_type,
  133. </if>
  134. <if test="title != null">
  135. title,
  136. </if>
  137. <if test="srcUserId != null">
  138. src_user_id,
  139. </if>
  140. <if test="srcUserType != null">
  141. src_user_type,
  142. </if>
  143. <if test="srcUserName != null">
  144. src_user_name,
  145. </if>
  146. <if test="receiveUserId != null">
  147. receive_user_id,
  148. </if>
  149. <if test="routeUrl != null">
  150. route_url,
  151. </if>
  152. <if test="routeParam != null">
  153. route_param,
  154. </if>
  155. <if test="createdAt != null">
  156. created_at,
  157. </if>
  158. <if test="createBy != null">
  159. create_by,
  160. </if>
  161. </trim>
  162. <trim prefix="values (" suffix=")" suffixOverrides=",">
  163. <if test="id != null">
  164. #{id,jdbcType=INTEGER},
  165. </if>
  166. <if test="readType != null">
  167. #{readType,jdbcType=INTEGER},
  168. </if>
  169. <if test="title != null">
  170. #{title,jdbcType=VARCHAR},
  171. </if>
  172. <if test="srcUserId != null">
  173. #{srcUserId,jdbcType=VARCHAR},
  174. </if>
  175. <if test="srcUserType != null">
  176. #{srcUserType,jdbcType=INTEGER},
  177. </if>
  178. <if test="srcUserName != null">
  179. #{srcUserName,jdbcType=VARCHAR},
  180. </if>
  181. <if test="receiveUserId != null">
  182. #{receiveUserId,jdbcType=VARCHAR},
  183. </if>
  184. <if test="routeUrl != null">
  185. #{routeUrl,jdbcType=VARCHAR},
  186. </if>
  187. <if test="routeParam != null">
  188. #{routeParam,jdbcType=VARCHAR},
  189. </if>
  190. <if test="createdAt != null">
  191. #{createdAt,jdbcType=TIMESTAMP},
  192. </if>
  193. <if test="createBy != null">
  194. #{createBy,jdbcType=VARCHAR},
  195. </if>
  196. </trim>
  197. </insert>
  198. <select id="countByExample" parameterType="com.idea.workPanel.model.ParkWaitReadExample" resultType="java.lang.Long">
  199. select count(*) from park_wait_read
  200. <if test="_parameter != null">
  201. <include refid="Example_Where_Clause" />
  202. </if>
  203. </select>
  204. <update id="updateByExampleSelective" parameterType="map">
  205. update park_wait_read
  206. <set>
  207. <if test="record.id != null">
  208. id = #{record.id,jdbcType=VARCHAR},
  209. </if>
  210. <if test="record.readType != null">
  211. read_type = #{record.readType,jdbcType=INTEGER},
  212. </if>
  213. <if test="record.title != null">
  214. title = #{record.title,jdbcType=VARCHAR},
  215. </if>
  216. <if test="record.srcUserId != null">
  217. src_user_id = #{record.srcUserId,jdbcType=VARCHAR},
  218. </if>
  219. <if test="record.srcUserType != null">
  220. src_user_type = #{record.srcUserType,jdbcType=INTEGER},
  221. </if>
  222. <if test="record.srcUserName != null">
  223. src_user_name = #{record.srcUserName,jdbcType=VARCHAR},
  224. </if>
  225. <if test="record.receiveUserId != null">
  226. receive_user_id = #{record.receiveUserId,jdbcType=VARCHAR},
  227. </if>
  228. <if test="record.routeUrl != null">
  229. route_url = #{record.routeUrl,jdbcType=VARCHAR},
  230. </if>
  231. <if test="record.routeParam != null">
  232. route_param = #{record.routeParam,jdbcType=VARCHAR},
  233. </if>
  234. <if test="record.createdAt != null">
  235. created_at = #{record.createdAt,jdbcType=TIMESTAMP},
  236. </if>
  237. <if test="record.createBy != null">
  238. create_by = #{record.createBy,jdbcType=VARCHAR},
  239. </if>
  240. </set>
  241. <if test="_parameter != null">
  242. <include refid="Update_By_Example_Where_Clause" />
  243. </if>
  244. </update>
  245. <update id="updateByExample" parameterType="map">
  246. update park_wait_read
  247. set id = #{record.id,jdbcType=VARCHAR},
  248. read_type = #{record.readType,jdbcType=INTEGER},
  249. title = #{record.title,jdbcType=VARCHAR},
  250. src_user_id = #{record.srcUserId,jdbcType=VARCHAR},
  251. src_user_type = #{record.srcUserType,jdbcType=INTEGER},
  252. src_user_name = #{record.srcUserName,jdbcType=VARCHAR},
  253. receive_user_id = #{record.receiveUserId,jdbcType=VARCHAR},
  254. route_url = #{record.routeUrl,jdbcType=VARCHAR},
  255. route_param = #{record.routeParam,jdbcType=VARCHAR},
  256. created_at = #{record.createdAt,jdbcType=TIMESTAMP},
  257. create_by = #{record.createBy,jdbcType=VARCHAR}
  258. <if test="_parameter != null">
  259. <include refid="Update_By_Example_Where_Clause" />
  260. </if>
  261. </update>
  262. <update id="updateByPrimaryKeySelective" parameterType="com.idea.workPanel.model.ParkWaitRead">
  263. update park_wait_read
  264. <set>
  265. <if test="readType != null">
  266. read_type = #{readType,jdbcType=INTEGER},
  267. </if>
  268. <if test="title != null">
  269. title = #{title,jdbcType=VARCHAR},
  270. </if>
  271. <if test="srcUserId != null">
  272. src_user_id = #{srcUserId,jdbcType=VARCHAR},
  273. </if>
  274. <if test="srcUserType != null">
  275. src_user_type = #{srcUserType,jdbcType=INTEGER},
  276. </if>
  277. <if test="srcUserName != null">
  278. src_user_name = #{srcUserName,jdbcType=VARCHAR},
  279. </if>
  280. <if test="receiveUserId != null">
  281. receive_user_id = #{receiveUserId,jdbcType=VARCHAR},
  282. </if>
  283. <if test="routeUrl != null">
  284. route_url = #{routeUrl,jdbcType=VARCHAR},
  285. </if>
  286. <if test="routeParam != null">
  287. route_param = #{routeParam,jdbcType=VARCHAR},
  288. </if>
  289. <if test="createdAt != null">
  290. created_at = #{createdAt,jdbcType=TIMESTAMP},
  291. </if>
  292. <if test="createBy != null">
  293. create_by = #{createBy,jdbcType=VARCHAR},
  294. </if>
  295. </set>
  296. where id = #{id,jdbcType=VARCHAR}
  297. </update>
  298. <update id="updateByPrimaryKey" parameterType="com.idea.workPanel.model.ParkWaitRead">
  299. update park_wait_read
  300. set read_type = #{readType,jdbcType=INTEGER},
  301. title = #{title,jdbcType=VARCHAR},
  302. src_user_id = #{srcUserId,jdbcType=VARCHAR},
  303. src_user_type = #{srcUserType,jdbcType=INTEGER},
  304. src_user_name = #{srcUserName,jdbcType=VARCHAR},
  305. receive_user_id = #{receiveUserId,jdbcType=VARCHAR},
  306. route_url = #{routeUrl,jdbcType=VARCHAR},
  307. route_param = #{routeParam,jdbcType=VARCHAR},
  308. created_at = #{createdAt,jdbcType=TIMESTAMP},
  309. create_by = #{createBy,jdbcType=VARCHAR}
  310. where id = #{id,jdbcType=VARCHAR}
  311. </update>
  312. </mapper>