META-INF.mybatis.FlowNodeRepositoryMapper.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="lodsve.workflow.repository.FlowNodeRepository"> <sql id="flowNodeColumns"> id, flow_id, title, name, conditional, next, node_version, interceptor_bean, interceptor_class, url_type </sql> <select id="findByFlowId" resultType="lodsve.workflow.domain.FlowNode" parameterType="Long"> SELECT <include refid="flowNodeColumns"/> FROM t_flow_node WHERE flow_id = #{flowId} </select> <select id="loadByFlowIds" resultType="lodsve.workflow.domain.FlowNode" parameterType="List"> SELECT <include refid="flowNodeColumns"/> FROM t_flow_node WHERE flow_Id IN <foreach collection="flowIds" item="flowId" index="index" separator="," open="(" close=")"> #{flowId} </foreach> </select> <insert id="saveFlowNodes" parameterType="List"> INSERT INTO t_flow_node ( <include refid="flowNodeColumns"/> ) VALUES <foreach collection="list" item="node" separator=","> (#{node.id}, #{node.flowId}, #{node.title}, #{node.name}, #{node.conditional}, #{node.next}, #{node.nodeVersion}, #{node.interceptorBean}, #{node.interceptorClass}, #{node.urlType}) </foreach> </insert> <select id="findCurrentNode" resultType="lodsve.workflow.domain.FlowNode"> SELECT n.* FROM t_flow_node n JOIN t_process_instance pi ON n.id = pi.current_node_id WHERE pi.id = #{processInstanceId} </select> </mapper>