Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
mapper.hist-query.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="HistoryQuery">
<select id="getHistoryOrders" resultType="historyorder" parameterType="hashmap">
${limitBefore}
<include refid="selectHistoryOrdersPart"/>
<include refid="fromHistoryOrdersPart"/>
${orderby}
${limitAfter}
</select>
<select id="getHistoryOrdersCount" resultType="long" parameterType="hashmap">
select count(*)
<include refid="fromHistoryOrdersPart"/>
</select>
<select id="getHistoryTasks" resultType="historytask" parameterType="hashmap">
${limitBefore}
<include refid="selectHistoryTasksPart"/>
<include refid="fromHistoryTasksPart"/>
${orderby}
${limitAfter}
</select>
<select id="getHistoryTasksCount" resultType="long" parameterType="hashmap">
select count(*)
<include refid="fromHistoryTasksPart"/>
</select>
<select id="getWorkItems" parameterType="hashmap" resultType="workitem">
${limitBefore}
<include refid="selectWorkItemsPart"/>
<include refid="fromWorkItemsPart"/>
${orderby}
${limitAfter}
</select>
<select id="getWorkItemsCount" resultType="long" parameterType="hashmap">
select count(*)
<include refid="fromWorkItemsPart"/>
</select>
<sql id="selectHistoryOrdersPart">
select
id,
process_Id as processId,
order_State as orderState,
creator,
create_Time as createTime,
parent_Id as parentId,
expire_Time as expireTime,
end_Time as endTime,
order_No as orderNo,
variable
</sql>
<sql id="fromHistoryOrdersPart">
from wf_hist_order
<where>
<if test="processId != null">
and process_Id = #{processId, jdbcType=VARCHAR}
</if>
<if test="parentId != null">
and parent_Id = #{parentId, jdbcType=VARCHAR}
</if>
<if test="orderNo != null">
and order_No = #{orderNo, jdbcType=VARCHAR}
</if>
<if test="createTimeStart != null">
and create_Time >= #{createTimeStart, jdbcType=VARCHAR}
</if>
<if test="createTimeEnd != null">
and create_Time <= #{createTimeEnd, jdbcType=VARCHAR}
</if>
</where>
</sql>
<sql id="selectHistoryTasksPart">
select
id,
order_Id as orderId,
task_Name as taskName,
display_Name as displayName,
task_Type as taskType,
perform_Type as performType,
task_State as taskState,
operator,
create_Time as createTime,
finish_Time as finishTime,
expire_Time as expireTime,
action_Url as actionUrl,
parent_Task_Id as parentTaskId,
variable
</sql>
<sql id="fromHistoryTasksPart">
from wf_hist_task
left join wf_hist_task_actor ta on ta.task_id = id
<where>
<if test="actorIds != null and actorIds.length > 0">
and ta.actor_Id in
<foreach collection="actorIds" index="index" item="item" open="(" separator="," close=")">
#{item, jdbcType=VARCHAR}
</foreach>
</if>
<if test="taskNames != null and taskNames.length > 0">
and task_Name in
<foreach collection="taskNames" index="index" item="item" open="(" separator="," close=")">
#{item, jdbcType=VARCHAR}
</foreach>
</if>
<if test="orderId != null">
and order_Id = #{orderId, jdbcType=VARCHAR}
</if>
<if test="createTimeStart != null">
and create_Time >= #{createTimeStart, jdbcType=VARCHAR}
</if>
<if test="createTimeEnd != null">
and create_Time <= #{createTimeEnd, jdbcType=VARCHAR}
</if>
</where>
</sql>
<sql id="selectWorkItemsPart">
select
o.process_Id as processId,
t.order_Id as orderId,
t.id as taskId,
p.display_Name as processName,
p.instance_Url as instanceUrl,
o.parent_Id as parentId,
o.creator,
o.create_Time as orderCreateTime,
o.expire_Time as orderExpireTime,
o.order_No as orderNo,
o.variable as orderVariable,
t.variable as taskVariable,
t.display_Name as taskName,
t.task_Type as taskType,
t.perform_Type as performType,
t.operator,
t.action_Url as actionUrl,
t.create_Time as taskCreateTime,
t.finish_Time as taskEndTime,
t.expire_Time as taskExpireTime
</sql>
<sql id="fromWorkItemsPart">
from wf_hist_task t
left join wf_hist_order o on t.order_id = o.id
left join wf_hist_task_actor ta on ta.task_id=t.id
left join wf_process p on p.id = o.process_id
<where>
<if test="processId != null">
and o.process_Id = #{processId, jdbcType=VARCHAR}
</if>
<if test="actorIds != null and actorIds.length > 0">
and ta.actor_Id in
<foreach collection="actorIds" index="index" item="item" open="(" separator="," close=")">
#{item, jdbcType=VARCHAR}
</foreach>
</if>
<if test="createTimeStart != null">
and t.create_Time >= #{createTimeStart, jdbcType=VARCHAR}
</if>
<if test="createTimeEnd != null">
and t.create_Time <= #{createTimeEnd, jdbcType=VARCHAR}
</if>
<if test="parentId != null">
and o.parent_Id = #{parentId, jdbcType=VARCHAR}
</if>
<if test="taskType != null">
and t.task_Type = #{taskType, jdbcType=NUMERIC}
</if>
<if test="performType != null">
and t.perform_Type = #{performType, jdbcType=NUMERIC}
</if>
</where>
</sql>
</mapper>