WfActivityDefMapper.xml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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.WfActivityDefMapper">
  4. <resultMap id="WfActivityDefDtoResultMap" type="com.zhyc.xps.bpm.dto.WfActivityDefDto">
  5. <result column="wf_def_id" property="wfDefId" jdbcType="BIGINT" />
  6. <result column="activity_def_id" property="activityDefId" jdbcType="BIGINT" />
  7. <result column="activity_def_title" property="activityDefTitle" jdbcType="VARCHAR" />
  8. <result column="activity_def_desc" property="activityDefDesc" jdbcType="VARCHAR" />
  9. <result column="activity_code" property="activityCode" jdbcType="VARCHAR" />
  10. <result column="form_code" property="formCode" jdbcType="VARCHAR" />
  11. </resultMap>
  12. <sql id="WfActivityDefDto_Column_List">
  13. wf_def_id ,
  14. activity_def_id,
  15. activity_def_title,
  16. activity_def_desc,
  17. activity_code,
  18. form_code
  19. </sql>
  20. <!--基于ID查询-->
  21. <select id="getById" resultMap="WfActivityDefDtoResultMap">
  22. SELECT
  23. <include refid="WfActivityDefDto_Column_List"/>
  24. FROM wf_activity_def
  25. WHERE deleted_flag = 0
  26. <if test="wfDefId != null">
  27. AND wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  28. </if>
  29. <if test="activityDefId != null">
  30. AND activity_def_id = #{activityDefId ,jdbcType=BIGINT}
  31. </if>
  32. </select>
  33. <!--分页查询-->
  34. <select id="getByPage" parameterType="java.util.Map" resultMap="WfActivityDefDtoResultMap">
  35. SELECT
  36. <include refid="WfActivityDefDto_Column_List"/>
  37. FROM wf_activity_def
  38. WHERE deleted_flag = 0
  39. <if test="wfDefId != null">
  40. AND wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  41. </if>
  42. <if test="activityDefId != null">
  43. AND activity_def_id = #{activityDefId ,jdbcType=BIGINT}
  44. </if>
  45. <if test="keywords != null and keywords != ''">
  46. AND activity_def_title like "%"#{keywords}"%"
  47. </if>
  48. ORDER BY activity_def_id ASC
  49. </select>
  50. <!--列表查询-->
  51. <select id="getByList" parameterType="java.util.Map" resultMap="WfActivityDefDtoResultMap">
  52. SELECT
  53. <include refid="WfActivityDefDto_Column_List"/>
  54. FROM wf_activity_def
  55. WHERE deleted_flag = 0
  56. <if test="wfDefId != null">
  57. AND wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  58. </if>
  59. <if test="activityDefId != null">
  60. AND activity_def_id = #{activityDefId ,jdbcType=BIGINT}
  61. </if>
  62. <if test="keywords != null and keywords != ''">
  63. AND activity_def_title like "%"#{keywords}"%"
  64. </if>
  65. </select>
  66. <insert id="create" parameterType="com.zhyc.xps.bpm.entity.WfActivityDef">
  67. INSERT INTO wf_activity_def
  68. <trim prefix="(" suffix=")" suffixOverrides=",">
  69. <if test="wfDefId != null">
  70. wf_def_id,
  71. </if>
  72. <if test="activityDefId != null">
  73. activity_def_id,
  74. </if>
  75. <if test="activityDefTitle != null and activityDefTitle != ''">
  76. activity_def_title,
  77. </if>
  78. <if test="activityDefDesc != null and activityDefDesc != ''">
  79. activity_def_desc,
  80. </if>
  81. <if test="activityCode != null and activityCode != ''">
  82. activity_code,
  83. </if>
  84. <if test="formCode != null and formCode != ''">
  85. form_code,
  86. </if>
  87. <if test="createdBy != null">
  88. created_by,
  89. </if>
  90. <if test="createdAt != null">
  91. created_at,
  92. </if>
  93. </trim>
  94. <trim prefix="values (" suffix=")" suffixOverrides=",">
  95. <if test="wfDefId != null">
  96. #{wfDefId ,jdbcType=BIGINT},
  97. </if>
  98. <if test="activityDefId != null">
  99. #{activityDefId ,jdbcType=BIGINT},
  100. </if>
  101. <if test="activityDefTitle != null and activityDefTitle != ''">
  102. #{activityDefTitle ,jdbcType=VARCHAR},
  103. </if>
  104. <if test="activityDefDesc != null and activityDefDesc != ''">
  105. #{activityDefDesc ,jdbcType=VARCHAR},
  106. </if>
  107. <if test="activityCode != null and activityCode != ''">
  108. #{activityCode ,jdbcType=VARCHAR},
  109. </if>
  110. <if test="formCode != null and formCode != ''">
  111. #{formCode ,jdbcType=VARCHAR},
  112. </if>
  113. <if test="createdBy != null">
  114. #{createdBy ,jdbcType=BIGINT},
  115. </if>
  116. <if test="createdAt != null">
  117. #{createdAt ,jdbcType=DATE},
  118. </if>
  119. </trim>
  120. </insert>
  121. <!--更新-->
  122. <update id="update" parameterType="com.zhyc.xps.bpm.entity.WfActivityDef">
  123. UPDATE wf_activity_def
  124. <trim suffixOverrides=",">
  125. <set>
  126. <if test="activityDefTitle != null and activityDefTitle != ''">
  127. activity_def_title = #{activityDefTitle, jdbcType=VARCHAR},
  128. </if>
  129. <if test="activityDefDesc != null and activityDefDesc != ''">
  130. activity_def_desc = #{activityDefDesc, jdbcType=VARCHAR},
  131. </if>
  132. <if test="activityCode != null and activityCode != ''">
  133. activity_code = #{activityCode ,jdbcType=VARCHAR},
  134. </if>
  135. <if test="formCode != null and formCode != ''">
  136. form_code = #{formCode ,jdbcType=VARCHAR},
  137. </if>
  138. <if test="updatedBy != null ">
  139. updated_by = #{updatedBy ,jdbcType=BIGINT},
  140. </if>
  141. <if test="updatedAt != null">
  142. updated_at = #{updatedAt ,jdbcType=DATE},
  143. </if>
  144. </set>
  145. </trim>
  146. WHERE 1 = 1
  147. <if test="wfDefId != null">
  148. AND wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  149. </if>
  150. <if test="activityDefId != null">
  151. AND activity_def_id = #{activityDefId ,jdbcType=BIGINT}
  152. </if>
  153. </update>
  154. <!--删除-->
  155. <update id="delete" parameterType="java.util.Map">
  156. UPDATE wf_activity_def
  157. <trim suffixOverrides=",">
  158. <set>
  159. <if test="deletedFlag != null">
  160. deleted_flag = #{deletedFlag,jdbcType=BIGINT},
  161. </if>
  162. <if test="deletedTime != null">
  163. deleted_time = #{deletedTime,jdbcType=DATE},
  164. </if>
  165. <if test="deletedBy != null">
  166. deleted_by = #{deletedBy,jdbcType=BIGINT},
  167. </if>
  168. </set>
  169. </trim>
  170. WHERE 1 = 1
  171. <if test="wfDefId != null">
  172. AND wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  173. </if>
  174. <if test="activityDefId != null">
  175. AND activity_def_id = #{activityDefId ,jdbcType=BIGINT}
  176. </if>
  177. </update>
  178. </mapper>