<?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.springblade.business.mapper.FixedFlowLinkMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="fixedFlowLinkResultMap" type="org.springblade.business.entity.FixedFlowLink">
        <result column="id" property="id"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="fixed_flow_id" property="fixedFlowId"/>
        <result column="fixed_flow_link" property="fixedFlowLink"/>
        <result column="fixed_flow_link_user" property="fixedFlowLinkUser"/>
        <result column="fixed_flow_link_user_name" property="fixedFlowLinkUserName"/>
        <result column="fixed_flow_link_sort" property="fixedFlowLinkSort"/>
        <result column="fixed_flow_role" property="fixedFlowRole"/>
        <result column="fixed_flow_role_name" property="fixedFlowRoleName"/>
        <result column="project_id" property="projectId"/>
        <result column="contract_id" property="contractId"/>
    </resultMap>

    <update id="deletedByFixedFlowId">
        update u_fixed_flow_link set is_deleted = 1 where fixed_flow_id IN
        <foreach collection="fixedFlowIds" item="fixedFlowId" open="(" separator="," close=")">
            #{fixedFlowId}
        </foreach>
    </update>

    <select id="selectFixedFlowLink" resultMap="fixedFlowLinkResultMap">
        select id,fixed_flow_link_user,fixed_flow_link_user_name from u_fixed_flow_link where is_deleted = 0 and fixed_flow_id = #{fixedFlowId} order by fixed_flow_link_sort ASC
    </select>

</mapper>
