1
0

TestAaaMapper.xml 20 KB

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