CfFileMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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.hz.employmentsite.mapper.CfFileMapper">
  4. <resultMap id="BaseResultMap" type="com.hz.employmentsite.model.CfFile">
  5. <id column="fileId" jdbcType="VARCHAR" property="fileId" />
  6. <result column="fileName" jdbcType="VARCHAR" property="fileName" />
  7. <result column="fileSuffix" jdbcType="VARCHAR" property="fileSuffix" />
  8. <result column="fileUrl" jdbcType="VARCHAR" property="fileUrl" />
  9. <result column="fileType" jdbcType="INTEGER" property="fileType" />
  10. <result column="fileNote" jdbcType="VARCHAR" property="fileNote" />
  11. <result column="sFileId" jdbcType="VARCHAR" property="sFileId" />
  12. <result column="userID" jdbcType="VARCHAR" property="userID" />
  13. <result column="fileRefID" jdbcType="VARCHAR" property="fileRefID" />
  14. <result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
  15. </resultMap>
  16. <sql id="Example_Where_Clause">
  17. <where>
  18. <foreach collection="oredCriteria" item="criteria" separator="or">
  19. <if test="criteria.valid">
  20. <trim prefix="(" prefixOverrides="and" suffix=")">
  21. <foreach collection="criteria.criteria" item="criterion">
  22. <choose>
  23. <when test="criterion.noValue">
  24. and ${criterion.condition}
  25. </when>
  26. <when test="criterion.singleValue">
  27. and ${criterion.condition} #{criterion.value}
  28. </when>
  29. <when test="criterion.betweenValue">
  30. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  31. </when>
  32. <when test="criterion.listValue">
  33. and ${criterion.condition}
  34. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  35. #{listItem}
  36. </foreach>
  37. </when>
  38. </choose>
  39. </foreach>
  40. </trim>
  41. </if>
  42. </foreach>
  43. </where>
  44. </sql>
  45. <sql id="Update_By_Example_Where_Clause">
  46. <where>
  47. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  48. <if test="criteria.valid">
  49. <trim prefix="(" prefixOverrides="and" suffix=")">
  50. <foreach collection="criteria.criteria" item="criterion">
  51. <choose>
  52. <when test="criterion.noValue">
  53. and ${criterion.condition}
  54. </when>
  55. <when test="criterion.singleValue">
  56. and ${criterion.condition} #{criterion.value}
  57. </when>
  58. <when test="criterion.betweenValue">
  59. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  60. </when>
  61. <when test="criterion.listValue">
  62. and ${criterion.condition}
  63. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  64. #{listItem}
  65. </foreach>
  66. </when>
  67. </choose>
  68. </foreach>
  69. </trim>
  70. </if>
  71. </foreach>
  72. </where>
  73. </sql>
  74. <sql id="Base_Column_List">
  75. fileId, fileName, fileSuffix, fileUrl, fileType, fileNote, sFileId, userID, fileRefID,
  76. createTime
  77. </sql>
  78. <select id="selectByExample" parameterType="com.hz.employmentsite.model.CfFileExample" resultMap="BaseResultMap">
  79. select
  80. <if test="distinct">
  81. distinct
  82. </if>
  83. <include refid="Base_Column_List" />
  84. from cf_file
  85. <if test="_parameter != null">
  86. <include refid="Example_Where_Clause" />
  87. </if>
  88. <if test="orderByClause != null">
  89. order by ${orderByClause}
  90. </if>
  91. </select>
  92. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  93. select
  94. <include refid="Base_Column_List" />
  95. from cf_file
  96. where fileId = #{fileId,jdbcType=VARCHAR}
  97. </select>
  98. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  99. delete from cf_file
  100. where fileId = #{fileId,jdbcType=VARCHAR}
  101. </delete>
  102. <delete id="deleteByExample" parameterType="com.hz.employmentsite.model.CfFileExample">
  103. delete from cf_file
  104. <if test="_parameter != null">
  105. <include refid="Example_Where_Clause" />
  106. </if>
  107. </delete>
  108. <insert id="insert" parameterType="com.hz.employmentsite.model.CfFile">
  109. insert into cf_file (fileId, fileName, fileSuffix,
  110. fileUrl, fileType, fileNote,
  111. sFileId, userID, fileRefID,
  112. createTime)
  113. values (#{fileId,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}, #{fileSuffix,jdbcType=VARCHAR},
  114. #{fileUrl,jdbcType=VARCHAR}, #{fileType,jdbcType=INTEGER}, #{fileNote,jdbcType=VARCHAR},
  115. #{sFileId,jdbcType=VARCHAR}, #{userID,jdbcType=VARCHAR}, #{fileRefID,jdbcType=VARCHAR},
  116. #{createTime,jdbcType=TIMESTAMP})
  117. </insert>
  118. <insert id="insertSelective" parameterType="com.hz.employmentsite.model.CfFile">
  119. insert into cf_file
  120. <trim prefix="(" suffix=")" suffixOverrides=",">
  121. <if test="fileId != null">
  122. fileId,
  123. </if>
  124. <if test="fileName != null">
  125. fileName,
  126. </if>
  127. <if test="fileSuffix != null">
  128. fileSuffix,
  129. </if>
  130. <if test="fileUrl != null">
  131. fileUrl,
  132. </if>
  133. <if test="fileType != null">
  134. fileType,
  135. </if>
  136. <if test="fileNote != null">
  137. fileNote,
  138. </if>
  139. <if test="sFileId != null">
  140. sFileId,
  141. </if>
  142. <if test="userID != null">
  143. userID,
  144. </if>
  145. <if test="fileRefID != null">
  146. fileRefID,
  147. </if>
  148. <if test="createTime != null">
  149. createTime,
  150. </if>
  151. </trim>
  152. <trim prefix="values (" suffix=")" suffixOverrides=",">
  153. <if test="fileId != null">
  154. #{fileId,jdbcType=VARCHAR},
  155. </if>
  156. <if test="fileName != null">
  157. #{fileName,jdbcType=VARCHAR},
  158. </if>
  159. <if test="fileSuffix != null">
  160. #{fileSuffix,jdbcType=VARCHAR},
  161. </if>
  162. <if test="fileUrl != null">
  163. #{fileUrl,jdbcType=VARCHAR},
  164. </if>
  165. <if test="fileType != null">
  166. #{fileType,jdbcType=INTEGER},
  167. </if>
  168. <if test="fileNote != null">
  169. #{fileNote,jdbcType=VARCHAR},
  170. </if>
  171. <if test="sFileId != null">
  172. #{sFileId,jdbcType=VARCHAR},
  173. </if>
  174. <if test="userID != null">
  175. #{userID,jdbcType=VARCHAR},
  176. </if>
  177. <if test="fileRefID != null">
  178. #{fileRefID,jdbcType=VARCHAR},
  179. </if>
  180. <if test="createTime != null">
  181. #{createTime,jdbcType=TIMESTAMP},
  182. </if>
  183. </trim>
  184. </insert>
  185. <select id="countByExample" parameterType="com.hz.employmentsite.model.CfFileExample" resultType="java.lang.Long">
  186. select count(*) from cf_file
  187. <if test="_parameter != null">
  188. <include refid="Example_Where_Clause" />
  189. </if>
  190. </select>
  191. <update id="updateByExampleSelective" parameterType="map">
  192. update cf_file
  193. <set>
  194. <if test="row.fileId != null">
  195. fileId = #{row.fileId,jdbcType=VARCHAR},
  196. </if>
  197. <if test="row.fileName != null">
  198. fileName = #{row.fileName,jdbcType=VARCHAR},
  199. </if>
  200. <if test="row.fileSuffix != null">
  201. fileSuffix = #{row.fileSuffix,jdbcType=VARCHAR},
  202. </if>
  203. <if test="row.fileUrl != null">
  204. fileUrl = #{row.fileUrl,jdbcType=VARCHAR},
  205. </if>
  206. <if test="row.fileType != null">
  207. fileType = #{row.fileType,jdbcType=INTEGER},
  208. </if>
  209. <if test="row.fileNote != null">
  210. fileNote = #{row.fileNote,jdbcType=VARCHAR},
  211. </if>
  212. <if test="row.sFileId != null">
  213. sFileId = #{row.sFileId,jdbcType=VARCHAR},
  214. </if>
  215. <if test="row.userID != null">
  216. userID = #{row.userID,jdbcType=VARCHAR},
  217. </if>
  218. <if test="row.fileRefID != null">
  219. fileRefID = #{row.fileRefID,jdbcType=VARCHAR},
  220. </if>
  221. <if test="row.createTime != null">
  222. createTime = #{row.createTime,jdbcType=TIMESTAMP},
  223. </if>
  224. </set>
  225. <if test="example != null">
  226. <include refid="Update_By_Example_Where_Clause" />
  227. </if>
  228. </update>
  229. <update id="updateByExample" parameterType="map">
  230. update cf_file
  231. set fileId = #{row.fileId,jdbcType=VARCHAR},
  232. fileName = #{row.fileName,jdbcType=VARCHAR},
  233. fileSuffix = #{row.fileSuffix,jdbcType=VARCHAR},
  234. fileUrl = #{row.fileUrl,jdbcType=VARCHAR},
  235. fileType = #{row.fileType,jdbcType=INTEGER},
  236. fileNote = #{row.fileNote,jdbcType=VARCHAR},
  237. sFileId = #{row.sFileId,jdbcType=VARCHAR},
  238. userID = #{row.userID,jdbcType=VARCHAR},
  239. fileRefID = #{row.fileRefID,jdbcType=VARCHAR},
  240. createTime = #{row.createTime,jdbcType=TIMESTAMP}
  241. <if test="example != null">
  242. <include refid="Update_By_Example_Where_Clause" />
  243. </if>
  244. </update>
  245. <update id="updateByPrimaryKeySelective" parameterType="com.hz.employmentsite.model.CfFile">
  246. update cf_file
  247. <set>
  248. <if test="fileName != null">
  249. fileName = #{fileName,jdbcType=VARCHAR},
  250. </if>
  251. <if test="fileSuffix != null">
  252. fileSuffix = #{fileSuffix,jdbcType=VARCHAR},
  253. </if>
  254. <if test="fileUrl != null">
  255. fileUrl = #{fileUrl,jdbcType=VARCHAR},
  256. </if>
  257. <if test="fileType != null">
  258. fileType = #{fileType,jdbcType=INTEGER},
  259. </if>
  260. <if test="fileNote != null">
  261. fileNote = #{fileNote,jdbcType=VARCHAR},
  262. </if>
  263. <if test="sFileId != null">
  264. sFileId = #{sFileId,jdbcType=VARCHAR},
  265. </if>
  266. <if test="userID != null">
  267. userID = #{userID,jdbcType=VARCHAR},
  268. </if>
  269. <if test="fileRefID != null">
  270. fileRefID = #{fileRefID,jdbcType=VARCHAR},
  271. </if>
  272. <if test="createTime != null">
  273. createTime = #{createTime,jdbcType=TIMESTAMP},
  274. </if>
  275. </set>
  276. where fileId = #{fileId,jdbcType=VARCHAR}
  277. </update>
  278. <update id="updateByPrimaryKey" parameterType="com.hz.employmentsite.model.CfFile">
  279. update cf_file
  280. set fileName = #{fileName,jdbcType=VARCHAR},
  281. fileSuffix = #{fileSuffix,jdbcType=VARCHAR},
  282. fileUrl = #{fileUrl,jdbcType=VARCHAR},
  283. fileType = #{fileType,jdbcType=INTEGER},
  284. fileNote = #{fileNote,jdbcType=VARCHAR},
  285. sFileId = #{sFileId,jdbcType=VARCHAR},
  286. userID = #{userID,jdbcType=VARCHAR},
  287. fileRefID = #{fileRefID,jdbcType=VARCHAR},
  288. createTime = #{createTime,jdbcType=TIMESTAMP}
  289. where fileId = #{fileId,jdbcType=VARCHAR}
  290. </update>
  291. </mapper>