WfActivityInsMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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.zhyc.xps.bpm.mapper.WfActivityInsMapper">
  4. <resultMap id="WfActivityInsDtoResultMap" type="com.zhyc.xps.bpm.dto.WfActivityInsDto" >
  5. <result column="oc_id" property="ocId" jdbcType="BIGINT" />
  6. <result column="wf_def_id" property="wfDefId" jdbcType="BIGINT" />
  7. <result column="wf_ins_id" property="wfInsId" jdbcType="BIGINT" />
  8. <result column="activity_def_id" property="activityDefId" jdbcType="BIGINT" />
  9. <result column="activity_ins_id" property="activityInsId" jdbcType="BIGINT" />
  10. <result column="activity_ins_title" property="activityInsTitle" jdbcType="VARCHAR" />
  11. <result column="activity_code" property="activityCode" jdbcType="VARCHAR" />
  12. <result column="form_code" property="formCode" jdbcType="VARCHAR" />
  13. <result column="status" property="status" jdbcType="BIGINT" />
  14. <result column="start_time" property="startTime" jdbcType="DATE" />
  15. <result column="end_time" property="endTime" jdbcType="DATE" />
  16. <result column="group_id" property="groupId" jdbcType="BIGINT" />
  17. <result column="group_name" property="groupName" jdbcType="VARCHAR" />
  18. <result column="position_id" property="positionId" jdbcType="BIGINT" />
  19. <result column="position_name" property="positionName" jdbcType="VARCHAR" />
  20. <result column="account_id" property="accountId" jdbcType="BIGINT" />
  21. <result column="account_name" property="accountName" jdbcType="VARCHAR" />
  22. <result column="activity_ins_from" property="activityInsFrom" jdbcType="BIGINT" />
  23. <result column="activity_ins_to" property="activityInsTo" jdbcType="BIGINT" />
  24. </resultMap>
  25. <sql id="WfActivityInsDto_Cols">
  26. A.oc_id,
  27. A.wf_def_id,
  28. A.activity_def_id,
  29. A.wf_ins_id,
  30. A.activity_ins_id,
  31. A.activity_ins_title,
  32. A.activity_code,
  33. A.form_code,
  34. A.start_time,
  35. A.end_time,
  36. A.status,
  37. A.group_id,
  38. A.group_name,
  39. A.position_id,
  40. A.position_name,
  41. A.account_id,
  42. A.account_name,
  43. A.activity_ins_from,
  44. A.activity_ins_to
  45. </sql>
  46. <!--基于ID查询-->
  47. <select id="getById" resultMap="WfActivityInsDtoResultMap">
  48. SELECT
  49. <include refid="WfActivityInsDto_Cols"/>
  50. FROM wf_activity_ins AS A
  51. WHERE A.oc_id = #{ocId ,jdbcType=BIGINT} AND A.deleted_flag = 0
  52. AND A.wf_ins_id = #{wfInsId ,jdbcType=BIGINT}
  53. AND A.activity_ins_id = #{activityInsId ,jdbcType=BIGINT}
  54. </select>
  55. <!--基于ID查询当前关卡-->
  56. <select id="getCurActivityInsOfWf" resultMap="WfActivityInsDtoResultMap">
  57. SELECT
  58. <include refid="WfActivityInsDto_Cols"/>
  59. FROM wf_activity_ins AS A
  60. WHERE A.oc_id = #{ocId ,jdbcType=BIGINT} AND A.deleted_flag = 0 AND A.status = 0
  61. AND A.wf_ins_id = #{wfInsId ,jdbcType=BIGINT}
  62. </select>
  63. <!--获取上一个Activity实例-->
  64. <select id="getPreActivityInsOfWf" resultMap="WfActivityInsDtoResultMap">
  65. SELECT
  66. <include refid="WfActivityInsDto_Cols"/>
  67. FROM wf_activity_ins AS A
  68. WHERE A.deleted_flag = 0 AND A.status = 1
  69. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  70. <if test="wfInsId != null">
  71. AND A.wf_ins_id = #{wfInsId ,jdbcType=BIGINT}
  72. </if>
  73. <if test="activityDefId != null">
  74. AND A.activity_def_id = #{activityDefId ,jdbcType=BIGINT}
  75. </if>
  76. ORDER BY A.created_at DESC
  77. LIMIT 0 ,1
  78. </select>
  79. <!--分页查询-->
  80. <select id="getByPage" parameterType="java.util.Map" resultMap="WfActivityInsDtoResultMap">
  81. SELECT
  82. <include refid="WfActivityInsDto_Cols"/>
  83. FROM wf_activity_ins AS A
  84. WHERE A.deleted_flag = 0
  85. <if test="ocId != null">
  86. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  87. </if>
  88. <if test="wfDefId != null">
  89. AND A.wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  90. </if>
  91. <if test="wfInsId != null">
  92. AND A.wf_ins_id = #{wfInsId ,jdbcType=BIGINT}
  93. </if>
  94. <if test="activityDefId != null">
  95. AND A.activity_def_id = #{activityDefId ,jdbcType=BIGINT}
  96. </if>
  97. <if test="activityInsId != null">
  98. AND A.activity_ins_id = #{activityInsId ,jdbcType=BIGINT}
  99. </if>
  100. <if test="keywords != null and keywords != ''">
  101. AND A.activity_ins_title like "%"#{keywords}"%"
  102. </if>
  103. ORDER BY A.wf_ins_id DESC ,A.activity_ins_id ASC
  104. </select>
  105. <!--列表查询-->
  106. <select id="getByList" parameterType="java.util.Map" resultMap="WfActivityInsDtoResultMap">
  107. SELECT
  108. <include refid="WfActivityInsDto_Cols"/>
  109. FROM wf_activity_ins AS A
  110. WHERE A.deleted_flag = 0
  111. <if test="ocId != null">
  112. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  113. </if>
  114. <if test="wfDefId != null">
  115. AND A.wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  116. </if>
  117. <if test="activityDefId != null">
  118. AND A.activity_def_id = #{activityDefId ,jdbcType=BIGINT}
  119. </if>
  120. <if test="wfInsId != null">
  121. AND A.wf_ins_id = #{wfInsId ,jdbcType=BIGINT}
  122. </if>
  123. <if test="activityInsId != null">
  124. AND A.activity_ins_id = #{activityInsId ,jdbcType=BIGINT}
  125. </if>
  126. <if test="keywords != null and keywords != ''">
  127. AND A.activity_ins_title like "%"#{keywords}"%"
  128. </if>
  129. ORDER BY A.wf_ins_id DESC ,A.activity_ins_id ASC
  130. </select>
  131. <!--新增-->
  132. <insert id="create" parameterType="com.zhyc.xps.bpm.entity.WfActivityIns">
  133. INSERT INTO wf_activity_ins
  134. <trim prefix="(" suffix=")" suffixOverrides=",">
  135. <if test="ocId != null">
  136. oc_id,
  137. </if>
  138. <if test="wfDefId != null">
  139. wf_def_id,
  140. </if>
  141. <if test="activityDefId != null">
  142. activity_def_id,
  143. </if>
  144. <if test="wfInsId != null">
  145. wf_ins_id,
  146. </if>
  147. <if test="activityInsId != null">
  148. activity_ins_id,
  149. </if>
  150. <if test="activityInsTitle != null and activityInsTitle != ''">
  151. activity_ins_title,
  152. </if>
  153. <if test="activityCode != null and activityCode != ''">
  154. activity_code,
  155. </if>
  156. <if test="formCode != null and formCode != ''">
  157. form_code,
  158. </if>
  159. <if test="status != null">
  160. status,
  161. </if>
  162. <if test="groupId != null">
  163. group_id,
  164. </if>
  165. <if test="positionId != null">
  166. position_id,
  167. </if>
  168. <if test="accountId != null">
  169. account_id,
  170. </if>
  171. <if test="groupName!=null and groupName!=''">
  172. group_name,
  173. </if>
  174. <if test="positionName!=null and positionName!=''">
  175. position_name,
  176. </if>
  177. <if test="accountName!=null and accountName!=''">
  178. account_name,
  179. </if>
  180. <if test="startTime != null">
  181. start_time,
  182. </if>
  183. <if test="endTime != null">
  184. end_time,
  185. </if>
  186. <if test="activityInsFrom != null">
  187. activity_ins_from,
  188. </if>
  189. <if test="activityInsTo != null">
  190. activity_ins_to,
  191. </if>
  192. <if test="createdBy != null">
  193. created_by,
  194. </if>
  195. <if test="createdAt != null">
  196. created_at,
  197. </if>
  198. </trim>
  199. <trim prefix="values (" suffix=")" suffixOverrides=",">
  200. <if test="ocId != null">
  201. #{ocId ,jdbcType=BIGINT},
  202. </if>
  203. <if test="wfDefId != null">
  204. #{wfDefId ,jdbcType=BIGINT},
  205. </if>
  206. <if test="activityDefId != null">
  207. #{activityDefId ,jdbcType=BIGINT},
  208. </if>
  209. <if test="wfInsId != null">
  210. #{wfInsId ,jdbcType=BIGINT},
  211. </if>
  212. <if test="activityInsId != null">
  213. #{activityInsId ,jdbcType=BIGINT},
  214. </if>
  215. <if test="activityInsTitle != null and activityInsTitle != ''">
  216. #{activityInsTitle ,jdbcType=VARCHAR},
  217. </if>
  218. <if test="activityCode != null and activityCode != ''">
  219. #{activityCode ,jdbcType=VARCHAR},
  220. </if>
  221. <if test="formCode != null and formCode != ''">
  222. #{formCode ,jdbcType=VARCHAR},
  223. </if>
  224. <if test="status != null">
  225. #{status ,jdbcType=BIGINT},
  226. </if>
  227. <if test="groupId != null">
  228. #{groupId ,jdbcType=BIGINT},
  229. </if>
  230. <if test="positionId != null">
  231. #{positionId ,jdbcType=BIGINT},
  232. </if>
  233. <if test="accountId != null">
  234. #{accountId ,jdbcType=BIGINT},
  235. </if>
  236. <if test="groupName!=null and groupName!=''">
  237. #{groupName ,jdbcType=VARCHAR},
  238. </if>
  239. <if test="positionName!=null and positionName!=''">
  240. #{positionName ,jdbcType=VARCHAR},
  241. </if>
  242. <if test="accountName!=null and accountName!=''">
  243. #{accountName ,jdbcType=VARCHAR},
  244. </if>
  245. <if test="startTime != null">
  246. #{startTime ,jdbcType=DATE},
  247. </if>
  248. <if test="endTime != null">
  249. #{endTime ,jdbcType=DATE},
  250. </if>
  251. <if test="activityInsFrom != null">
  252. #{activityInsFrom ,jdbcType=BIGINT},
  253. </if>
  254. <if test="activityInsTo != null">
  255. #{activityInsTo ,jdbcType=BIGINT},
  256. </if>
  257. <if test="createdBy != null">
  258. #{createdBy ,jdbcType=BIGINT},
  259. </if>
  260. <if test="createdAt != null">
  261. #{createdAt ,jdbcType=DATE},
  262. </if>
  263. </trim>
  264. </insert>
  265. <!--更新-->
  266. <update id="update" parameterType="com.zhyc.xps.bpm.entity.WfActivityIns">
  267. UPDATE wf_activity_ins
  268. <trim suffixOverrides=",">
  269. <set>
  270. <if test="activityInsTitle != null and activityInsTitle != ''">
  271. activity_ins_title = #{activityTitle, jdbcType=VARCHAR},
  272. </if>
  273. <if test="formCode != null and formCode != ''">
  274. form_code = #{formCode ,jdbcType=VARCHAR},
  275. </if>
  276. <if test="status != null">
  277. status = #{status ,jdbcType=BIGINT},
  278. </if>
  279. <if test="endTime != null">
  280. end_time = #{endTime ,jdbcType=DATE},
  281. </if>
  282. <if test="groupId != null">
  283. group_id = #{groupId ,jdbcType=BIGINT},
  284. </if>
  285. <if test="positionId != null">
  286. position_id = #{positionId ,jdbcType=BIGINT},
  287. </if>
  288. <if test="accountId != null">
  289. account_id = #{accountId ,jdbcType=BIGINT},
  290. </if>
  291. <if test="groupName!=null and groupName!=''">
  292. group_name = #{groupName ,jdbcType=VARCHAR},
  293. </if>
  294. <if test="positionName!=null and positionName!=''">
  295. position_name = #{positionName ,jdbcType=VARCHAR},
  296. </if>
  297. <if test="accountName!=null and accountName!=''">
  298. account_name = #{accountName ,jdbcType=VARCHAR},
  299. </if>
  300. <if test="activityInsFrom != null">
  301. activity_ins_from = #{activityInsFrom ,jdbcType=BIGINT},
  302. </if>
  303. <if test="activityInsTo != null">
  304. activity_ins_to = #{activityInsTo ,jdbcType=BIGINT},
  305. </if>
  306. <if test="updatedBy != null ">
  307. updated_by = #{updatedBy ,jdbcType=BIGINT},
  308. </if>
  309. <if test="updatedAt != null">
  310. updated_at = #{updatedAt ,jdbcType=DATE},
  311. </if>
  312. </set>
  313. </trim>
  314. WHERE oc_id = #{ocId ,jdbcType=BIGINT}
  315. AND wf_ins_id = #{wfInsId ,jdbcType=BIGINT}
  316. AND activity_ins_id = #{activityInsId ,jdbcType=BIGINT}
  317. </update>
  318. <!--删除-->
  319. <update id="delete" parameterType="java.util.Map">
  320. UPDATE wf_activity_ins
  321. <trim suffixOverrides=",">
  322. <set>
  323. <if test="deletedFlag != null">
  324. deleted_flag = #{deletedFlag,jdbcType=BIGINT},
  325. </if>
  326. <if test="deletedTime != null">
  327. deleted_time = #{deletedTime,jdbcType=DATE},
  328. </if>
  329. <if test="deletedBy != null">
  330. deleted_by = #{deletedBy,jdbcType=BIGINT},
  331. </if>
  332. </set>
  333. </trim>
  334. WHERE oc_id = #{ocId ,jdbcType=BIGINT}
  335. <if test="wfInsId != null">
  336. AND wf_ins_id = #{wfInsId ,jdbcType=BIGINT}
  337. </if>
  338. <if test="activityInsId != null">
  339. AND activity_ins_id = #{activityInsId ,jdbcType=BIGINT}
  340. </if>
  341. </update>
  342. </mapper>