InsFileMapper.xml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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.ydtech.modules.ins.dao.InsFileMapper">
  4. <resultMap id="BaseResultMap" type="com.ydtech.modules.ins.model.InsFileDto">
  5. <id column="fileid" jdbcType="VARCHAR" property="fileid"/>
  6. <result column="dirid" jdbcType="VARCHAR" property="dirid"/>
  7. <result column="oldfilename" jdbcType="VARCHAR" property="oldfilename"/>
  8. <result column="newfilename" jdbcType="VARCHAR" property="newfilename"/>
  9. <result column="filepath" jdbcType="VARCHAR" property="filepath"/>
  10. <result column="url" jdbcType="VARCHAR" property="url"/>
  11. <result column="ctratetime" jdbcType="DATE" property="ctratetime"/>
  12. <result column="updatetime" jdbcType="DATE" property="updatetime"/>
  13. </resultMap>
  14. <sql id="Base_Column_List">
  15. fileid, dirid, oldfilename, newfilename, filepath, url, ctratetime, updatetime
  16. </sql>
  17. <select id="selectByExample" parameterType="com.ydtech.modules.ins.model.InsFileDto" resultMap="BaseResultMap">
  18. select
  19. <include refid="Base_Column_List"/>
  20. from ins_file
  21. WHERE 1=1
  22. <if test="fileid != null">
  23. AND fileid = #{fileidjdbcType=VARCHAR}
  24. </if>
  25. <if test="dirid != null">
  26. AND dirid = #{diridjdbcType=VARCHAR}
  27. </if>
  28. <if test="oldfilename != null">
  29. AND oldfilename = #{oldfilenamejdbcType=VARCHAR}
  30. </if>
  31. <if test="newfilename != null">
  32. AND newfilename = #{newfilenamejdbcType=VARCHAR}
  33. </if>
  34. <if test="filepath != null">
  35. AND filepath = #{filepathjdbcType=VARCHAR}
  36. </if>
  37. <if test="url != null">
  38. AND url = #{urljdbcType=VARCHAR}
  39. </if>
  40. <if test="ctratetime != null">
  41. AND ctratetime = #{ctratetimejdbcType=DATE}
  42. </if>
  43. <if test="updatetime != null">
  44. AND updatetime = #{updatetimejdbcType=DATE}
  45. </if>
  46. ORDER BY updatetime DESC
  47. </select>
  48. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  49. select
  50. <include refid="Base_Column_List"/>
  51. from ins_file
  52. where fileid = #{fileid,jdbcType=VARCHAR}
  53. </select>
  54. <select id="selectByDirId" resultType="com.ydtech.modules.ins.model.InsFileDto">
  55. select
  56. <include refid="Base_Column_List"/>
  57. from ins_file
  58. where dirid = #{dirid,jdbcType=VARCHAR}
  59. </select>
  60. <select id="selectByOldfilename" parameterType="java.lang.String" resultMap="BaseResultMap">
  61. select
  62. <include refid="Base_Column_List"/>
  63. from ins_file
  64. where oldfilename = #{fileName,jdbcType=VARCHAR}
  65. </select>
  66. <select id="selectByFileid" resultType="com.ydtech.modules.ins.model.InsFileDto">
  67. select
  68. <include refid="Base_Column_List"/>
  69. from ins_file
  70. where fileid = #{fileid,jdbcType=VARCHAR}
  71. </select>
  72. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  73. delete
  74. from ins_file
  75. where fileid = #{fileid,jdbcType=VARCHAR}
  76. </delete>
  77. <delete id="deleteByExample" parameterType="com.ydtech.modules.ins.model.InsFileDto">
  78. delete from ins_file WHERE 1=1
  79. <if test="fileid != null">
  80. AND fileid = #{fileid, jdbcType=VARCHAR}
  81. </if>
  82. <if test="dirid != null">
  83. AND dirid = #{dirid, jdbcType=VARCHAR}
  84. </if>
  85. <if test="oldfilename != null">
  86. AND oldfilename = #{oldfilename, jdbcType=VARCHAR}
  87. </if>
  88. <if test="newfilename != null">
  89. AND newfilename = #{newfilename, jdbcType=VARCHAR}
  90. </if>
  91. <if test="filepath != null">
  92. AND filepath = #{filepath, jdbcType=VARCHAR}
  93. </if>
  94. <if test="url != null">
  95. AND url = #{url, jdbcType=VARCHAR}
  96. </if>
  97. <if test="ctratetime != null">
  98. AND ctratetime = #{ctratetime, jdbcType=DATE}
  99. </if>
  100. <if test="updatetime != null">
  101. AND updatetime = #{updatetime, jdbcType=DATE}
  102. </if>
  103. </delete>
  104. <insert id="insert" parameterType="com.ydtech.modules.ins.model.InsFileDto">
  105. insert into ins_file (fileid, dirid,
  106. oldfilename, newfilename, filepath,
  107. url, ctratetime, updatetime)
  108. values (#{fileid,jdbcType=VARCHAR}, #{dirid,jdbcType=VARCHAR},
  109. #{oldfilename,jdbcType=VARCHAR}, #{newfilename,jdbcType=VARCHAR}, #{filepath,jdbcType=VARCHAR},
  110. #{url,jdbcType=VARCHAR}, #{ctratetime,jdbcType=DATE}, #{updatetime,jdbcType=DATE})
  111. </insert>
  112. <insert id="insertSelective" parameterType="com.ydtech.modules.ins.model.InsFileDto">
  113. insert into ins_file
  114. <trim prefix="(" suffix=")" suffixOverrides=",">
  115. <if test="fileid != null">
  116. fileid,
  117. </if>
  118. <if test="dirid != null">
  119. dirid,
  120. </if>
  121. <if test="oldfilename != null">
  122. oldfilename,
  123. </if>
  124. <if test="newfilename != null">
  125. newfilename,
  126. </if>
  127. <if test="filepath != null">
  128. filepath,
  129. </if>
  130. <if test="url != null">
  131. url,
  132. </if>
  133. <if test="ctratetime != null">
  134. ctratetime,
  135. </if>
  136. <if test="updatetime != null">
  137. updatetime,
  138. </if>
  139. </trim>
  140. <trim prefix="values (" suffix=")" suffixOverrides=",">
  141. <if test="fileid != null">
  142. #{fileid,jdbcType=VARCHAR},
  143. </if>
  144. <if test="dirid != null">
  145. #{dirid,jdbcType=VARCHAR},
  146. </if>
  147. <if test="oldfilename != null">
  148. #{oldfilename,jdbcType=VARCHAR},
  149. </if>
  150. <if test="newfilename != null">
  151. #{newfilename,jdbcType=VARCHAR},
  152. </if>
  153. <if test="filepath != null">
  154. #{filepath,jdbcType=VARCHAR},
  155. </if>
  156. <if test="url != null">
  157. #{url,jdbcType=VARCHAR},
  158. </if>
  159. <if test="ctratetime != null">
  160. #{ctratetime,jdbcType=DATE},
  161. </if>
  162. <if test="updatetime != null">
  163. #{updatetime,jdbcType=DATE},
  164. </if>
  165. </trim>
  166. </insert>
  167. <update id="updateByExample" parameterType="com.ydtech.modules.ins.model.InsFileDto">
  168. update ins_file
  169. <set>
  170. <if test="dirid != null">
  171. dirid = #{dirid,jdbcType=VARCHAR},
  172. </if>
  173. <if test="oldfilename != null">
  174. oldfilename = #{oldfilename,jdbcType=VARCHAR},
  175. </if>
  176. <if test="newfilename != null">
  177. newfilename = #{newfilename,jdbcType=VARCHAR},
  178. </if>
  179. <if test="filepath != null">
  180. filepath = #{filepath,jdbcType=VARCHAR},
  181. </if>
  182. <if test="url != null">
  183. url = #{url,jdbcType=VARCHAR},
  184. </if>
  185. <if test="ctratetime != null">
  186. ctratetime = #{ctratetime,jdbcType=DATE},
  187. </if>
  188. <if test="updatetime != null">
  189. updatetime = #{updatetime,jdbcType=DATE},
  190. </if>
  191. </set>
  192. where fileid = #{fileid,jdbcType=VARCHAR}
  193. </update>
  194. <update id="updateByPrimaryKey" parameterType="com.ydtech.modules.ins.model.InsFileDto">
  195. update ins_file
  196. set dirid = #{dirid,jdbcType=VARCHAR},
  197. oldfilename = #{oldfilename,jdbcType=VARCHAR},
  198. newfilename = #{newfilename,jdbcType=VARCHAR},
  199. filepath = #{filepath,jdbcType=VARCHAR},
  200. url = #{url,jdbcType=VARCHAR},
  201. ctratetime = #{ctratetime,jdbcType=DATE},
  202. updatetime = #{updatetime,jdbcType=DATE}
  203. where fileid = #{fileid,jdbcType=VARCHAR}
  204. </update>
  205. </mapper>