<?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.jeecg.modules.flowable.apithird.business.mapper.SysDeployFormMapper">

    <select id="selectSysDeployFormByDeployId" resultType="org.jeecg.modules.flowable.apithird.business.entity.FlowForm">
        select t2.form_table_name as formTableName,t1.form_options as formContent,t1.form_name as formName,t1.form_id as formId from sys_form t1 left join sys_deploy_form t2 on t1.form_id = t2.form_id
        where t2.deploy_id = #{deployId} limit 1
    </select>

    <select id="selectSysFormByDeployId" resultType="org.jeecg.modules.flowable.apithird.business.entity.FlowForm">
        select t1.* from sys_form t1 left join sys_deploy_form t2 on t1.form_id = t2.form_id
        where t2.deploy_id = #{deployId} limit 1
    </select>

    <update id="updateBisTabBpmStatus" parameterType="org.jeecg.modules.flowable.apithird.business.entity.FlowForm">
        update ${formTableName} set
        <if test="formTp != null and formTp != ''">
            bpm_status=#{formTp},
        </if>
        <if test="formTp != null and formTp == ''">
            bpm_status=NULL,
        </if>
        deploy_id=#{formUrl} where ${formContent}
    </update>

</mapper>