
mapper.hist-query.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snaker-core Show documentation
Show all versions of snaker-core Show documentation
snaker-core as open source.
<?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="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> <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="getHistoryOrdersByParentId" resultType="historyorder" parameterType="hashmap"> <include refid="selectHistoryOrdersPart"/> from wf_hist_order <where> <if test="parentId != null"> parent_Id = #{parentId} </if> </where> </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="getHistoryTasksByOrderId" resultType="historytask" parameterType="hashmap"> <include refid="selectHistoryTasksPart"/> from wf_hist_task <where> <if test="orderId != null"> order_Id = #{orderId} </if> </where> order by create_Time desc </select> <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_process p on p.id = o.process_id <where> <if test="processId != null"> o.process_Id = #{processId} </if> <if test="actorIds.length > 0"> and t.operator in <foreach collection="actorIds" index="index" item="item" open="(" separator="," close=")"> #{item, jdbcType=VARCHAR} </foreach> </if> </where> </sql> <sql id="fromHistoryOrdersPart"> from wf_hist_order <where> <if test="processIds.length > 0"> process_Id in <foreach collection="processIds" index="index" item="item" open="(" separator="," close=")"> #{item, jdbcType=VARCHAR} </foreach> </if> </where> </sql> <sql id="fromHistoryTasksPart"> from wf_hist_task left join wf_hist_task_actor ta on ta.task_id = id <where> <if test="actorIds.length > 0"> and ta.actor_Id in <foreach collection="actorIds" index="index" item="item" open="(" separator="," close=")"> #{item, jdbcType=VARCHAR} </foreach> </if> </where> </sql> <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="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> </mapper>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy