JtCollectSearchMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  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.goafanti.common.dao.JtCollectSearchMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.JtCollectSearch">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Mon Sep 10 14:08:59 CST 2018.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="from_table" jdbcType="VARCHAR" property="fromTable" />
  12. <result column="row_id" jdbcType="VARCHAR" property="rowId" />
  13. <result column="title" jdbcType="VARCHAR" property="title" />
  14. <result column="keyword" jdbcType="VARCHAR" property="keyword" />
  15. <result column="summary" jdbcType="VARCHAR" property="summary" />
  16. </resultMap>
  17. <sql id="Example_Where_Clause">
  18. <!--
  19. WARNING - @mbg.generated
  20. This element is automatically generated by MyBatis Generator, do not modify.
  21. This element was generated on Mon Sep 10 14:08:59 CST 2018.
  22. -->
  23. <where>
  24. <foreach collection="oredCriteria" item="criteria" separator="or">
  25. <if test="criteria.valid">
  26. <trim prefix="(" prefixOverrides="and" suffix=")">
  27. <foreach collection="criteria.criteria" item="criterion">
  28. <choose>
  29. <when test="criterion.noValue">
  30. and ${criterion.condition}
  31. </when>
  32. <when test="criterion.singleValue">
  33. and ${criterion.condition} #{criterion.value}
  34. </when>
  35. <when test="criterion.betweenValue">
  36. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  37. </when>
  38. <when test="criterion.listValue">
  39. and ${criterion.condition}
  40. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  41. #{listItem}
  42. </foreach>
  43. </when>
  44. </choose>
  45. </foreach>
  46. </trim>
  47. </if>
  48. </foreach>
  49. </where>
  50. </sql>
  51. <sql id="Update_By_Example_Where_Clause">
  52. <!--
  53. WARNING - @mbg.generated
  54. This element is automatically generated by MyBatis Generator, do not modify.
  55. This element was generated on Mon Sep 10 14:08:59 CST 2018.
  56. -->
  57. <where>
  58. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  59. <if test="criteria.valid">
  60. <trim prefix="(" prefixOverrides="and" suffix=")">
  61. <foreach collection="criteria.criteria" item="criterion">
  62. <choose>
  63. <when test="criterion.noValue">
  64. and ${criterion.condition}
  65. </when>
  66. <when test="criterion.singleValue">
  67. and ${criterion.condition} #{criterion.value}
  68. </when>
  69. <when test="criterion.betweenValue">
  70. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  71. </when>
  72. <when test="criterion.listValue">
  73. and ${criterion.condition}
  74. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  75. #{listItem}
  76. </foreach>
  77. </when>
  78. </choose>
  79. </foreach>
  80. </trim>
  81. </if>
  82. </foreach>
  83. </where>
  84. </sql>
  85. <sql id="Base_Column_List">
  86. <!--
  87. WARNING - @mbg.generated
  88. This element is automatically generated by MyBatis Generator, do not modify.
  89. This element was generated on Mon Sep 10 14:08:59 CST 2018.
  90. -->
  91. id, from_table, row_id, title, keyword, summary
  92. </sql>
  93. <select id="selectByExample" parameterType="com.goafanti.common.model.JtCollectSearchExample" resultMap="BaseResultMap">
  94. <!--
  95. WARNING - @mbg.generated
  96. This element is automatically generated by MyBatis Generator, do not modify.
  97. This element was generated on Mon Sep 10 14:08:59 CST 2018.
  98. -->
  99. select
  100. <if test="distinct">
  101. distinct
  102. </if>
  103. <include refid="Base_Column_List" />
  104. from jt_collect_search
  105. <if test="_parameter != null">
  106. <include refid="Example_Where_Clause" />
  107. </if>
  108. <if test="orderByClause != null">
  109. order by ${orderByClause}
  110. </if>
  111. </select>
  112. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  113. <!--
  114. WARNING - @mbg.generated
  115. This element is automatically generated by MyBatis Generator, do not modify.
  116. This element was generated on Mon Sep 10 14:08:59 CST 2018.
  117. -->
  118. select
  119. <include refid="Base_Column_List" />
  120. from jt_collect_search
  121. where id = #{id,jdbcType=INTEGER}
  122. </select>
  123. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  124. <!--
  125. WARNING - @mbg.generated
  126. This element is automatically generated by MyBatis Generator, do not modify.
  127. This element was generated on Mon Sep 10 14:08:59 CST 2018.
  128. -->
  129. delete from jt_collect_search
  130. where id = #{id,jdbcType=INTEGER}
  131. </delete>
  132. <delete id="deleteByExample" parameterType="com.goafanti.common.model.JtCollectSearchExample">
  133. <!--
  134. WARNING - @mbg.generated
  135. This element is automatically generated by MyBatis Generator, do not modify.
  136. This element was generated on Mon Sep 10 14:08:59 CST 2018.
  137. -->
  138. delete from jt_collect_search
  139. <if test="_parameter != null">
  140. <include refid="Example_Where_Clause" />
  141. </if>
  142. </delete>
  143. <insert id="insert" parameterType="com.goafanti.common.model.JtCollectSearch">
  144. <!--
  145. WARNING - @mbg.generated
  146. This element is automatically generated by MyBatis Generator, do not modify.
  147. This element was generated on Mon Sep 10 14:08:59 CST 2018.
  148. -->
  149. insert into jt_collect_search (id, from_table, row_id,
  150. title, keyword)
  151. values (#{id,jdbcType=INTEGER}, #{fromTable,jdbcType=VARCHAR}, #{rowId,jdbcType=VARCHAR},
  152. #{title,jdbcType=VARCHAR}, #{keyword,jdbcType=VARCHAR})
  153. </insert>
  154. <insert id="insertSelective" parameterType="com.goafanti.common.model.JtCollectSearch">
  155. <!--
  156. WARNING - @mbg.generated
  157. This element is automatically generated by MyBatis Generator, do not modify.
  158. This element was generated on Mon Sep 10 14:08:59 CST 2018.
  159. -->
  160. insert into jt_collect_search
  161. <trim prefix="(" suffix=")" suffixOverrides=",">
  162. <if test="id != null">
  163. id,
  164. </if>
  165. <if test="fromTable != null">
  166. from_table,
  167. </if>
  168. <if test="rowId != null">
  169. row_id,
  170. </if>
  171. <if test="title != null">
  172. title,
  173. </if>
  174. <if test="keyword != null">
  175. keyword,
  176. </if>
  177. <if test="summary != null">
  178. summary,
  179. </if>
  180. </trim>
  181. <trim prefix="values (" suffix=")" suffixOverrides=",">
  182. <if test="id != null">
  183. #{id,jdbcType=INTEGER},
  184. </if>
  185. <if test="fromTable != null">
  186. #{fromTable,jdbcType=VARCHAR},
  187. </if>
  188. <if test="rowId != null">
  189. #{rowId,jdbcType=VARCHAR},
  190. </if>
  191. <if test="title != null">
  192. #{title,jdbcType=VARCHAR},
  193. </if>
  194. <if test="keyword != null">
  195. #{keyword,jdbcType=VARCHAR},
  196. </if>
  197. <if test="summary != null">
  198. #{summary,jdbcType=VARCHAR},
  199. </if>
  200. </trim>
  201. </insert>
  202. <select id="countByExample" parameterType="com.goafanti.common.model.JtCollectSearchExample" resultType="java.lang.Long">
  203. <!--
  204. WARNING - @mbg.generated
  205. This element is automatically generated by MyBatis Generator, do not modify.
  206. This element was generated on Mon Sep 10 14:08:59 CST 2018.
  207. -->
  208. select count(*) from jt_collect_search
  209. <if test="_parameter != null">
  210. <include refid="Example_Where_Clause" />
  211. </if>
  212. </select>
  213. <update id="updateByExampleSelective" parameterType="map">
  214. <!--
  215. WARNING - @mbg.generated
  216. This element is automatically generated by MyBatis Generator, do not modify.
  217. This element was generated on Mon Sep 10 14:08:59 CST 2018.
  218. -->
  219. update jt_collect_search
  220. <set>
  221. <if test="record.id != null">
  222. id = #{record.id,jdbcType=INTEGER},
  223. </if>
  224. <if test="record.fromTable != null">
  225. from_table = #{record.fromTable,jdbcType=VARCHAR},
  226. </if>
  227. <if test="record.rowId != null">
  228. row_id = #{record.rowId,jdbcType=VARCHAR},
  229. </if>
  230. <if test="record.title != null">
  231. title = #{record.title,jdbcType=VARCHAR},
  232. </if>
  233. <if test="record.keyword != null">
  234. keyword = #{record.keyword,jdbcType=VARCHAR},
  235. </if>
  236. <if test="record.summary != null">
  237. summary = #{record.summary,jdbcType=VARCHAR},
  238. </if>
  239. </set>
  240. <if test="_parameter != null">
  241. <include refid="Update_By_Example_Where_Clause" />
  242. </if>
  243. </update>
  244. <update id="updateByExample" parameterType="map">
  245. <!--
  246. WARNING - @mbg.generated
  247. This element is automatically generated by MyBatis Generator, do not modify.
  248. This element was generated on Mon Sep 10 14:08:59 CST 2018.
  249. -->
  250. update jt_collect_search
  251. set id = #{record.id,jdbcType=INTEGER},
  252. from_table = #{record.fromTable,jdbcType=VARCHAR},
  253. row_id = #{record.rowId,jdbcType=VARCHAR},
  254. title = #{record.title,jdbcType=VARCHAR},
  255. keyword = #{record.keyword,jdbcType=VARCHAR},
  256. summary = #{record.summary,jdbcType=VARCHAR}
  257. <if test="_parameter != null">
  258. <include refid="Update_By_Example_Where_Clause" />
  259. </if>
  260. </update>
  261. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.JtCollectSearch">
  262. <!--
  263. WARNING - @mbg.generated
  264. This element is automatically generated by MyBatis Generator, do not modify.
  265. This element was generated on Mon Sep 10 14:08:59 CST 2018.
  266. -->
  267. update jt_collect_search
  268. <set>
  269. <if test="fromTable != null">
  270. from_table = #{fromTable,jdbcType=VARCHAR},
  271. </if>
  272. <if test="rowId != null">
  273. row_id = #{rowId,jdbcType=VARCHAR},
  274. </if>
  275. <if test="title != null">
  276. title = #{title,jdbcType=VARCHAR},
  277. </if>
  278. <if test="keyword != null">
  279. keyword = #{keyword,jdbcType=VARCHAR},
  280. </if>
  281. <if test="summary != null">
  282. summary = #{summary,jdbcType=VARCHAR},
  283. </if>
  284. </set>
  285. where id = #{id,jdbcType=INTEGER}
  286. </update>
  287. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.JtCollectSearch">
  288. <!--
  289. WARNING - @mbg.generated
  290. This element is automatically generated by MyBatis Generator, do not modify.
  291. This element was generated on Mon Sep 10 14:08:59 CST 2018.
  292. -->
  293. update jt_collect_search
  294. set from_table = #{fromTable,jdbcType=VARCHAR},
  295. row_id = #{rowId,jdbcType=VARCHAR},
  296. title = #{title,jdbcType=VARCHAR},
  297. keyword = #{keyword,jdbcType=VARCHAR},
  298. summary = #{summary,jdbcType=VARCHAR}
  299. where id = #{id,jdbcType=INTEGER}
  300. </update>
  301. <delete id="deleteByrowId" parameterType="java.lang.String">
  302. delete from jt_collect_search
  303. where row_id = #{id,jdbcType=VARCHAR}
  304. </delete>
  305. <select id="globalSearchList" parameterType="String" resultType="com.goafanti.common.model.JtCollectSearch">
  306. select id,from_table as fromTable,row_id as rowId,title,keyword,summary from jt_collect_search
  307. where 1=1
  308. <if test="name !=null">
  309. and title like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  310. </if>
  311. <if test="AchievementDemand == 1">
  312. and from_table in ('achievement','demand')
  313. </if>
  314. union
  315. select id,from_table,row_id,title,keyword,summary from jt_collect_search
  316. where 1=1
  317. <if test="name !=null">
  318. and keyword like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  319. </if>
  320. <if test="AchievementDemand == 1">
  321. and from_table in ('achievement','demand')
  322. </if>
  323. order by id desc
  324. <if test="page_sql!=null">
  325. ${page_sql}
  326. </if>
  327. </select>
  328. <select id="globalSearchCount" parameterType="String" resultType="java.lang.Integer">
  329. select count(*) from ( select id,from_table,row_id,title,keyword from jt_collect_search
  330. where 1=1
  331. <if test="name !=null">
  332. and title like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  333. </if>
  334. <if test="AchievementDemand == 1">
  335. and from_table in ('achievement','demand')
  336. </if>
  337. union
  338. select id,from_table,row_id,title,keyword from jt_collect_search
  339. where 1=1
  340. <if test="name !=null">
  341. and keyword like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  342. </if>
  343. <if test="AchievementDemand == 1">
  344. and from_table in ('achievement','demand')
  345. </if>
  346. ) a
  347. </select>
  348. <update id="updateByRowIdSelective" parameterType="com.goafanti.common.model.JtCollectSearch">
  349. update jt_collect_search
  350. <set>
  351. <if test="fromTable != null">
  352. from_table = #{fromTable,jdbcType=VARCHAR},
  353. </if>
  354. <if test="title != null">
  355. title = #{title,jdbcType=VARCHAR},
  356. </if>
  357. <if test="keyword != null">
  358. keyword = #{keyword,jdbcType=VARCHAR},
  359. </if>
  360. <if test="summary != null">
  361. summary = #{summary,jdbcType=VARCHAR},
  362. </if>
  363. </set>
  364. where row_id = #{rowId,jdbcType=VARCHAR}
  365. </update>
  366. </mapper>