All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.mybatis.WorkTaskRepositoryMapper.xml Maven / Gradle / Ivy

There is a newer version: 2.7.5-RELEASE
Show newest version
<?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="lodsve.workflow.repository.WorkTaskRepository">
    <sql id="workTaskSaveColumns">
        id, flow_id, node_id, resource_id, flow_title, node_title, url_type, task_user_id, task_user_name, result, remark, receive_time
    </sql>

    <insert id="save" parameterType="lodsve.workflow.domain.WorkTask">
        INSERT INTO t_work_task (
        <include refid="workTaskSaveColumns"/>
        )
        VALUES
        (
        #{id},
        #{flowId},
        #{nodeId},
        #{resourceId},
        #{flowTitle},
        #{nodeTitle},
        #{urlType},
        #{taskUserId},
        #{taskUserName},
        #{result},
        #{remark},
        #{receiveTime}
        )
    </insert>

    <select id="findUndoTask" resultType="lodsve.workflow.domain.WorkTask">
        SELECT
        t.*
        FROM
        t_work_task t
        JOIN t_workflow t1 ON t.flow_id = t1.id
        WHERE
        t.flow_id = #{flowId}
        AND t.resource_id = #{resourceId}
        AND t.result = '100'
        AND t.handle_time IS NULL
        AND t1.domain = #{domain}
    </select>

    <insert id="batchSave" parameterType="List">
        INSERT INTO t_work_task (
        <include refid="workTaskSaveColumns"/>
        )
        VALUES
        <foreach collection="list" item="task" separator=",">
            (#{task.id},
            #{task.flowId},
            #{task.nodeId},
            #{task.resourceId},
            #{task.flowTitle},
            #{task.nodeTitle},
            #{task.urlType},
            #{task.taskUserId},
            #{task.taskUserName},
            #{task.result},
            #{task.remark},
            #{task.receiveTime})
        </foreach>
    </insert>

    <select id="listUndoTask" resultType="lodsve.workflow.domain.WorkTask">
        SELECT * FROM t_work_task WHERE task_user_id = #{userId} AND result = '100' AND handle_time IS NULL
        <if test="flowId != null">
            AND flow_id = #{flowId}
        </if>
        <if test="processTitle != null">
            AND process_title LIKE CONCAT('%',#{processTitle},'%')
        </if>
    </select>

    <update id="update">
        UPDATE t_work_task
        SET result = #{result}, remark = #{remark}, handle_time = NOW()
        WHERE id = #{id}
    </update>
</mapper>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy