WfActivityActionInsMapper.xml 15 KB

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