WfInsMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  4. <mapper namespace="com.zhyc.xps.bpm.mapper.WfInsMapper">
  5. <resultMap id="WfInsDtoResultMap" type="com.zhyc.xps.bpm.dto.WfInsDto">
  6. <result column="oc_id" property="ocId" jdbcType="BIGINT" />
  7. <result column="oc_name" property="ocName" jdbcType="VARCHAR" />
  8. <result column="wf_def_id" property="wfDefId" jdbcType="BIGINT" />
  9. <result column="wf_ins_id" property="wfInsId" jdbcType="BIGINT" />
  10. <result column="wf_ins_title" property="wfInsTitle" jdbcType="VARCHAR" />
  11. <result column="status" property="status" jdbcType="BIGINT" />
  12. <result column="begin_time" property="beginTime" jdbcType="TIMESTAMP"/>
  13. <result column="finish_time" property="finishTime" jdbcType="TIMESTAMP"/>
  14. <result column="cur_activity_ins_id" property="curActivityInsId" jdbcType="BIGINT" />
  15. <result column="cur_activity_code" property="curActivityCode" jdbcType="VARCHAR" />
  16. <result column="cur_activity_title" property="curActivityTitle" jdbcType="VARCHAR" />
  17. <result column="cur_activity_begin_time" property="curActivityBeginTime" jdbcType="TIMESTAMP"/>
  18. <result column="cur_form_code" property="curFormCode" jdbcType="VARCHAR" />
  19. <result column="cur_group_id" property="curGroupId" jdbcType="BIGINT" />
  20. <result column="cur_position_id" property="curPositionId" jdbcType="BIGINT" />
  21. <result column="cur_account_id" property="curAccountId" jdbcType="BIGINT" />
  22. <result column="cur_group_name" property="curGroupName" jdbcType="VARCHAR" />
  23. <result column="cur_position_name" property="curPositionName" jdbcType="VARCHAR" />
  24. <result column="cur_account_name" property="curAccountName" jdbcType="VARCHAR" />
  25. </resultMap>
  26. <sql id="WfInsDto_Cols">
  27. A.oc_id,
  28. B.oc_name,
  29. A.wf_def_id,
  30. A.wf_ins_id,
  31. A.wf_ins_title,
  32. A.status,
  33. A.begin_time,
  34. A.finish_time,
  35. A.cur_activity_ins_id,
  36. A.cur_activity_code,
  37. A.cur_activity_title,
  38. A.cur_activity_begin_time,
  39. A.cur_form_code,
  40. A.cur_group_id,
  41. A.cur_position_id,
  42. A.cur_account_id,
  43. A.cur_group_name,
  44. A.cur_position_name,
  45. A.cur_account_name
  46. </sql>
  47. <!--根据ID获取信息-->
  48. <select id="getById" resultMap="WfInsDtoResultMap">
  49. SELECT
  50. <include refid="WfInsDto_Cols"/>
  51. FROM wf_ins AS A
  52. LEFT JOIN oc AS B ON (A.oc_id = B.oc_id)
  53. WHERE A.deleted_flag = 0
  54. <if test="ocId != null">
  55. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  56. </if>
  57. <if test="wfInsId != null">
  58. AND A.wf_ins_id = #{wfInsId ,jdbcType=BIGINT}
  59. </if>
  60. </select>
  61. <!--分页查询-->
  62. <select id="getByPage" parameterType="java.util.Map" resultMap="WfInsDtoResultMap">
  63. SELECT
  64. <include refid="WfInsDto_Cols"/>
  65. FROM wf_ins AS A
  66. LEFT JOIN oc AS B ON (A.oc_id = B.oc_id)
  67. WHERE A.deleted_flag = 0
  68. <if test="keywords != null and keywords != ''">
  69. and A.wf_ins_title like "%"#{keywords}"%"
  70. </if>
  71. <if test="ocId != null">
  72. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  73. </if>
  74. <if test="wfDefId != null">
  75. AND A.wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  76. </if>
  77. <if test="status != null">
  78. AND A.status = #{status ,jdbcType=BIGINT}
  79. </if>
  80. ORDER BY A.wf_ins_id DESC
  81. </select>
  82. <!--列表查询-->
  83. <select id="getByList" resultMap="WfInsDtoResultMap" parameterType="java.util.Map">
  84. SELECT
  85. <include refid="WfInsDto_Cols"/>
  86. FROM wf_ins AS A
  87. LEFT JOIN oc AS B ON (A.oc_id = B.oc_id)
  88. WHERE 1 = 1 AND A.deleted_flag = 0
  89. <if test="keywords != null and keywords != ''">
  90. AND A.wf_ins_title like "%"#{keywords}"%"
  91. </if>
  92. <if test="ocId != null">
  93. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  94. </if>
  95. <if test="wfDefId != null">
  96. AND A.wf_def_id = #{wfDefId ,jdbcType=BIGINT}
  97. </if>
  98. <if test="status != null">
  99. AND A.status = #{status ,jdbcType=BIGINT}
  100. </if>
  101. ORDER BY A.wf_ins_id DESC
  102. </select>
  103. <insert id="create" parameterType="com.zhyc.xps.bpm.entity.WfIns">
  104. INSERT INTO wf_ins
  105. <trim prefix="(" suffix=")" suffixOverrides=",">
  106. <if test="ocId != null">
  107. oc_id,
  108. </if>
  109. <if test="wfDefId != null">
  110. wf_def_id,
  111. </if>
  112. <if test="wfInsId != null">
  113. wf_ins_id,
  114. </if>
  115. <if test="wfInsTitle != null and wfInsTitle !=''">
  116. wf_ins_title,
  117. </if>
  118. <if test="status != null">
  119. status ,
  120. </if>
  121. <if test="beginTime != null">
  122. begin_time ,
  123. </if>
  124. <if test="createdBy != null">
  125. created_by,
  126. </if>
  127. <if test="createdAt != null">
  128. created_at,
  129. </if>
  130. </trim>
  131. <trim prefix="values (" suffix=")" suffixOverrides=",">
  132. <if test="ocId != null">
  133. #{ocId ,jdbcType=BIGINT},
  134. </if>
  135. <if test="wfDefId != null">
  136. #{wfDefId,jdbcType=BIGINT},
  137. </if>
  138. <if test="wfInsId != null">
  139. #{wfInsId ,jdbcType=BIGINT},
  140. </if>
  141. <if test="wfInsTitle != null and wfInsTitle !=''">
  142. #{wfInsTitle ,jdbcType=VARCHAR},
  143. </if>
  144. <if test="status != null">
  145. #{status ,jdbcType=BIGINT},
  146. </if>
  147. <if test="beginTime != null">
  148. #{beginTime ,jdbcType=TIMESTAMP},
  149. </if>
  150. <if test="createdBy != null">
  151. #{createdBy ,jdbcType=BIGINT},
  152. </if>
  153. <if test="createdAt != null">
  154. #{createdAt ,jdbcType=TIMESTAMP},
  155. </if>
  156. </trim>
  157. </insert>
  158. <!--更新-->
  159. <update id="update" parameterType="com.zhyc.xps.bpm.entity.WfIns">
  160. UPDATE wf_ins
  161. <trim suffixOverrides=",">
  162. <set>
  163. <if test="wfInsTitle != null and wfInsTitle !=''">
  164. wf_ins_title = #{wfInsTitle ,jdbcType=VARCHAR},
  165. </if>
  166. <if test="status != null">
  167. status = #{status ,jdbcType=BIGINT},
  168. </if>
  169. <if test="finishTime != null">
  170. finish_time = #{finishTime ,jdbcType=TIMESTAMP},
  171. </if>
  172. <if test="curGroupId != null">
  173. cur_group_id = #{curGroupId ,jdbcType=BIGINT} ,
  174. </if>
  175. <if test="curPositionId != null">
  176. cur_position_id = #{curPositionId ,jdbcType=BIGINT} ,
  177. </if>
  178. <if test="curAccountId != null">
  179. cur_account_id = #{curAccountId ,jdbcType=BIGINT} ,
  180. </if>
  181. <if test="curGroupName != null">
  182. cur_group_name = #{curGroupName ,jdbcType=VARCHAR} ,
  183. </if>
  184. <if test="curPositionName != null">
  185. cur_position_name = #{curPositionName ,jdbcType=VARCHAR} ,
  186. </if>
  187. <if test="curAccountName != null">
  188. cur_account_name = #{curAccountName ,jdbcType=VARCHAR} ,
  189. </if>
  190. <if test="curActivityInsId != null">
  191. cur_activity_ins_id = #{curActivityInsId ,jdbcType=BIGINT} ,
  192. </if>
  193. <if test="curActivityCode != null">
  194. cur_activity_code = #{curActivityCode ,jdbcType=VARCHAR} ,
  195. </if>
  196. <if test="curActivityTitle != null">
  197. cur_activity_title = #{curActivityTitle ,jdbcType=VARCHAR} ,
  198. </if>
  199. <if test="curFormCode != null">
  200. cur_form_code = #{curFormCode ,jdbcType=VARCHAR} ,
  201. </if>
  202. <if test="curActivityBeginTime != null">
  203. cur_activity_begin_time = #{curActivityBeginTime ,jdbcType=TIMESTAMP},
  204. </if>
  205. <if test="updatedBy != null ">
  206. updated_by = #{updatedBy ,jdbcType=BIGINT},
  207. </if>
  208. <if test="updatedAt != null">
  209. updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
  210. </if>
  211. </set>
  212. </trim>
  213. WHERE 1 = 1
  214. <if test="ocId != null">
  215. AND oc_id = #{ocId ,jdbcType=BIGINT}
  216. </if>
  217. <if test="wfInsId != null">
  218. AND wf_ins_id = #{wfInsId ,jdbcType=BIGINT}
  219. </if>
  220. </update>
  221. <!--删除-->
  222. <update id="delete" parameterType="java.util.Map">
  223. UPDATE wf_ins
  224. <trim suffixOverrides=",">
  225. <set>
  226. <if test="deletedFlag != null">
  227. deleted_flag = #{deletedFlag,jdbcType=BIGINT},
  228. </if>
  229. <if test="deletedTime != null">
  230. deleted_time = #{deletedTime,jdbcType=TIMESTAMP},
  231. </if>
  232. <if test="deletedBy != null">
  233. deleted_by = #{deletedBy,jdbcType=BIGINT},
  234. </if>
  235. </set>
  236. </trim>
  237. WHERE 1 =1
  238. <if test="ocId != null">
  239. AND oc_id = #{ocId ,jdbcType=BIGINT}
  240. </if>
  241. <if test="wfInsId != null">
  242. AND wf_ins_id = #{wfInsId ,jdbcType=BIGINT}
  243. </if>
  244. </update>
  245. </mapper>