TestSqlserverAaaMapper.xml 11 KB

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