WfActivityActionDefMapper.xml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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.WfActivityActionDefMapper">
  4. <resultMap id="BaseResultMap" type="com.zhyc.xps.bpm.entity.WfActivityActionDef">
  5. <result column="wf_def_id" property="wfDefId" jdbcType="BIGINT" />
  6. <result column="activity_def_id" property="activityDefId" jdbcType="BIGINT" />
  7. <result column="action_id" property="actionId" jdbcType="BIGINT" />
  8. <result column="action_title" property="actionTitle" jdbcType="VARCHAR"/>
  9. <result column="action_desc" property="actionDesc" jdbcType="VARCHAR"/>
  10. <result column="action_code" property="actionCode" jdbcType="VARCHAR"/>
  11. <result column="form_code" property="formCode" jdbcType="VARCHAR"/>
  12. <result column="target_activity_def_id" property="targetActivityDefId" jdbcType="BIGINT" />
  13. </resultMap>
  14. <resultMap id="WfInsDtoResultMap" type="com.zhyc.xps.bpm.dto.WfActivityActionDefDto" extends="BaseResultMap">
  15. <result column="target_activity_def_title" property="targetActivityDefTitle" jdbcType="VARCHAR"/>
  16. </resultMap>
  17. <sql id="Ext_Column_List">
  18. A.wf_def_id,
  19. A.activity_def_id,
  20. A.action_id,
  21. A.action_title,
  22. A.action_desc,
  23. A.action_code,
  24. A.form_code,
  25. A.target_activity_def_id,
  26. B.activity_def_title AS target_activity_def_title
  27. </sql>
  28. <!--基于ID查询-->
  29. <select id="getById" resultMap="WfInsDtoResultMap">
  30. SELECT
  31. <include refid="Ext_Column_List"/>
  32. FROM wf_activity_action_def AS A
  33. LEFT JOIN wf_activity_def AS B ON (A.wf_def_id = B.wf_def_id AND A.target_activity_def_id = B.activity_def_id)
  34. WHERE A.deleted_flag = 0
  35. <if test="wfDefId != null">
  36. AND A.wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  37. </if>
  38. <if test="activityDefId != null">
  39. AND A.activity_def_id = #{activityDefId ,jdbcType=BIGINT}
  40. </if>
  41. <if test="actionId != null">
  42. AND A.action_id = #{actionId ,jdbcType=BIGINT}
  43. </if>
  44. </select>
  45. <!--分页查询-->
  46. <select id="getByPage" parameterType="java.util.Map" resultMap="WfInsDtoResultMap">
  47. SELECT
  48. <include refid="Ext_Column_List"/>
  49. FROM wf_activity_action_def AS A
  50. LEFT JOIN wf_activity_def AS B ON (A.wf_def_id = B.wf_def_id AND A.target_activity_def_id = B.activity_def_id)
  51. WHERE A.deleted_flag = 0
  52. <if test="keywords != null and keywords != ''">
  53. AND A.action_title like "%"#{keywords}"%"
  54. </if>
  55. <if test="wfDefId != null">
  56. AND A.wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  57. </if>
  58. <if test="activityDefId != null">
  59. AND A.activity_def_id = #{activityDefId ,jdbcType=BIGINT}
  60. </if>
  61. <if test="actionId != null">
  62. AND A.action_id = #{actionId ,jdbcType=BIGINT}
  63. </if>
  64. ORDER BY A.action_id ASC
  65. </select>
  66. <!--列表查询-->
  67. <select id="getByList" resultMap="WfInsDtoResultMap" >
  68. SELECT
  69. <include refid="Ext_Column_List"/>
  70. FROM wf_activity_action_def AS A
  71. LEFT JOIN wf_activity_def AS B ON (A.wf_def_id = B.wf_def_id AND A.target_activity_def_id = B.activity_def_id)
  72. WHERE A.deleted_flag = 0
  73. <if test="wfDefId != null">
  74. AND A.wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  75. </if>
  76. <if test="activityDefId != null">
  77. AND A.activity_def_id = #{activityDefId ,jdbcType=BIGINT}
  78. </if>
  79. ORDER BY A.action_id
  80. </select>
  81. <!--新增-->
  82. <insert id="create" parameterType="com.zhyc.xps.bpm.entity.WfActivityActionDef">
  83. INSERT INTO wf_activity_action_def
  84. <trim prefix="(" suffix=")" suffixOverrides=",">
  85. <if test="wfDefId != null">
  86. wf_def_id,
  87. </if>
  88. <if test="activityDefId != null">
  89. activity_def_id,
  90. </if>
  91. <if test="actionId != null">
  92. action_id,
  93. </if>
  94. <if test="actionTitle != null and actionTitle != ''">
  95. action_title,
  96. </if>
  97. <if test="actionDesc != null and actionDesc != ''">
  98. action_desc,
  99. </if>
  100. <if test="actionCode != null and actionCode != ''">
  101. action_code,
  102. </if>
  103. <if test="formCode != null and formCode != ''">
  104. form_code,
  105. </if>
  106. <if test="targetActivityDefId != null">
  107. target_activity_def_id,
  108. </if>
  109. <if test="createdBy != null">
  110. created_by,
  111. </if>
  112. <if test="createdAt != null">
  113. created_at,
  114. </if>
  115. </trim>
  116. <trim prefix="values (" suffix=")" suffixOverrides=",">
  117. <if test="wfDefId != null and wfDefId !=''">
  118. #{wfDefId ,jdbcType=BIGINT},
  119. </if>
  120. <if test="activityDefId != null">
  121. #{activityDefId ,jdbcType=BIGINT},
  122. </if>
  123. <if test="actionId != null">
  124. #{actionId ,jdbcType=BIGINT},
  125. </if>
  126. <if test="actionTitle != null and actionTitle != ''">
  127. #{actionTitle ,jdbcType=VARCHAR},
  128. </if>
  129. <if test="actionDesc != null and actionDesc != ''">
  130. #{actionDesc ,jdbcType=VARCHAR},
  131. </if>
  132. <if test="actionCode != null and actionCode != ''">
  133. #{actionCode ,jdbcType=VARCHAR},
  134. </if>
  135. <if test="formCode != null and formCode != ''">
  136. #{formCode ,jdbcType=VARCHAR},
  137. </if>
  138. <if test="targetActivityDefId != null">
  139. #{targetActivityDefId ,jdbcType=BIGINT},
  140. </if>
  141. <if test="createdBy != null">
  142. #{createdBy ,jdbcType=BIGINT},
  143. </if>
  144. <if test="createdAt != null">
  145. #{createdAt ,jdbcType=TIMESTAMP},
  146. </if>
  147. </trim>
  148. </insert>
  149. <!--更新-->
  150. <update id="update" parameterType="com.zhyc.xps.bpm.entity.WfActivityActionDef">
  151. UPDATE wf_activity_action_def
  152. <trim suffixOverrides=",">
  153. <set>
  154. <if test="actionTitle != null and actionTitle != ''">
  155. action_title = #{actionTitle ,jdbcType=VARCHAR},
  156. </if>
  157. <if test="actionDesc != null and actionDesc != ''">
  158. action_desc = #{actionDesc ,jdbcType=VARCHAR},
  159. </if>
  160. <if test="actionCode != null and actionCode != ''">
  161. action_code = #{actionCode ,jdbcType=VARCHAR},
  162. </if>
  163. <if test="formCode != null and formCode != ''">
  164. form_code = #{formCode ,jdbcType=VARCHAR},
  165. </if>
  166. <if test="targetActivityDefId != null">
  167. target_activity_def_id = #{targetActivityDefId ,jdbcType=BIGINT},
  168. </if>
  169. </set>
  170. </trim>
  171. WHERE wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  172. <if test="activityDefId != null">
  173. AND activity_def_id = #{activityDefId ,jdbcType=BIGINT}
  174. </if>
  175. <if test="actionId != null">
  176. AND action_id = #{actionId ,jdbcType=BIGINT}
  177. </if>
  178. </update>
  179. <!--删除-->
  180. <update id="delete" parameterType="java.util.Map">
  181. UPDATE wf_activity_action_def
  182. <trim suffixOverrides=",">
  183. <set>
  184. <if test="deletedFlag != null">
  185. deleted_flag = #{deletedFlag,jdbcType=BIGINT},
  186. </if>
  187. <if test="deletedTime != null">
  188. deleted_time = #{deletedTime,jdbcType=VARCHAR},
  189. </if>
  190. <if test="deletedBy != null">
  191. deleted_by = #{deletedBy,jdbcType=BIGINT},
  192. </if>
  193. </set>
  194. </trim>
  195. WHERE wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  196. <if test="activityDefId != null">
  197. AND activity_def_id = #{activityDefId ,jdbcType=BIGINT}
  198. </if>
  199. <if test="actionId != null">
  200. AND action_id = #{actionId ,jdbcType=BIGINT}
  201. </if>
  202. </update>
  203. </mapper>