|
@@ -31,31 +31,46 @@
|
|
|
ACT_HI_PROCINST HP
|
|
|
LEFT JOIN flow_instance RE ON HP.ID_ = RE.id
|
|
|
</sql>
|
|
|
+ <sql id="instanceWheres">
|
|
|
+ <if test="query.startUserId != null and query.startUserId != ''">
|
|
|
+ AND HP.START_USER_ID_ = #{query.startUserId}
|
|
|
+ </if>
|
|
|
+ <if test="query.status!= null">
|
|
|
+ AND RE.status = #{query.status}
|
|
|
+ </if>
|
|
|
+ <if test="query.name!= null and query.name!= ''">
|
|
|
+ AND HP.NAME_ like CONCAT('%',#{query.name},'%')
|
|
|
+ </if>
|
|
|
+ <if test="query.modelCode!= null and query.modelCode!= ''">
|
|
|
+ AND HP.PROC_DEF_ID_ like CONCAT(#{query.modelCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="query.definitionId!= null and query.definitionId!= ''">
|
|
|
+ AND HP.PROC_DEF_ID_ = #{query.definitionId}
|
|
|
+ </if>
|
|
|
+ <if test="query.startDates != null and query.startDates.size()>1">
|
|
|
+ AND HP.START_TIME_ between #{query.startDates[0]} and #{query.startDates[1]}
|
|
|
+ </if>
|
|
|
+ <if test="query.endDates != null and query.endDates.size()>1">
|
|
|
+ AND HP.END_TIME_ between #{query.endDates[0]} and #{query.endDates[1]}
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
|
|
|
<select id="list" resultMap="BaseResultMap">
|
|
|
<include refid="instanceColumns"></include>
|
|
|
<where>
|
|
|
- <if test="query.startUserId != null and query.startUserId != ''">
|
|
|
- AND HP.START_USER_ID_ = #{query.startUserId}
|
|
|
- </if>
|
|
|
- <if test="query.status!= null">
|
|
|
- AND RE.status = #{query.status}
|
|
|
- </if>
|
|
|
- <if test="query.name!= null and query.name!= ''">
|
|
|
- AND HP.NAME_ like CONCAT('%',#{query.name},'%')
|
|
|
- </if>
|
|
|
- <if test="query.modelCode!= null and query.modelCode!= ''">
|
|
|
- AND HP.PROC_DEF_ID_ like CONCAT(#{query.modelCode},'%')
|
|
|
- </if>
|
|
|
- <if test="query.definitionId!= null and query.definitionId!= ''">
|
|
|
- AND HP.PROC_DEF_ID_ = #{query.definitionId}
|
|
|
- </if>
|
|
|
- <if test="query.startDates != null and query.startDates.size()>1">
|
|
|
- AND HP.START_TIME_ between #{query.startDates[0]} and #{query.startDates[1]}
|
|
|
- </if>
|
|
|
- <if test="query.endDates != null and query.endDates.size()>1">
|
|
|
- AND HP.END_TIME_ between #{query.endDates[0]} and #{query.endDates[1]}
|
|
|
- </if>
|
|
|
+ <include refid="instanceWheres"></include>
|
|
|
+ </where>
|
|
|
+ ORDER BY
|
|
|
+ HP.ID_ DESC
|
|
|
+ </select>
|
|
|
+ <select id="copy" resultType="com.flow.entity.FlowInstance">
|
|
|
+ <include refid="instanceColumns"></include>
|
|
|
+ LEFT JOIN ACT_HI_ENTITYLINK HE ON
|
|
|
+ HE.PROC_INST_ID_ = RE.id AND
|
|
|
+ HE.TYPE_ = 'copy' AND
|
|
|
+ USER_ID_ = '${@com.flow.common.core.util.SecurityContextUtil@getUserId()}'
|
|
|
+ <where>
|
|
|
+ <include refid="instanceWheres"></include>
|
|
|
</where>
|
|
|
ORDER BY
|
|
|
HP.ID_ DESC
|