<commit_before><?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="org.exem.flamingo.web.oozie.workflow.OozieWorkflowRepository">
    <!-- =======================================-->
    <!-- 1. Insert                              -->
    <!-- =======================================-->

    <insert id="insertWorkflow" parameterType="map" useGeneratedKeys="true" keyProperty="id" keyColumn="ID">
        INSERT INTO FL_WORKFLOW (
            WORKFLOW_ID,
            WORKFLOW_NAME,
            VARIABLE,
            WORKFLOW_XML,
            DESIGNER_XML,
            CREATE_DT,
            STATUS,
            TREE_ID,
            USERNAME
        )
        VALUES (
            #{workflowId},
            #{workflowName},
            #{variable},
            #{workflowXml},
            #{designerXml},
            #{create},
            #{status},
            #{treeId},
            #{username}
        )
    </insert>

    <!-- =======================================-->
    <!-- 2. Delete                              -->
    <!-- =======================================-->

    <update id="delete" parameterType="string">
        DELETE FROM FL_WORKFLOW
        WHERE ID = #{value}
    </update>

    <!-- =======================================-->
    <!-- 3. Select                              -->
    <!-- =======================================-->

    <select id="selectByTreeId" resultType="map"  parameterType="string">
        SELECT
            ID as id,
            WORKFLOW_ID as workflowId,
            WORKFLOW_NAME as workflowName,
            VARIABLE as variable,
            WORKFLOW_XML as workflowXml,
            DESIGNER_XML as designerXml,
            CREATE_DT as createDate,
            STATUS as status,
            TREE_ID as treeId,
            USERNAME as username
        FROM FL_WORKFLOW
		WHERE TREE_ID = #{value}
    </select>

    <select id="listWorkflows" resultType="map">
        SELECT
        ID as id,
        WORKFLOW_ID as workflowId,
        WORKFLOW_NAME as workflowName,
        VARIABLE as variable,
        WORKFLOW_XML as workflowXml,
        DESIGNER_XML as designerXml,
        CREATE_DT as createDate,
        STATUS as status,
        TREE_ID as treeId,
        USERNAME as username
        FROM FL_WORKFLOW
    </select>

    <!-- =======================================-->
    <!-- 4. Update                              -->
    <!-- =======================================-->

    <update id="update" parameterType="map">
        UPDATE<commit_msg>FL-102 mapper insert 부분 수정 (화면 연동 부분은 없음)<commit_after><?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="org.exem.flamingo.web.oozie.workflow.OozieWorkflowRepository">
    <!-- =======================================-->
    <!-- 1. Insert                              -->
    <!-- =======================================-->

    <insert id="insertWorkflow" parameterType="map">
        INSERT INTO FL_WORKFLOW (
            WORKFLOW_ID,
            WORKFLOW_NAME,
            VARIABLE,
            WORKFLOW_XML,
            DESIGNER_XML,
            CREATE_DT,
            STATUS,
            TREE_ID,
            USERNAME
        )
        VALUES (
            #{workflowId},
            #{workflowName},
            #{variable},
            #{workflowXml},
            #{designerXml},
            #{create},
            #{status},
            #{treeId},
            #{username}
        )
    </insert>

    <!-- =======================================-->
    <!-- 2. Delete                              -->
    <!-- =======================================-->

    <update id="delete" parameterType="string">
        DELETE FROM FL_WORKFLOW
        WHERE ID = #{value}
    </update>

    <!-- =======================================-->
    <!-- 3. Select                              -->
    <!-- =======================================-->

    <select id="selectByTreeId" resultType="map"  parameterType="string">
        SELECT
            ID as id,
            WORKFLOW_ID as workflowId,
            WORKFLOW_NAME as workflowName,
            VARIABLE as variable,
            WORKFLOW_XML as workflowXml,
            DESIGNER_XML as designerXml,
            CREATE_DT as createDate,
            STATUS as status,
            TREE_ID as treeId,
            USERNAME as username
        FROM FL_WORKFLOW
		WHERE TREE_ID = #{value}
    </select>

    <select id="listWorkflows" resultType="map">
        SELECT
        ID as id,
        WORKFLOW_ID as workflowId,
        WORKFLOW_NAME as workflowName,
        VARIABLE as variable,
        WORKFLOW_XML as workflowXml,
        DESIGNER_XML as designerXml,
        CREATE_DT as createDate,
        STATUS as status,
        TREE_ID as treeId,
        USERNAME as username
        FROM FL_WORKFLOW
    </select>

    <!-- =======================================-->
    <!-- 4. Update                              -->
    <!-- ======================= ================-->

    <update id="update" parameterType="map">
        UPDATE
{'fraction_non_alphanumeric': 0.22400919012062034, 'fraction_numerical': 0.0044035994639096306, 'mean_word_length': 1.690010298661174, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 2, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2273702', 'n_tokens_mistral': 1500, 'n_tokens_neox': 1381, 'n_words': 286}