GenCodeMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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.GenCodeMapper">
  4. <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.GenCode">
  5. <id column="id" property="id" jdbcType="INTEGER"/>
  6. <result column="tableName" property="tableName" jdbcType="VARCHAR"/>
  7. <result column="className" property="className" jdbcType="VARCHAR"/>
  8. <result column="remark" property="remark" jdbcType="VARCHAR"/>
  9. <result column="genTable" property="genTable" jdbcType="BIT"/>
  10. <result column="genClass" property="genClass" jdbcType="BIT"/>
  11. <result column="genList" property="genList" jdbcType="BIT"/>
  12. <result column="genForm" property="genForm" jdbcType="BIT"/>
  13. <result column="field_id" property="fieldId" jdbcType="VARCHAR"/>
  14. <result column="gen_json" property="genJson" jdbcType="VARCHAR"/>
  15. <result column="del_flag" property="delFlag" jdbcType="VARCHAR"/>
  16. <result column="type_flag" property="typeFlag" jdbcType="VARCHAR"/>
  17. </resultMap>
  18. <sql id="Base_Column_List">
  19. id, tableName, className, remark, genTable, genClass,
  20. genList, genForm, field_id, gen_json, del_flag, type_flag
  21. </sql>
  22. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
  23. select
  24. <include refid="Base_Column_List"/>
  25. from sys_gen_code
  26. where id = #{id,jdbcType=INTEGER}
  27. </select>
  28. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  29. delete from sys_gen_code
  30. where id = #{id,jdbcType=INTEGER}
  31. </delete>
  32. <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.GenCode" useGeneratedKeys="true"
  33. keyProperty="id">
  34. insert into sys_gen_code
  35. <trim prefix="(" suffix=")" suffixOverrides=",">
  36. <if test="id != null">
  37. id,
  38. </if>
  39. <if test="tableName != null">
  40. tableName,
  41. </if>
  42. <if test="className != null">
  43. className,
  44. </if>
  45. <if test="remark != null">
  46. remark,
  47. </if>
  48. <if test="genTable != null">
  49. genTable,
  50. </if>
  51. <if test="genClass != null">
  52. genClass,
  53. </if>
  54. <if test="genList != null">
  55. genList,
  56. </if>
  57. <if test="genForm != null">
  58. genForm,
  59. </if>
  60. <if test="fieldId != null">
  61. field_id,
  62. </if>
  63. <if test="genJson != null">
  64. gen_json,
  65. </if>
  66. <if test="typeFlag != null">
  67. type_flag,
  68. </if>
  69. </trim>
  70. <trim prefix="values (" suffix=")" suffixOverrides=",">
  71. <if test="id != null">
  72. #{id,jdbcType=INTEGER},
  73. </if>
  74. <if test="tableName != null">
  75. #{tableName,jdbcType=VARCHAR},
  76. </if>
  77. <if test="className != null">
  78. #{className,jdbcType=VARCHAR},
  79. </if>
  80. <if test="remark != null">
  81. #{remark,jdbcType=VARCHAR},
  82. </if>
  83. <if test="genTable != null">
  84. #{genTable,jdbcType=BIT},
  85. </if>
  86. <if test="genClass != null">
  87. #{genClass,jdbcType=BIT},
  88. </if>
  89. <if test="genList != null">
  90. #{genList,jdbcType=BIT},
  91. </if>
  92. <if test="genForm != null">
  93. #{genForm,jdbcType=BIT},
  94. </if>
  95. <if test="fieldId != null">
  96. #{fieldId,jdbcType=VARCHAR},
  97. </if>
  98. <if test="genJson != null">
  99. #{genJson,jdbcType=VARCHAR},
  100. </if>
  101. <if test="typeFlag != null">
  102. #{typeFlag,jdbcType=VARCHAR},
  103. </if>
  104. </trim>
  105. </insert>
  106. <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.GenCode">
  107. update sys_gen_code
  108. <set>
  109. <if test="tableName != null">
  110. tableName = #{tableName,jdbcType=VARCHAR},
  111. </if>
  112. <if test="className != null">
  113. className = #{className,jdbcType=VARCHAR},
  114. </if>
  115. <if test="remark != null">
  116. remark = #{remark,jdbcType=VARCHAR},
  117. </if>
  118. <if test="genTable != null">
  119. genTable = #{genTable,jdbcType=BIT},
  120. </if>
  121. <if test="genClass != null">
  122. genClass = #{genClass,jdbcType=BIT},
  123. </if>
  124. <if test="genList != null">
  125. genList = #{genList,jdbcType=BIT},
  126. </if>
  127. <if test="genForm != null">
  128. genForm = #{genForm,jdbcType=BIT},
  129. </if>
  130. <if test="fieldId != null">
  131. field_id = #{fieldId,jdbcType=VARCHAR},
  132. </if>
  133. <if test="genJson != null">
  134. gen_json = #{genJson,jdbcType=VARCHAR},
  135. </if>
  136. <if test="typeFlag != null">
  137. type_flag = #{typeFlag,jdbcType=VARCHAR},
  138. </if>
  139. </set>
  140. where id = #{id,jdbcType=INTEGER}
  141. </update>
  142. <select id="queryGenCodeByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenCode">
  143. select
  144. <include refid="Base_Column_List"/>
  145. from sys_gen_code
  146. <where>
  147. and del_flag = 'N'
  148. <if test="record.id != null and !&quot;&quot;.equals(record.id)">
  149. and id = #{record.id}
  150. </if>
  151. <if test="record.tableName != null and !&quot;&quot;.equals(record.tableName)">
  152. and tableName = #{record.tableName}
  153. </if>
  154. <if test="record.className != null and !&quot;&quot;.equals(record.className)">
  155. and className = #{record.className}
  156. </if>
  157. <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
  158. and remark = #{record.remark}
  159. </if>
  160. <if test="record.genTable != null and !&quot;&quot;.equals(record.genTable)">
  161. and genTable = #{record.genTable}
  162. </if>
  163. <if test="record.genClass != null and !&quot;&quot;.equals(record.genClass)">
  164. and genClass = #{record.genClass}
  165. </if>
  166. <if test="record.genList != null and !&quot;&quot;.equals(record.genList)">
  167. and genList = #{record.genList}
  168. </if>
  169. <if test="record.genForm != null and !&quot;&quot;.equals(record.genForm)">
  170. and genForm = #{record.genForm}
  171. </if>
  172. <if test="record.fieldId != null and !&quot;&quot;.equals(record.fieldId)">
  173. and field_id = #{record.fieldId}
  174. </if>
  175. <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
  176. <trim prefix="and (" suffix=")" prefixOverrides="OR">
  177. OR tableName LIKE concat('%',#{record.searchKey},'%')
  178. OR className LIKE concat('%',#{record.searchKey},'%')
  179. OR remark LIKE concat('%',#{record.searchKey},'%')
  180. OR type_flag LIKE concat('%',#{record.searchKey},'%')
  181. </trim>
  182. </if>
  183. </where>
  184. order by id desc
  185. </select>
  186. <select id="queryAllGenCode" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenCode">
  187. select
  188. <include refid="Base_Column_List"/>
  189. from sys_gen_code
  190. <where>
  191. and del_flag = 'N'
  192. <if test="id != null and !&quot;&quot;.equals(id)">
  193. and id = #{id}
  194. </if>
  195. <if test="tableName != null and !&quot;&quot;.equals(tableName)">
  196. and tableName = #{tableName}
  197. </if>
  198. <if test="className != null and !&quot;&quot;.equals(className)">
  199. and className = #{className}
  200. </if>
  201. <if test="remark != null and !&quot;&quot;.equals(remark)">
  202. and remark = #{remark}
  203. </if>
  204. <if test="genTable != null and !&quot;&quot;.equals(genTable)">
  205. and genTable = #{genTable}
  206. </if>
  207. <if test="genClass != null and !&quot;&quot;.equals(genClass)">
  208. and genClass = #{genClass}
  209. </if>
  210. <if test="genList != null and !&quot;&quot;.equals(genList)">
  211. and genList = #{genList}
  212. </if>
  213. <if test="genForm != null and !&quot;&quot;.equals(genForm)">
  214. and genForm = #{genForm}
  215. </if>
  216. <if test="fieldId != null and !&quot;&quot;.equals(fieldId)">
  217. and field_id = #{fieldId}
  218. </if>
  219. </where>
  220. order by id desc
  221. </select>
  222. <select id="queryGenCode" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenCode">
  223. select
  224. <include refid="Base_Column_List"/>
  225. from sys_gen_code
  226. <where>
  227. and del_flag = 'N'
  228. <if test="id != null and !&quot;&quot;.equals(id)">
  229. and id = #{id}
  230. </if>
  231. <if test="tableName != null and !&quot;&quot;.equals(tableName)">
  232. and tableName = #{tableName}
  233. </if>
  234. <if test="className != null and !&quot;&quot;.equals(className)">
  235. and className = #{className}
  236. </if>
  237. <if test="remark != null and !&quot;&quot;.equals(remark)">
  238. and remark = #{remark}
  239. </if>
  240. <if test="genTable != null and !&quot;&quot;.equals(genTable)">
  241. and genTable = #{genTable}
  242. </if>
  243. <if test="genClass != null and !&quot;&quot;.equals(genClass)">
  244. and genClass = #{genClass}
  245. </if>
  246. <if test="genList != null and !&quot;&quot;.equals(genList)">
  247. and genList = #{genList}
  248. </if>
  249. <if test="genForm != null and !&quot;&quot;.equals(genForm)">
  250. and genForm = #{genForm}
  251. </if>
  252. <if test="fieldId != null and !&quot;&quot;.equals(fieldId)">
  253. and field_id = #{fieldId}
  254. </if>
  255. </where>
  256. LIMIT 1
  257. </select>
  258. <update id="delete">
  259. UPDATE sys_gen_code SET del_flag = 'Y'
  260. <where>
  261. AND id = #{id}
  262. </where>
  263. </update>
  264. </mapper>