ApplyAddWorkMapper.xml 12 KB

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