RecommenderLogMapper.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  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.izouma.awesomeadmin.dao.RecommenderLogMapper" >
  4. <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.RecommenderLog" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="del_flag" property="delFlag" jdbcType="CHAR" />
  7. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  8. <result column="update_user" property="updateUser" jdbcType="VARCHAR" />
  9. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  10. <result column="create_user" property="createUser" jdbcType="VARCHAR" />
  11. <result column="user_id" property="userId" jdbcType="INTEGER" />
  12. <result column="telephone" property="telephone" jdbcType="VARCHAR" />
  13. <result column="remark" property="remark" jdbcType="VARCHAR" />
  14. </resultMap>
  15. <sql id="Base_Column_List" >
  16. <trim suffixOverrides="," >
  17. id,
  18. del_flag,
  19. update_time,
  20. update_user,
  21. create_time,
  22. create_user,
  23. user_id,
  24. telephone,
  25. remark,
  26. </trim>
  27. </sql>
  28. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  29. select
  30. <include refid="Base_Column_List" />
  31. from recommender_log
  32. where id = #{id,jdbcType=INTEGER}
  33. </select>
  34. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  35. delete from recommender_log
  36. where id = #{id,jdbcType=INTEGER}
  37. </delete>
  38. <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.RecommenderLog" useGeneratedKeys="true" keyProperty="id">
  39. insert into recommender_log
  40. <trim prefix="(" suffix=")" suffixOverrides="," >
  41. <if test="id!= null" >
  42. id,
  43. </if>
  44. <if test="delFlag!= null" >
  45. del_flag,
  46. </if>
  47. <if test="updateTime!= null" >
  48. update_time,
  49. </if>
  50. <if test="updateUser!= null" >
  51. update_user,
  52. </if>
  53. <if test="createTime!= null" >
  54. create_time,
  55. </if>
  56. <if test="createUser!= null" >
  57. create_user,
  58. </if>
  59. <if test="userId!= null" >
  60. user_id,
  61. </if>
  62. <if test="telephone!= null" >
  63. telephone,
  64. </if>
  65. <if test="remark!= null" >
  66. remark,
  67. </if>
  68. </trim>
  69. <trim prefix="values (" suffix=")" suffixOverrides="," >
  70. <if test="id != null" >
  71. #{id,jdbcType=INTEGER},
  72. </if>
  73. <if test="delFlag != null" >
  74. #{delFlag,jdbcType=CHAR},
  75. </if>
  76. <if test="updateTime != null" >
  77. #{updateTime,jdbcType=TIMESTAMP},
  78. </if>
  79. <if test="updateUser != null" >
  80. #{updateUser,jdbcType=VARCHAR},
  81. </if>
  82. <if test="createTime != null" >
  83. #{createTime,jdbcType=TIMESTAMP},
  84. </if>
  85. <if test="createUser != null" >
  86. #{createUser,jdbcType=VARCHAR},
  87. </if>
  88. <if test="userId != null" >
  89. #{userId,jdbcType=INTEGER},
  90. </if>
  91. <if test="telephone != null" >
  92. #{telephone,jdbcType=VARCHAR},
  93. </if>
  94. <if test="remark != null" >
  95. #{remark,jdbcType=VARCHAR},
  96. </if>
  97. </trim>
  98. </insert>
  99. <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.RecommenderLog" >
  100. update recommender_log
  101. <set >
  102. <if test="id != null" >
  103. id= #{id,jdbcType=INTEGER},
  104. </if>
  105. <if test="delFlag != null" >
  106. del_flag= #{delFlag,jdbcType=CHAR},
  107. </if>
  108. <if test="updateTime != null" >
  109. update_time= #{updateTime,jdbcType=TIMESTAMP},
  110. </if>
  111. <if test="updateUser != null" >
  112. update_user= #{updateUser,jdbcType=VARCHAR},
  113. </if>
  114. <if test="createTime != null" >
  115. create_time= #{createTime,jdbcType=TIMESTAMP},
  116. </if>
  117. <if test="createUser != null" >
  118. create_user= #{createUser,jdbcType=VARCHAR},
  119. </if>
  120. <if test="userId != null" >
  121. user_id= #{userId,jdbcType=INTEGER},
  122. </if>
  123. <if test="telephone != null" >
  124. telephone= #{telephone,jdbcType=VARCHAR},
  125. </if>
  126. <if test="remark != null" >
  127. remark= #{remark,jdbcType=VARCHAR},
  128. </if>
  129. </set>
  130. where
  131. <if test="id != null and !&quot;&quot;.equals(id)">
  132. id = #{id,jdbcType=INTEGER}
  133. </if>
  134. <if test="idStr != null and !&quot;&quot;.equals(idStr)">
  135. id in (${idStr})
  136. </if>
  137. </update>
  138. <select id="queryRecommenderLogByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.RecommenderLog">
  139. select <include refid="Base_Column_List"/> from recommender_log
  140. <where>
  141. and del_flag = 'N'
  142. <if test="record.idStr != null and !&quot;&quot;.equals(record.idStr)">
  143. and id in (${record.idStr})
  144. </if>
  145. <if test="record.id != null and !&quot;&quot;.equals(record.id)">
  146. and id = #{record.id}
  147. </if>
  148. <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
  149. and del_flag = #{record.delFlag}
  150. </if>
  151. <if test="record.updateTime != null and !&quot;&quot;.equals(record.updateTime)">
  152. and update_time = #{record.updateTime}
  153. </if>
  154. <if test="record.updateUser != null and !&quot;&quot;.equals(record.updateUser)">
  155. and update_user = #{record.updateUser}
  156. </if>
  157. <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
  158. and create_time = #{record.createTime}
  159. </if>
  160. <if test="record.createUser != null and !&quot;&quot;.equals(record.createUser)">
  161. and create_user = #{record.createUser}
  162. </if>
  163. <if test="record.userId != null and !&quot;&quot;.equals(record.userId)">
  164. and user_id = #{record.userId}
  165. </if>
  166. <if test="record.telephone != null and !&quot;&quot;.equals(record.telephone)">
  167. and telephone = #{record.telephone}
  168. </if>
  169. <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
  170. and remark = #{record.remark}
  171. </if>
  172. <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
  173. <trim prefix="and (" suffix=")" prefixOverrides="OR" >
  174. OR user_id LIKE concat('%',#{record.searchKey},'%')
  175. OR telephone LIKE concat('%',#{record.searchKey},'%')
  176. OR remark LIKE concat('%',#{record.searchKey},'%')
  177. </trim>
  178. </if>
  179. <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
  180. <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
  181. <choose>
  182. <when test="item.indexOf('like') != -1">
  183. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  184. <if test="detailIndex == 3">
  185. concat('%',#{itemDetail},'%')
  186. </if>
  187. <if test="detailIndex &lt; 3">
  188. ${itemDetail}
  189. </if>
  190. </foreach>
  191. </when>
  192. <otherwise>
  193. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  194. <if test="detailIndex == 3">
  195. #{itemDetail}
  196. </if>
  197. <if test="detailIndex &lt; 3">
  198. ${itemDetail}
  199. </if>
  200. </foreach>
  201. </otherwise>
  202. </choose>
  203. </foreach>
  204. </if>
  205. </where>
  206. order by
  207. <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">
  208. <trim suffixOverrides=",">
  209. <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
  210. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  211. ${itemDetail}
  212. </foreach>
  213. </foreach>
  214. </trim>
  215. ,
  216. </if>
  217. id desc
  218. </select>
  219. <select id="queryAllRecommenderLog" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.RecommenderLog">
  220. select <include refid="Base_Column_List"/> from recommender_log
  221. <where>
  222. and del_flag = 'N'
  223. <if test="idStr != null and !&quot;&quot;.equals(idStr)">
  224. and id in (${idStr})
  225. </if>
  226. <if test="id != null and !&quot;&quot;.equals(id)">
  227. and id = #{id}
  228. </if>
  229. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  230. and del_flag = #{delFlag}
  231. </if>
  232. <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
  233. and update_time = #{updateTime}
  234. </if>
  235. <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
  236. and update_user = #{updateUser}
  237. </if>
  238. <if test="createTime != null and !&quot;&quot;.equals(createTime)">
  239. and create_time = #{createTime}
  240. </if>
  241. <if test="createUser != null and !&quot;&quot;.equals(createUser)">
  242. and create_user = #{createUser}
  243. </if>
  244. <if test="userId != null and !&quot;&quot;.equals(userId)">
  245. and user_id = #{userId}
  246. </if>
  247. <if test="telephone != null and !&quot;&quot;.equals(telephone)">
  248. and telephone = #{telephone}
  249. </if>
  250. <if test="remark != null and !&quot;&quot;.equals(remark)">
  251. and remark = #{remark}
  252. </if>
  253. <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
  254. <trim prefix="and (" suffix=")" prefixOverrides="OR" >
  255. OR user_id LIKE concat('%',#{searchKey},'%')
  256. OR telephone LIKE concat('%',#{searchKey},'%')
  257. OR remark LIKE concat('%',#{searchKey},'%')
  258. </trim>
  259. </if>
  260. <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
  261. <foreach item="item" index="index" collection="advancedQuery.split('_;')">
  262. <choose>
  263. <when test="item.indexOf('like') != -1">
  264. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  265. <if test="detailIndex == 3">
  266. concat('%',#{itemDetail},'%')
  267. </if>
  268. <if test="detailIndex &lt; 3">
  269. ${itemDetail}
  270. </if>
  271. </foreach>
  272. </when>
  273. <otherwise>
  274. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  275. <if test="detailIndex == 3">
  276. #{itemDetail}
  277. </if>
  278. <if test="detailIndex &lt; 3">
  279. ${itemDetail}
  280. </if>
  281. </foreach>
  282. </otherwise>
  283. </choose>
  284. </foreach>
  285. </if>
  286. </where>
  287. order by
  288. <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">
  289. <trim suffixOverrides=",">
  290. <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
  291. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  292. ${itemDetail}
  293. </foreach>
  294. </foreach>
  295. </trim>
  296. ,
  297. </if>
  298. id desc
  299. </select>
  300. <select id="queryRecommenderLog" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.RecommenderLog">
  301. select <include refid="Base_Column_List"/> from recommender_log
  302. <where>
  303. and del_flag = 'N'
  304. <if test="id != null and !&quot;&quot;.equals(id)">
  305. and id = #{id}
  306. </if>
  307. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  308. and del_flag = #{delFlag}
  309. </if>
  310. <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
  311. and update_time = #{updateTime}
  312. </if>
  313. <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
  314. and update_user = #{updateUser}
  315. </if>
  316. <if test="createTime != null and !&quot;&quot;.equals(createTime)">
  317. and create_time = #{createTime}
  318. </if>
  319. <if test="createUser != null and !&quot;&quot;.equals(createUser)">
  320. and create_user = #{createUser}
  321. </if>
  322. <if test="userId != null and !&quot;&quot;.equals(userId)">
  323. and user_id = #{userId}
  324. </if>
  325. <if test="telephone != null and !&quot;&quot;.equals(telephone)">
  326. and telephone = #{telephone}
  327. </if>
  328. <if test="remark != null and !&quot;&quot;.equals(remark)">
  329. and remark = #{remark}
  330. </if>
  331. </where>
  332. LIMIT 1
  333. </select>
  334. <update id="delete">
  335. UPDATE recommender_log SET del_flag = 'Y'
  336. where
  337. <if test="id != null and !&quot;&quot;.equals(id)">
  338. id = #{id,jdbcType=INTEGER}
  339. </if>
  340. <if test="idStr != null and !&quot;&quot;.equals(idStr)">
  341. id in (${idStr})
  342. </if>
  343. </update>
  344. <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.RecommenderLog">
  345. select <include refid="Base_Column_List"/> from recommender_log
  346. <where>
  347. and del_flag = 'N'
  348. </where>
  349. order by id desc
  350. </select>
  351. </mapper>