
mapper.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="Query"> <select id="getWorkItems" resultType="workitem" parameterType="hashmap"> ${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="getActiveTasks" resultType="task" parameterType="hashmap"> ${limitBefore} <include refid="selectActiveTasksPart"/> <include refid="fromActiveTasksPart"/> ${orderby} ${limitAfter} </select> <select id="getActiveTasksCount" resultType="long" parameterType="hashmap"> select count(*) <include refid="fromActiveTasksPart"/> </select> <select id="getActiveOrders" resultType="order" parameterType="hashmap"> ${limitBefore} <include refid="selectActiveOrdersPart"/> <include refid="fromActiveOrdersPart"/> ${orderby} ${limitAfter} </select> <select id="getActiveOrdersCount" resultType="long" parameterType="hashmap"> select count(*) <include refid="fromActiveOrdersPart"/> </select> <select id="getActiveTasksByTaskNames" resultType="task" parameterType="hashmap"> <include refid="selectActiveTasksPart"/> from wf_task <where> <if test="orderId != null"> and order_Id = #{orderId} </if> <if test="excludedTaskId != null"> and id != #{excludedTaskId} </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> </where> </select> <select id="getActiveOrdersByParentId" resultType="order" parameterType="hashmap"> <include refid="selectActiveOrdersPart"/> from wf_order <where> <if test="parentId != null"> parent_Id = #{parentId} </if> <if test="excludedId != null and excludedId.length > 0"> and id not in <foreach collection="excludedId" index="index" item="item" open="(" separator="," close=")"> #{item, jdbcType=VARCHAR} </foreach> </if> </where> </select> <select id="getNextActiveTasks" resultType="task" parameterType="hashmap"> <include refid="selectActiveTasksPart"/> from wf_task where parent_Task_Id in ( select ht.id from wf_hist_task ht where ht.order_id=#{orderId} and ht.task_name=#{taskName} and ht.parent_task_id=#{parentTaskId} ) </select> <sql id="fromActiveOrdersPart"> from wf_order <where> <if test="processId != null and processId.length > 0"> and process_Id in <foreach collection="processId" index="index" item="item" open="(" separator="," close=")"> #{item, jdbcType=VARCHAR} </foreach> </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_task t left join wf_order o on t.order_id = o.id left join wf_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"> o.process_Id = #{processId} </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> </where> </sql> <sql id="selectActiveOrdersPart"> select id, process_Id as processId, creator, create_Time as createTime, parent_Id as parentId, parent_Node_Name as parentNodeName, expire_Time as expireTime, last_Update_Time as lastUpdateTime, last_Updator as lastUpdator, order_No as orderNo, variable, version </sql> <sql id="selectActiveTasksPart"> select id, order_Id as orderId, task_Name as taskName, display_Name as displayName, task_Type as taskType, perform_Type as performType, operator, create_Time as createTime, finish_Time as finishTime, expire_Time as expireTime, action_Url as actionUrl, parent_Task_Id as parentTaskId, variable, version </sql> <sql id="fromActiveTasksPart"> from wf_task left join wf_task_actor ta on ta.task_id = id <where> <if test="actorIds != null and actorIds.length > 0"> ta.actor_Id in <foreach collection="actorIds" index="index" item="item" open="(" separator="," close=")"> #{item, jdbcType=VARCHAR} </foreach> </if> </where> </sql> </mapper>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy