<?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="com.srm.bpm.infra.dao.FormDesingerDao">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.srm.bpm.infra.entity.FormDesingerEntity">
        <result column="id" property="id" />
        <result column="version" property="version" />
        <result column="creation_time" property="creationTime" />
        <result column="update_time" property="updateTime" />
        <result column="is_deleted" property="isDeleted" />
        <result column="form_id" property="formId" />
        <result column="desinger_json" property="desingerJson" />
        <result column="layout" property="layout" />
        <result column="columns" property="columns" />
    </resultMap>
    <select id="selectByProcessId"
            resultMap="BaseResultMap">
        SELECT
            fd.form_id,
            fd.desinger_json
        FROM form_desinger fd INNER JOIN toa_form tf ON tf.id = fd.form_id
        WHERE tf.is_deleted = 0 AND tf.process_id = #{processId}
    </select>

</mapper>
