META-INF.mybatis.WorkflowRepositoryMapper.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.WorkflowRepository"> <sql id="workflowColumns"> id, title, name, domain, version, xml, xml_md </sql> <select id="loadLatest" resultType="lodsve.workflow.domain.Workflow" parameterType="String"> SELECT * FROM t_workflow t WHERE t.name = #{name} ORDER BY t.version DESC limit 1 </select> <select id="findByDomain" resultType="lodsve.workflow.domain.Workflow" parameterType="String"> SELECT * FROM t_workflow WHERE domain = #{domain} </select> <insert id="save" parameterType="lodsve.workflow.domain.Workflow"> INSERT INTO t_workflow (<include refid="workflowColumns"/>) VALUES ( #{id}, #{title}, #{name}, #{domain}, #{version}, #{xml}, #{xml_md} ) </insert> </mapper>