<select id="listCompleted" resultType="java.util.HashMap"> SELECT distinct wp.id as processinstId,DATE_FORMAT(wp.gmtCreatedOn,'%Y-%m-%d %H:%i:%s') as startDate ,DATE_FORMAT(wp.endDate,'%Y-%m-%d %H:%i:%s') as endDate,wp.businessId as docId,wp.gmtVersion,wp.`status` as wf_status ,wp.gmtCreatedOn ,arm.META_INFO_ as metaInfo,arm.NAME_ as `name` FROM wf_processinst wp LEFT JOIN act_re_model arm on arm.KEY_=wp.processDefinationKey WHERE wp.gmtCreatedBy = #{createdBy} -- 自己发起的 <if test="categoryId!=null and categoryId!=''"> and arm.CATEGORY_=#{categoryId} -- 分类 </if> and wp.`status` in <foreach item="wpStatus" collection="wpStatusList" open="(" separator="," close=")"> #{wpStatus} </foreach> -- 状态(Draft:草稿;Approving:审批中;Finished:审批完成;ReRequest:驳回申请人;Declined:拒绝;Canceled:撤销;Error:错误;Suspend:挂起) order by wp.gmtCreatedOn desc -- 完成后的formkey 去哪边找 </select>