TestBbbCopyMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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.TestBbbCopyMapper" >
  4. <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TestBbbCopy" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="del_flag" property="delFlag" jdbcType="CHAR" />
  7. <result column="name_aaa" property="nameAaa" jdbcType="VARCHAR" />
  8. <result column="name_bbb" property="nameBbb" jdbcType="VARCHAR" />
  9. </resultMap>
  10. <sql id="Base_Column_List" >
  11. <trim suffixOverrides="," >
  12. id,
  13. del_flag,
  14. name_aaa,
  15. name_bbb,
  16. </trim>
  17. </sql>
  18. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  19. select
  20. <include refid="Base_Column_List" />
  21. from test_bbb_copy
  22. where id = #{id,jdbcType=INTEGER}
  23. </select>
  24. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  25. delete from test_bbb_copy
  26. where id = #{id,jdbcType=INTEGER}
  27. </delete>
  28. <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TestBbbCopy" useGeneratedKeys="true" keyProperty="id">
  29. insert into test_bbb_copy
  30. <trim prefix="(" suffix=")" suffixOverrides="," >
  31. <if test="id!= null" >
  32. id,
  33. </if>
  34. <if test="delFlag!= null" >
  35. del_flag,
  36. </if>
  37. <if test="nameAaa!= null" >
  38. name_aaa,
  39. </if>
  40. <if test="nameBbb!= null" >
  41. name_bbb,
  42. </if>
  43. </trim>
  44. <trim prefix="values (" suffix=")" suffixOverrides="," >
  45. <if test="id != null" >
  46. #{id,jdbcType=INTEGER},
  47. </if>
  48. <if test="delFlag != null" >
  49. #{delFlag,jdbcType=CHAR},
  50. </if>
  51. <if test="nameAaa != null" >
  52. #{nameAaa,jdbcType=VARCHAR},
  53. </if>
  54. <if test="nameBbb != null" >
  55. #{nameBbb,jdbcType=VARCHAR},
  56. </if>
  57. </trim>
  58. </insert>
  59. <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TestBbbCopy" >
  60. update test_bbb_copy
  61. <set >
  62. <if test="id != null" >
  63. id= #{id,jdbcType=INTEGER},
  64. </if>
  65. <if test="delFlag != null" >
  66. del_flag= #{delFlag,jdbcType=CHAR},
  67. </if>
  68. <if test="nameAaa != null" >
  69. name_aaa= #{nameAaa,jdbcType=VARCHAR},
  70. </if>
  71. <if test="nameBbb != null" >
  72. name_bbb= #{nameBbb,jdbcType=VARCHAR},
  73. </if>
  74. </set>
  75. where id = #{id,jdbcType=INTEGER}
  76. </update>
  77. <select id="queryTestBbbCopyByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbbCopy">
  78. select <include refid="Base_Column_List"/> from test_bbb_copy
  79. <where>
  80. and del_flag = 'N'
  81. <if test="record.id != null and !&quot;&quot;.equals(record.id)">
  82. and id = #{record.id}
  83. </if>
  84. <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
  85. and del_flag = #{record.delFlag}
  86. </if>
  87. <if test="record.nameAaa != null and !&quot;&quot;.equals(record.nameAaa)">
  88. and name_aaa = #{record.nameAaa}
  89. </if>
  90. <if test="record.nameBbb != null and !&quot;&quot;.equals(record.nameBbb)">
  91. and name_bbb = #{record.nameBbb}
  92. </if>
  93. <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
  94. <trim prefix="and (" suffix=")" prefixOverrides="OR" >
  95. OR del_flag LIKE concat('%',#{record.searchKey},'%')
  96. OR name_aaa LIKE concat('%',#{record.searchKey},'%')
  97. OR name_bbb LIKE concat('%',#{record.searchKey},'%')
  98. </trim>
  99. </if>
  100. <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
  101. <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
  102. <choose>
  103. <when test="item.indexOf('like') != -1">
  104. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  105. <if test="detailIndex == 3">
  106. concat('%',#{itemDetail},'%')
  107. </if>
  108. <if test="detailIndex &lt; 3">
  109. ${itemDetail}
  110. </if>
  111. </foreach>
  112. </when>
  113. <otherwise>
  114. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  115. <if test="detailIndex == 3">
  116. #{itemDetail}
  117. </if>
  118. <if test="detailIndex &lt; 3">
  119. ${itemDetail}
  120. </if>
  121. </foreach>
  122. </otherwise>
  123. </choose>
  124. </foreach>
  125. </if>
  126. </where>
  127. order by id desc
  128. </select>
  129. <select id="queryAllTestBbbCopy" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbbCopy">
  130. select <include refid="Base_Column_List"/> from test_bbb_copy
  131. <where>
  132. and del_flag = 'N'
  133. <if test="id != null and !&quot;&quot;.equals(id)">
  134. and id = #{id}
  135. </if>
  136. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  137. and del_flag = #{delFlag}
  138. </if>
  139. <if test="nameAaa != null and !&quot;&quot;.equals(nameAaa)">
  140. and name_aaa = #{nameAaa}
  141. </if>
  142. <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
  143. and name_bbb = #{nameBbb}
  144. </if>
  145. <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
  146. <trim prefix="and (" suffix=")" prefixOverrides="OR" >
  147. OR del_flag LIKE concat('%',#{searchKey},'%')
  148. OR name_aaa LIKE concat('%',#{searchKey},'%')
  149. OR name_bbb LIKE concat('%',#{searchKey},'%')
  150. </trim>
  151. </if>
  152. <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
  153. <foreach item="item" index="index" collection="advancedQuery.split('_;')">
  154. <choose>
  155. <when test="item.indexOf('like') != -1">
  156. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  157. <if test="detailIndex == 3">
  158. concat('%',#{itemDetail},'%')
  159. </if>
  160. <if test="detailIndex &lt; 3">
  161. ${itemDetail}
  162. </if>
  163. </foreach>
  164. </when>
  165. <otherwise>
  166. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  167. <if test="detailIndex == 3">
  168. #{itemDetail}
  169. </if>
  170. <if test="detailIndex &lt; 3">
  171. ${itemDetail}
  172. </if>
  173. </foreach>
  174. </otherwise>
  175. </choose>
  176. </foreach>
  177. </if>
  178. </where>
  179. order by id desc
  180. </select>
  181. <select id="queryTestBbbCopy" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbbCopy">
  182. select <include refid="Base_Column_List"/> from test_bbb_copy
  183. <where>
  184. and del_flag = 'N'
  185. <if test="id != null and !&quot;&quot;.equals(id)">
  186. and id = #{id}
  187. </if>
  188. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  189. and del_flag = #{delFlag}
  190. </if>
  191. <if test="nameAaa != null and !&quot;&quot;.equals(nameAaa)">
  192. and name_aaa = #{nameAaa}
  193. </if>
  194. <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
  195. and name_bbb = #{nameBbb}
  196. </if>
  197. </where>
  198. LIMIT 1
  199. </select>
  200. <update id="delete">
  201. UPDATE test_bbb_copy SET del_flag = 'Y'
  202. <where>
  203. AND id = #{id}
  204. </where>
  205. </update>
  206. <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbbCopy">
  207. select <include refid="Base_Column_List"/> from test_bbb_copy
  208. <where>
  209. and del_flag = 'N'
  210. </where>
  211. order by id desc
  212. </select>
  213. </mapper>